summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2019-01-27 09:27:46 +0000
committerintrigeri <intrigeri@boum.org>2019-01-27 10:34:12 +0000
commitc8cdbf01d6a8711895bf790c9b991e271f9df27e (patch)
treebf4dc2833c26be2c2f037e9c3f99730cb36a11ce
parentab29142fc9c02a008c2a1c21e2e6739400918eef (diff)
Test suite: try to avoid race condition (refs: #14596)
My commit fd82498abd1edf7d67bfcde035abe72152a96fb6 was overly optimistic: the race condition wrt. catching the "The installation of your additional software failed" notification was not _solely_ caused by the bug I've fixed in 682ea4607780b41a8b94ada84d9b709e2d746b6f. Additionally, sometimes "all notifications have disappeared" (which actively clears the list of notifications) hides the very notification we're looking for and want to interact with. Whenever this happens, 'I see the "The installation of your additional software failed" notification after at most 300 seconds' will succeed anyway (Dogtail will find notifications even after we've cleared them, go figure) but thankfully 'I can open the Additional Software log file from the notification' will fail to interact with an invisible notification (anything else would be utterly confusing). To avoid this problem, we need to stop clearing all notifications. But then the "Warning: virtual machine detected!" notification may hide the one we're looking for. So let's disable the service that would display this spurious notification. Given this scenario runs Tails offline, this should be the only notification displayed at login time, so this blocking it should be a sufficient substitute for clearing all notifications.
-rw-r--r--features/additional_software_packages.feature4
-rw-r--r--features/step_definitions/common_steps.rb5
2 files changed, 8 insertions, 1 deletions
diff --git a/features/additional_software_packages.feature b/features/additional_software_packages.feature
index 3a22659..01e72a9 100644
--- a/features/additional_software_packages.feature
+++ b/features/additional_software_packages.feature
@@ -114,8 +114,10 @@ Feature: Additional software
And I start Tails from USB drive "__internal" with network unplugged
And I enable persistence
And I remove the "cowsay" deb files from the APT cache
+ # Prevent the "Warning: virtual machine detected!" notification from racing
+ # with the one we'll be interacting with below.
+ And I disable the tails-virt-notify-user.service user unit
And I log in to a new session
- And all notifications have disappeared
Then I see the "The installation of your additional software failed" notification after at most 300 seconds
And I can open the Additional Software log file from the notification
And the package "cowsay" is not installed
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index a0749ee..3fdee9c 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -1077,3 +1077,8 @@ When /^I upload "([^"]*)" to "([^"]*)"$/ do |source, destination|
end
end
end
+
+When /^I disable the (.*) (system|user) unit$/ do |unit, scope|
+ options = scope == 'system' ? '' : '--global'
+ $vm.execute_successfully("systemctl #{options} disable '#{unit}'")
+end