summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbertagaz <bertagaz@ptitcanardnoir.org>2018-11-13 17:16:01 +0100
committerbertagaz <bertagaz@ptitcanardnoir.org>2018-11-13 17:16:01 +0100
commitc77c2dd90480f8eb53e0c7861e531574345659ec (patch)
treed77a27aeee7b5ad94fd2132db3b3af352d372883
parent862d114738bb03eca304416535d3eef04d418073 (diff)
Test suite: Really fix the package removal step.
Using dpkg to test if a package was uninstalled was racy and error prone: once really completely removed, dpkg don't have any reference of the package in its database anymore. The 'deinstall' dpkg state is only temporary, so we can not really rely on it to know if a package is removed. Let's use 'apt-cache policy' rather. Refs: #14596
-rw-r--r--features/step_definitions/apt.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/features/step_definitions/apt.rb b/features/step_definitions/apt.rb
index 8754714..3f03dbc 100644
--- a/features/step_definitions/apt.rb
+++ b/features/step_definitions/apt.rb
@@ -74,8 +74,8 @@ Then /^I uninstall "(.+)" using apt$/ do |package|
"sudo -S apt -y remove #{package}",
:user => LIVE_USER,
:spawn => true)
- try_for(4*60) do
- $vm.execute_successfully("dpkg -s '#{package}' 2>/dev/null | grep -qs '^Status:.*deinstall[[:space:]].*$'")
+ try_for(3*60) do
+ $vm.execute_successfully("apt-cache policy #{package} | grep -E --line-regexp '\s{2}Installed:\s\(none\)'")
end
end