Commit 4af9c5ff authored by intrigeri's avatar intrigeri
Browse files

Merge branch 'test/additional-software-with-locked-persistence-robustness' into 'stable'

Test suite: make "Scenario: The Additional Software dpkg hook…" scenario more robust

See merge request tails/tails!93
parents f358a80b 6ae885c0
...@@ -148,7 +148,7 @@ end ...@@ -148,7 +148,7 @@ end
Then /^the Additional Software dpkg hook has been run for package "([^"]*)" and notices the persistence is locked$/ do |package| Then /^the Additional Software dpkg hook has been run for package "([^"]*)" and notices the persistence is locked$/ do |package|
asp_logs = "#{ASP_STATE_DIR}/log" asp_logs = "#{ASP_STATE_DIR}/log"
assert(!$vm.file_empty?(asp_logs)) assert(!$vm.file_empty?(asp_logs))
try_for(120) do try_for(180, delay: 2) do
$vm.execute( $vm.execute(
"grep -E '^.*New\spackages\smanually\sinstalled:\s.*#{package}.*$' " \ "grep -E '^.*New\spackages\smanually\sinstalled:\s.*#{package}.*$' " \
"#{asp_logs}" "#{asp_logs}"
......
...@@ -56,7 +56,7 @@ When /^I update APT using apt$/ do ...@@ -56,7 +56,7 @@ When /^I update APT using apt$/ do
end end
def wait_for_package_installation(package) def wait_for_package_installation(package)
try_for(2 * 60) do try_for(2 * 60, delay: 3) do
$vm.execute_successfully("dpkg -s '#{package}' 2>/dev/null " \ $vm.execute_successfully("dpkg -s '#{package}' 2>/dev/null " \
"| grep -qs '^Status:.*installed$'") "| grep -qs '^Status:.*installed$'")
end end
...@@ -81,7 +81,7 @@ Then /^I install "(.+)" using apt$/ do |package| ...@@ -81,7 +81,7 @@ Then /^I install "(.+)" using apt$/ do |package|
end end
def wait_for_package_removal(package) def wait_for_package_removal(package)
try_for(3 * 60) do try_for(3 * 60, delay: 3) do
# Once purged, a package is removed from the installed package status # Once purged, a package is removed from the installed package status
# database and "dpkg -s" returns a non-zero exit code # database and "dpkg -s" returns a non-zero exit code
!$vm.execute("dpkg -s #{package}").success? !$vm.execute("dpkg -s #{package}").success?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment