From 51680b6ebb645d37ebdfcd122ca163b3a638aefa Mon Sep 17 00:00:00 2001 From: Tails developers Date: Fri, 19 Dec 2014 00:40:08 +0100 Subject: 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 --- features/step_definitions/untrusted_partitions.rb | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 features/step_definitions/untrusted_partitions.rb (limited to 'features/step_definitions/untrusted_partitions.rb') 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 -- cgit v1.2.3-70-g09d2