check recipes execution order
This commit is contained in:
parent
9c656b3285
commit
9b31b2b1df
@ -0,0 +1,2 @@
|
|||||||
|
# depends: "sample-cook::default@0.3.0"
|
||||||
|
File.open('/tmp/chef_success', 'a') {|f| f.puts("compute") }
|
@ -1,3 +1,4 @@
|
|||||||
# depends: "sample-cook::depend@0.3.0"
|
# depends: "sample-cook::depend@0.3.0"
|
||||||
# depends: "sample-cook::other_depend@0.3.0"
|
# depends: "sample-cook::other_depend@0.3.0"
|
||||||
File.open('/tmp/chef_success', 'w') {|f| f.write("SUCCESS!") }
|
# depends: "sample-cook::monitor@0.3.0"
|
||||||
|
File.open('/tmp/chef_success', 'a') {|f| f.puts("default") }
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
File.open('/tmp/chef_success', 'a') {|f| f.puts("monitor") }
|
@ -148,7 +148,10 @@ class TestNode(TestCase):
|
|||||||
|
|
||||||
ret = self.remote.exec_cmd("test -f /tmp/chef_success && echo 'SUCCESS'")
|
ret = self.remote.exec_cmd("test -f /tmp/chef_success && echo 'SUCCESS'")
|
||||||
if not "SUCCESS" in ret:
|
if not "SUCCESS" in ret:
|
||||||
raise Exception("Recipe failed to execute")
|
raise Exception("Recipe failed to execute!")
|
||||||
|
ret = self.remote.exec_cmd("cat /tmp/chef_success")
|
||||||
|
if not ret.split("\r\n")[1:-1] == ['monitor', 'default', 'compute']:
|
||||||
|
raise Exception("Recipes executed in a wrong order!")
|
||||||
|
|
||||||
self.remote.disconnect()
|
self.remote.disconnect()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user