check recipes execution order

This commit is contained in:
Nikolay Markov 2012-07-06 18:01:38 +04:00
parent 9c656b3285
commit 9b31b2b1df
4 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,2 @@
# depends: "sample-cook::default@0.3.0"
File.open('/tmp/chef_success', 'a') {|f| f.puts("compute") }

View File

@ -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") }

View File

@ -0,0 +1 @@
File.open('/tmp/chef_success', 'a') {|f| f.puts("monitor") }

View File

@ -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()