diff --git a/libraries/pacemaker/resource.rb b/libraries/pacemaker/resource.rb index 8eae3eb..1a0e51e 100644 --- a/libraries/pacemaker/resource.rb +++ b/libraries/pacemaker/resource.rb @@ -17,11 +17,11 @@ module Pacemaker end def crm_start_command - "crm --force resource start '#{name}'" + "crm --force --wait resource start '#{name}'" end def crm_stop_command - "crm --force resource stop '#{name}'" + "crm --force --wait resource stop '#{name}'" end # CIB object definitions look something like: diff --git a/spec/helpers/runnable_resource.rb b/spec/helpers/runnable_resource.rb index b6d8a5c..d6ec906 100644 --- a/spec/helpers/runnable_resource.rb +++ b/spec/helpers/runnable_resource.rb @@ -69,7 +69,7 @@ shared_examples "a runnable resource" do |fixture| describe ":start action" do it_should_behave_like "action on non-existent resource", \ :start, - "crm --force resource start #{fixture.name}", \ + "crm --force --wait resource start #{fixture.name}", \ "Cannot start non-existent #{fixture}" it "should do nothing to a started resource" do @@ -78,7 +78,7 @@ shared_examples "a runnable resource" do |fixture| provider.run_action :start - cmd = "crm --force resource start #{fixture.name}" + cmd = "crm --force --wait resource start #{fixture.name}" expect(@chef_run).not_to run_execute(cmd) expect(@resource).not_to be_updated end @@ -90,7 +90,7 @@ shared_examples "a runnable resource" do |fixture| provider.run_action :start - cmd = "crm --force resource start '#{fixture.name}'" + cmd = "crm --force --wait resource start '#{fixture.name}'" expect(@chef_run).to run_execute(cmd) expect(@resource).to be_updated end @@ -99,7 +99,7 @@ shared_examples "a runnable resource" do |fixture| describe ":stop action" do it_should_behave_like "action on non-existent resource", \ :stop, - "crm --force resource stop #{fixture.name}", \ + "crm --force --wait resource stop #{fixture.name}", \ "Cannot stop non-existent #{fixture}" it "should do nothing to a stopped resource" do @@ -108,7 +108,7 @@ shared_examples "a runnable resource" do |fixture| provider.run_action :stop - cmd = "crm --force resource start #{fixture.name}" + cmd = "crm --force --wait resource start #{fixture.name}" expect(@chef_run).not_to run_execute(cmd) expect(@resource).not_to be_updated end @@ -119,7 +119,7 @@ shared_examples "a runnable resource" do |fixture| provider.run_action :stop - cmd = "crm --force resource stop '#{fixture.name}'" + cmd = "crm --force --wait resource stop '#{fixture.name}'" expect(@chef_run).to run_execute(cmd) expect(@resource).to be_updated end