4 :description => "I have started Tails from DVD without network and stopped at Tails Greeter's login screen",
5 :parent_checkpoint => nil,
7 'the network is unplugged',
8 'I start the computer',
9 'the computer boots Tails'
13 'no-network-logged-in' => {
14 :description => "I have started Tails from DVD without network and logged in",
15 :parent_checkpoint => "tails-greeter",
17 'I log in to a new session',
21 'with-network-logged-in' => {
22 :description => "I have started Tails from DVD and logged in and the network is connected",
23 :parent_checkpoint => "no-network-logged-in",
25 'the network is plugged',
27 'all notifications have disappeared',
28 'available upgrades have been checked',
32 'no-network-bridge-mode' => {
34 :description => "I have started Tails from DVD without network and logged in with bridge mode enabled",
35 :parent_checkpoint => "tails-greeter",
37 'I enable the specific Tor configuration option',
38 'I log in to a new session',
39 'all notifications have disappeared',
43 'no-network-logged-in-sudo-passwd' => {
45 :description => "I have started Tails from DVD without network and logged in with an administration password",
46 :parent_checkpoint => "tails-greeter",
48 'I set an administration password',
49 'I log in to a new session',
53 'with-network-logged-in-sudo-passwd' => {
55 :description => "I have started Tails from DVD and logged in with an administration password and the network is connected",
56 :parent_checkpoint => "no-network-logged-in-sudo-passwd",
58 'the network is plugged',
60 'all notifications have disappeared',
61 'available upgrades have been checked',
65 'usb-install-tails-greeter' => {
66 :description => "I have started Tails without network from a USB drive without a persistent partition and stopped at Tails Greeter's login screen",
67 :parent_checkpoint => nil,
69 'I create a 7200 MiB disk named "__internal"',
70 'I plug USB drive "__internal"',
71 'I write the Tails USB image to disk "__internal"',
72 'I start Tails from USB drive "__internal" with network unplugged',
73 'the boot device has safe access rights',
74 'Tails is running from USB drive "__internal"',
75 'there is no persistence partition on USB drive "__internal"',
76 'process "udev-watchdog" is running',
77 'udev-watchdog is monitoring the correct device',
81 'usb-install-logged-in' => {
82 :description => "I have started Tails without network from a USB drive without a persistent partition and logged in",
83 :parent_checkpoint => 'usb-install-tails-greeter',
85 'I log in to a new session',
89 'usb-install-with-persistence-tails-greeter' => {
90 :description => "I have started Tails without network from a USB drive with a persistent partition and stopped at Tails Greeter's login screen",
91 :parent_checkpoint => 'usb-install-logged-in',
93 'I create a persistent partition',
94 'a Tails persistence partition exists on USB drive "__internal"',
95 'I shutdown Tails and wait for the computer to power off',
96 'I start Tails from USB drive "__internal" with network unplugged',
97 'the boot device has safe access rights',
98 'Tails is running from USB drive "__internal"',
99 'process "udev-watchdog" is running',
100 'udev-watchdog is monitoring the correct device',
104 'usb-install-with-persistence-logged-in' => {
105 :description => "I have started Tails without network from a USB drive with a persistent partition enabled and logged in",
106 :parent_checkpoint => 'usb-install-with-persistence-tails-greeter',
108 'I enable persistence',
109 'I log in to a new session',
110 'all persistence presets are enabled',
111 'all persistent filesystems have safe access rights',
112 'all persistence configuration files have safe access rights',
113 'all persistent directories have safe access rights',
117 'usb-install-with-persistence-logged-in-with-administration-password' => {
118 :description => "I have started Tails without network from a USB drive with a persistent partition enabled and logged in with an administration password",
119 :parent_checkpoint => 'usb-install-with-persistence-tails-greeter',
121 'I enable persistence',
122 'I set an administration password',
123 'I log in to a new session',
124 'all persistence presets are enabled',
125 'all persistent filesystems have safe access rights',
126 'all persistence configuration files have safe access rights',
127 'all persistent directories have safe access rights',
133 def reach_checkpoint(name)
134 scenario_indent = " "*4
138 if VM.snapshot_exists?(name)
139 $vm.restore_snapshot(name)
140 post_snapshot_restore_hook
142 checkpoint = checkpoints[name]
143 checkpoint_description = checkpoint[:description]
144 parent_checkpoint = checkpoint[:parent_checkpoint]
145 steps = checkpoint[:steps]
147 if VM.snapshot_exists?(parent_checkpoint)
148 $vm.restore_snapshot(parent_checkpoint)
150 reach_checkpoint(parent_checkpoint)
152 post_snapshot_restore_hook
154 debug_log(scenario_indent + "Checkpoint: #{checkpoint_description}",
155 color: :white, timestamp: false)
156 step_action = "Given"
158 parent_description = checkpoints[parent_checkpoint][:description]
159 debug_log(step_indent + "#{step_action} #{parent_description}",
160 color: :green, timestamp: false)
166 rescue Exception => e
167 debug_log(scenario_indent +
168 "Step failed while creating checkpoint: #{s}",
169 color: :red, timestamp: false)
172 debug_log(step_indent + "#{step_action} #{s}",
173 color: :green, timestamp: false)
176 $vm.save_snapshot(name)
180 # For each checkpoint we generate a step to reach it.
181 checkpoints.each do |name, desc|
182 step_regex = Regexp.new("^#{Regexp.escape(desc[:description])}$")
184 reach_checkpoint(name)