tests/requests/orchestrations_tests.rb in fog-oraclecloud-0.1.7 vs tests/requests/orchestrations_tests.rb in fog-oraclecloud-0.1.8

- old
+ new

@@ -1,12 +1,13 @@ require 'pp' Shindo.tests('Fog::Compute[oraclecloud] | orchestration requests', 'orchestrations') do - + orch_name = "OrchestrationTest-#{rand(100)}" + tests("#orchestrations-create", "create") do orchestration = Fog::Compute[:oraclecloud].orchestrations.create( - :name => "OrchestrationTest-#{rand(100)}", + :name => orch_name, :oplans => [{ 'label' =>"WebServer", 'obj_type' => "launchplan", 'objects' => [{ 'instances' =>[{ @@ -39,11 +40,11 @@ 'name' => 'DatabaseServer' }] }] } orchestration.save() - orchestration.wait_for { ready? } + #orchestration.wait_for { ready? } test "can update orchestration" do check = Fog::Compute[:oraclecloud].orchestrations.get(orchestration.name) check.oplans.size == 2 end @@ -56,32 +57,35 @@ orchestration.wait_for { stopped? } test "can stop" do orchestration.status == 'stopped' end - orchestration.destroy() - tests("can delete orchestration").raises(Excon::Error::NotFound) do - check = Fog::Compute[:oraclecloud].orchestrations.get(orchestration.name) - end + end tests("#orchestrations-read") do orchestrations = Fog::Compute[:oraclecloud].orchestrations test "returns an Array" do orchestrations.is_a? Array end - orchestrations.each do |orch| - puts orch.name - end + test "should return keys" do orchestrations.size >= 1 end test "should return a valid name" do orchestrations.first.name.is_a? String end orchestrations = Fog::Compute[:oraclecloud].orchestrations.get(orchestrations.first.name) test "should return a key" do orchestrations.name.is_a? String + end + end + + tests("#orchestrations-delete", "create") do + orchestration = Fog::Compute[:oraclecloud].orchestrations.get(orch_name) + orchestration.destroy() + tests("can delete orchestration").raises(Fog::Compute::OracleCloud::NotFound) do + check = Fog::Compute[:oraclecloud].orchestrations.get(orchestration.name) end end end \ No newline at end of file