Merge remote-tracking branch 'origin/master' into stable
[tails.git] / features / additional_software_packages.feature
blob4ab5a51d07f0e73dc7bea707802164bb05fe0aa5
1 @product @check_tor_leaks @slow
3 Feature: Additional software
4   As a Tails user
5   I may want to install softwares not shipped in Tails
6   And have them installed automatically when I enable persistence in the Greeter
8   # An issue with this feature is that scenarios depend on each
9   # other. When editing this feature, make sure you understand these
10   # dependencies (which are documented below).
12   #18852
13   @not_release_blocker @fragile
14   Scenario: I am warned I can not use Additional Software when I start Tails from a DVD and install a package
15     Given I have started Tails from DVD and logged in with an administration password and the network is connected
16     And I update APT using apt
17     When I install "popularity-contest" using apt
18     Then I am notified I can not use Additional Software for "popularity-contest"
19     And I can open the Additional Software documentation from the notification
21   # Here we install the popularity-contest package to test if debconf does not prevent
22   # Additional Software from automatically installing packages.
23   # This scenario also sets up the "__internal" drive that the following
24   # scenarios will reuse.
25   # Note: the "__internal" drive will keep its state across scenarios
26   # and features until one of its snapshots is restored.
27   Scenario: I set up Additional Software when installing a package without persistent partition and the package is installed next time I start Tails
28     Given I start Tails from a freshly installed USB drive with an administration password and the network is plugged and I login
29     And I update APT using apt
30     And I install "popularity-contest" using apt
31     Then I am proposed to add the "popularity-contest" package to my Additional Software
32     When I create a persistent storage and activate the Additional Software feature
33     Then Additional Software is correctly configured for package "popularity-contest"
34     When I shutdown Tails and wait for the computer to power off
35     And I start Tails from USB drive "__internal" with network unplugged
36     And I enable persistence
37     And I log in to a new session
38     And the Additional Software installation service has started
39     Then I am notified that the installation succeeded
40     And Additional Software is correctly configured for package "popularity-contest"
41     And the package "popularity-contest" is installed after Additional Software has been started
43   # Depends on scenario: I set up Additional Software when installing a package without persistent partition and the package is installed next time I start Tails
44   Scenario: The Additional Software dpkg hook notices when persistence is locked down while installing a package
45     Given a computer
46     And I start Tails from USB drive "__internal" and I login with an administration password
47     And I update APT using apt
48     When I install "makepp" using apt
49     Then the Additional Software dpkg hook has been run for package "makepp" and notices the persistence is locked
50     And the package "makepp" is installed
52   # Depends on scenario: I set up Additional Software when installing a package without persistent partition and the package is installed next time I start Tails
53   Scenario: My Additional Software list is configurable through a GUI or through notifications when I install or remove packages with APT or Synaptic
54     Given a computer
55     And I start Tails from USB drive "__internal" and I login with persistence enabled and an administration password
56     When I uninstall "popularity-contest" using apt
57     And I accept removing "popularity-contest" from Additional Software
58     Then "popularity-contest" is not in the list of Additional Software
59     When I start Synaptic
60     And I update APT using Synaptic
61     And I install "cowsay" using Synaptic
62     And I accept adding "cowsay" to Additional Software
63     Then Additional Software is correctly configured for package "cowsay"
64     When I uninstall "cowsay" using apt
65     And I refuse removing "cowsay" from Additional Software
66     Then Additional Software is correctly configured for package "cowsay"
67     When I start "Additional Software" via GNOME Activities Overview
68     And I remove "cowsay" from the list of Additional Software using Additional Software GUI
69     Then "cowsay" is not in the list of Additional Software
70     When I install "cowsay" using apt
71     And I refuse adding "cowsay" to Additional Software
72     Then "cowsay" is not in the list of Additional Software
74   # Depends on scenario: My Additional Software list is configurable through a GUI or through notifications when I install or remove packages with APT or Synaptic
75   # See https://tails.net/blueprint/additional_software_packages/offline_mode/#incomplete-online-upgrade for high level logic
76   @not_release_blocker
77   Scenario: Recovering in offline mode after Additional Software previously failed to upgrade and then succeed to upgrade when online
78     Given a computer
79     And I start Tails from USB drive "__internal" and I login with persistence enabled and an administration password
80     And I configure APT to prefer an old version of cowsay
81     When I install an old version "3.03+dfsg2-1" of the cowsay package using apt
82     And I accept adding "cowsay" to Additional Software
83     And Additional Software is correctly configured for package "cowsay"
84     And I shutdown Tails and wait for the computer to power off
85     And I start Tails from USB drive "__internal" with network unplugged
86     And I enable persistence
87     # We need to add back this custom APT source for the Additional Software
88     # install step, as it was not saved in persistence
89     And I configure APT to prefer an old version of cowsay
90     And I log in to a new session
91     And the installed version of package "cowsay" is "3.03+dfsg2-1" after Additional Software has been started
92     And I revert the APT tweaks that made it prefer an old version of cowsay
93     # We remove the newest package after it has been downloaded and before
94     # it is installed, so that the upgrade process fails
95     And I prepare the Additional Software upgrade process to fail
96     And the network is plugged
97     And Tor is ready
98     # Note: the next step races against the appearance of the "The
99     # upgrade of your additional software failed" notification.
100     # It should win most of the time, which is good, but there's no
101     # guarantee it does. If it loses, then it'll remove the notification
102     # we'll be trying to interact with below ("I can open…")
103     And all notifications have disappeared
104     And available upgrades have been checked
105     And I see the "The upgrade of your additional software failed" notification after at most 300 seconds
106     And I can open the Additional Software configuration window from the notification
107     And I shutdown Tails and wait for the computer to power off
108     And I start Tails from USB drive "__internal" with network unplugged
109     And I enable persistence
110     # We need to add back this custom APT source for the Additional Software
111     # install step, as it was not saved in persistence
112     And I configure APT to prefer an old version of cowsay
113     And I log in to a new session
114     And the installed version of package "cowsay" is "3.03+dfsg2-1" after Additional Software has been started
115     And I revert the APT tweaks that made it prefer an old version of cowsay
116     And the network is plugged
117     And Tor is ready
118     Then the Additional Software upgrade service has started
119     And the installed version of package "cowsay" is newer than "3.03+dfsg2-1"
121   # Depends on scenario: Recovering in offline mode after Additional Software previously failed to upgrade and then succeed to upgrade when online
122   @not_release_blocker_inherited
123   Scenario: I am notified when Additional Software fails to install a package
124     Given a computer
125     And I start Tails from USB drive "__internal" with network unplugged
126     And I enable persistence
127     And I remove the "cowsay" deb files from the APT cache
128     # Prevent the "Warning: virtual machine detected!" notification from racing
129     # with the one we'll be interacting with below.
130     And I disable the tails-virt-notify-user.service user unit
131     And I log in to a new session
132     Then I see the "The installation of your additional software failed" notification after at most 300 seconds
133     And I can open the Additional Software log file from the notification
134     And the package "cowsay" is not installed