Merge pull request #128 from aspiers/crm-wait-sync-master

use crm --wait to avoid races (stoney)
This commit is contained in:
Vincent Untz 2014-08-01 14:14:32 -04:00
commit 5b4bb9262d
2 changed files with 8 additions and 8 deletions

View File

@ -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:

View File

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