Merge remote-tracking branch 'origin/master' into stable
[tails.git] / features / persistence.feature
blobe439a44d385a3fd8891509cf2ec5e832afb79e9b
1 @product
2 Feature: Tails persistence
3   As a Tails user
4   I want to use a Persistent Storage
6   Scenario: Tails Persistent Storage behave tests
7     Given I have started Tails from DVD and logged in with an administration password and the network is connected
8     And I update APT using apt
9     And I install "python3-behave" using apt
10     Then the Tails Persistent Storage behave tests pass
12   Scenario: Booting Tails from a USB drive with a disabled persistent partition
13     Given I have started Tails without network from a USB drive with a persistent partition and stopped at Tails Greeter's login screen
14     When I log in to a new session without activating the Persistent Storage
15     Then Tails is running from USB drive "__internal"
16     And persistence is disabled
17     But a Tails persistence partition exists on USB drive "__internal"
19   Scenario: Creating a Persistent Storage
20     Given I have started Tails without network from a USB drive without a persistent partition and logged in
21     Then Tails is running from USB drive "__internal"
22     When I create a file in the Persistent directory
23     And I create a persistent partition with the default settings
24     Then the file I created was copied to the Persistent Storage
25     When I shutdown Tails and wait for the computer to power off
26     And I start Tails from USB drive "__internal" with network unplugged and I login with persistence enabled
27     Then persistence for "Persistent" is active
28     And the file I created in the Persistent directory exists
30   Scenario: Creating a Persistent Storage when system is low on memory
31     Given I have started Tails without network from a USB drive without a persistent partition and logged in
32     And the system is very low on memory
33     When I create a file in the Persistent directory
34     When I try to create a persistent partition
35     Then The Persistent Storage app shows the error message "Not enough memory to create Persistent Storage"
36     When I close the Persistent Storage app
37     And I free up some memory
38     And I create a persistent partition with the default settings
39     Then the file I created was copied to the Persistent Storage
41   Scenario: Booting Tails from a USB drive with an enabled persistent partition and reconfiguring it
42     Given I have started Tails without network from a USB drive with a persistent partition enabled and logged in
43     Then Tails is running from USB drive "__internal"
44     And all tps features are active
45     And all persistent directories have safe access rights
46     When I disable the first tps feature
47     Then all tps features but the first one are active
48     And I shutdown Tails and wait for the computer to power off
49     And I start Tails from USB drive "__internal" with network unplugged and I login with persistence enabled
50     Then all tps features but the first one are active
52   Scenario: Activating and deactivating Persistent Storage features
53     Given I have started Tails without network from a USB drive with a persistent partition enabled and logged in
54     Then persistence for "Persistent" is active
55     And I create a file in the Persistent directory
56     Then the file I created was copied to the Persistent Storage
57     When I disable the first tps feature
58     Then persistence for "Persistent" is not active
59     And the Persistent directory does not exist
60     When I enable the first tps feature
61     Then persistence for "Persistent" is active
62     And the file I created in the Persistent directory exists
64   Scenario: Deleting data of a Persistent Storage feature
65     Given I have started Tails without network from a USB drive with a persistent partition enabled and logged in
66     Then persistence for "Persistent" is active
67     When I create a file in the Persistent directory
68     And I disable the first tps feature
69     And I delete the data of the Persistent Folder feature
70     Then the file I created does not exist on the Persistent Storage
72   Scenario: Writing files to a read/write-enabled persistent partition
73     Given I have started Tails without network from a USB drive with a persistent partition enabled and logged in
74     And the network is plugged
75     And Tor is ready
76     And I take note of which tps features are available
77     When I write some files expected to persist
78     And I shutdown Tails and wait for the computer to power off
79     # XXX: The next step succeeds (and the --debug output confirms that it's actually looking for the files) but will fail in a subsequent scenario restoring the same snapshot. This exactly what we want, but why does it work? What is guestfs's behaviour when qcow2 internal snapshots are involved?
80     Then only the expected files are present on the persistence partition on USB drive "__internal"
82   Scenario: Creating and using a persistent NetworkManager connection
83     Given I have started Tails without network from a USB drive with a persistent partition enabled and logged in
84     And the network is plugged
85     And Tor is ready
86     And I add a wired DHCP NetworkManager connection called "persistent-con-current"
87     And I shutdown Tails and wait for the computer to power off
88     Given I start Tails from USB drive "__internal" with network unplugged and I login with persistence enabled
89     And I capture all network traffic
90     And the network is plugged
91     And Tor is ready
92     And I switch to the "persistent-con-current" NetworkManager connection
93     And the 1st network device has a spoofed MAC address configured
94     And no network device leaked the real MAC address
96   Scenario: Creating persistence from the Welcome Screen
97     Given I have started Tails without network from a USB drive without a persistent partition and stopped at Tails Greeter's login screen
98     And I enable persistence creation in Tails Greeter
99     And I log in to a new session expecting no warning about the Persistent Storage not being activated
100     Then I create a persistent partition with the default settings using the wizard that was already open
102   Scenario: Persistent Greeter options
103     Given I have started Tails without network from a USB drive with a persistent partition and stopped at Tails Greeter's login screen
104     When I enable persistence
105     Then no persistent Greeter options were restored
106     When I set all Greeter options to non-default values
107     And I log in to a new session in German (de) after having activated the Persistent Storage
108     Then all Greeter options are set to non-default values
109     When I cold reboot the computer
110     And the computer reboots Tails
111     Given I enable persistence
112     Then persistent Greeter options were restored
113     When I log in to a new session after having activated the Persistent Storage
114     Then all Greeter options are set to non-default values
116   Scenario: Changing the Persistent Storage passphrase
117     Given I have started Tails without network from a USB drive with a persistent partition enabled and logged in
118     # Note that if anything fails after the passphrase was changed and
119     # before it's changed back below, subsequent scenarios might fail
120     # because the Persistent Storage doesn't have the expected passphrase.
121     When I change the passphrase of the Persistent Storage
122     And I shutdown Tails and wait for the computer to power off
123     Then I start Tails from USB drive "__internal" with network unplugged and I login with the changed persistence passphrase
124     And I change the passphrase of the Persistent Storage back to the original
126   Scenario: Deleting a Tails persistent partition
127     Given I have started Tails without network from a USB drive with a persistent partition and stopped at Tails Greeter's login screen
128     And I log in to a new session without activating the Persistent Storage
129     Then persistence is disabled
130     But a Tails persistence partition exists on USB drive "__internal"
131     And all notifications have disappeared
132     When I delete the persistent partition
133     Then there is no persistence partition on USB drive "__internal"
135   Scenario: Dotfiles persistence
136     Given I have started Tails without network from a USB drive with a persistent partition enabled and logged in
137     When I write some dotfile expected to persist
138     And I shutdown Tails and wait for the computer to power off
139     And I start Tails from USB drive "__internal" with network unplugged and I login with persistence enabled
140     Then the expected persistent dotfile is present in the filesystem
142   Scenario: Feature activation fails
143     Given I have started Tails without network from a USB drive with a persistent partition and stopped at Tails Greeter's login screen
144     And I create a symlink "/home/amnesia/Persistent" to "/etc"
145     When I try to enable persistence
146     Then the Welcome Screen tells me that the Persistent Folder feature couldn't be activated
147     When I log in to a new session after having activated the Persistent Storage
148     And all notifications have disappeared
149     Then the Persistent Storage settings tell me that the Persistent Folder feature couldn't be activated
150     And all tps features are enabled
151     And all tps features but the first one are active
153   Scenario: LUKS header is automatically upgraded when unlocking the Persistent Storage
154     Given I have started Tails without network from a USB drive with a LUKS 1 persistent partition and stopped at Tails Greeter's login screen
155     And I enable persistence
156     And I log in to a new session after having activated the Persistent Storage
157     Then a Tails persistence partition with LUKS version 2 and argon2id exists on USB drive "__internal"
158     And persistence is enabled
160   Scenario: LUKS backup header is restored if something goes wrong during upgrade
161     Given I have started Tails without network from a USB drive with a LUKS 1 persistent partition and stopped at Tails Greeter's login screen
162     And I enable persistence but something goes wrong during the LUKS header upgrade
163     Then the Tails persistence partition on USB drive "__internal" still has LUKS version 1