diff options
author | Tails developers <amnesia@boum.org> | 2014-12-19 00:40:08 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2014-12-21 09:45:40 +0100 |
commit | 51680b6ebb645d37ebdfcd122ca163b3a638aefa (patch) | |
tree | 337e128d2eac3cbc89ecbacf38851bfa33469cd5 /features/step_definitions/untrusted_partitions.rb | |
parent | 44bab3c86ca3d95837f4c50cc535206352385a46 (diff) | |
download | jenkins.debian.net-51680b6ebb645d37ebdfcd122ca163b3a638aefa.tar.xz |
files copied from https://git-tails.immerda.ch/tails - many thanks to the tails developers for their nice work and documentation of it - these files have been released under the GNU General Public License version 3 or (at your option) any later version
features/images has been omitted
Diffstat (limited to 'features/step_definitions/untrusted_partitions.rb')
-rw-r--r-- | features/step_definitions/untrusted_partitions.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/features/step_definitions/untrusted_partitions.rb b/features/step_definitions/untrusted_partitions.rb new file mode 100644 index 00000000..de2e0a70 --- /dev/null +++ b/features/step_definitions/untrusted_partitions.rb @@ -0,0 +1,35 @@ +Given /^I create a (\d+) ([[:alpha:]]+) disk named "([^"]+)"$/ do |size, unit, name| + next if @skip_steps_while_restoring_background + @vm.storage.create_new_disk(name, {:size => size, :unit => unit, + :type => "raw"}) +end + +Given /^I create a ([[:alpha:]]+) label on disk "([^"]+)"$/ do |type, name| + next if @skip_steps_while_restoring_background + @vm.storage.disk_mklabel(name, type) +end + +Given /^I create a ([[:alnum:]]+) filesystem on disk "([^"]+)"$/ do |type, name| + next if @skip_steps_while_restoring_background + @vm.storage.disk_mkpartfs(name, type) +end + +Given /^I cat an ISO hybrid of the Tails image to disk "([^"]+)"$/ do |name| + next if @skip_steps_while_restoring_background + disk_path = @vm.storage.disk_path(name) + tails_iso_hybrid = "#{$tmp_dir}/#{File.basename($tails_iso)}" + begin + cmd_helper("cp '#{$tails_iso}' '#{tails_iso_hybrid}'") + cmd_helper("isohybrid '#{tails_iso_hybrid}' --entry 4 --type 0x1c") + cmd_helper("dd if='#{tails_iso_hybrid}' of='#{disk_path}' conv=notrunc") + ensure + cmd_helper("rm -f '#{tails_iso_hybrid}'") + end +end + +Then /^drive "([^"]+)" is not mounted$/ do |name| + next if @skip_steps_while_restoring_background + dev = @vm.disk_dev(name) + assert(!@vm.execute("grep -qs '^#{dev}' /proc/mounts").success?, + "an untrusted partition from drive '#{name}' was automounted") +end |