diff options
author | Holger Levsen <holger@layer-acht.org> | 2014-12-19 02:03:30 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2014-12-21 09:47:01 +0100 |
commit | bc9261df47a5dc59b670142485329299c944f984 (patch) | |
tree | 65cf0370e2438c14533bb7010ee66fc99cf91541 | |
parent | 1bd026fa13481d9dcf14ab92baa4277324244466 (diff) | |
download | jenkins.debian.net-bc9261df47a5dc59b670142485329299c944f984.tar.xz |
lvc: remove some test scenarios we will never test (but are nice features in tails)
-rw-r--r-- | features/erase_memory.feature | 61 | ||||
-rw-r--r-- | features/i2p.feature | 33 | ||||
-rw-r--r-- | features/step_definitions/erase_memory.rb | 172 | ||||
-rw-r--r-- | features/step_definitions/i2p.rb | 60 | ||||
-rw-r--r-- | features/step_definitions/truecrypt.rb | 12 | ||||
-rw-r--r-- | features/step_definitions/windows_camouflage.rb | 10 | ||||
-rw-r--r-- | features/truecrypt.feature | 12 | ||||
-rw-r--r-- | features/windows_camouflage.feature | 36 |
8 files changed, 0 insertions, 396 deletions
diff --git a/features/erase_memory.feature b/features/erase_memory.feature deleted file mode 100644 index 56d3a402..00000000 --- a/features/erase_memory.feature +++ /dev/null @@ -1,61 +0,0 @@ -@product -Feature: System memory erasure on shutdown - As a Tails user - when I shutdown Tails - I want the system memory to be free from sensitive data. - - Scenario: Anti-test: no memory erasure on a modern computer - Given a computer - And the computer is a modern 64-bit system - And the computer has 8 GiB of RAM - And I set Tails to boot with options "debug=wipemem" - And I start Tails from DVD with network unplugged and I login - Then the PAE kernel is running - And at least 8 GiB of RAM was detected - And process "memlockd" is running - And process "udev-watchdog" is running - When I fill the guest's memory with a known pattern without verifying - And I reboot without wiping the memory - Then I find many patterns in the guest's memory - - Scenario: Memory erasure on a modern computer - Given a computer - And the computer is a modern 64-bit system - And the computer has 8 GiB of RAM - And I set Tails to boot with options "debug=wipemem" - And I start Tails from DVD with network unplugged and I login - Then the PAE kernel is running - And at least 8 GiB of RAM was detected - And process "memlockd" is running - And process "udev-watchdog" is running - When I fill the guest's memory with a known pattern - And I shutdown and wait for Tails to finish wiping the memory - Then I find very few patterns in the guest's memory - - Scenario: Anti-test: no memory erasure on an old computer - Given a computer - And the computer is an old pentium without the PAE extension - And the computer has 8 GiB of RAM - And I set Tails to boot with options "debug=wipemem" - And I start Tails from DVD with network unplugged and I login - Then the non-PAE kernel is running - And at least 3500 MiB of RAM was detected - And process "memlockd" is running - And process "udev-watchdog" is running - When I fill the guest's memory with a known pattern without verifying - And I reboot without wiping the memory - Then I find many patterns in the guest's memory - - Scenario: Memory erasure on an old computer - Given a computer - And the computer is an old pentium without the PAE extension - And the computer has 8 GiB of RAM - And I set Tails to boot with options "debug=wipemem" - And I start Tails from DVD with network unplugged and I login - And the non-PAE kernel is running - And at least 3500 MiB of RAM was detected - And process "memlockd" is running - And process "udev-watchdog" is running - When I fill the guest's memory with a known pattern - And I shutdown and wait for Tails to finish wiping the memory - Then I find very few patterns in the guest's memory diff --git a/features/i2p.feature b/features/i2p.feature deleted file mode 100644 index fc4cdf01..00000000 --- a/features/i2p.feature +++ /dev/null @@ -1,33 +0,0 @@ -@product -Feature: I2P - As a Tails user - I *might* want to use I2P - - Scenario: I2P is disabled by default - Given a computer - And I start the computer - And the computer boots Tails - And I log in to a new session - And GNOME has started - And Tor is ready - And all notifications have disappeared - Then the I2P Browser desktop file is not present - And the I2P Browser sudo rules are not present - And the I2P firewall rules are disabled - - Scenario: I2P is enabled when the "i2p" boot parameter is added - Given a computer - And I set Tails to boot with options "i2p" - And I start the computer - And the computer boots Tails - And I log in to a new session - And GNOME has started - And Tor is ready - And I2P is running - And the I2P router console is ready - And all notifications have disappeared - Then the I2P Browser desktop file is present - And the I2P Browser sudo rules are enabled - And the I2P firewall rules are enabled - When I start the I2P Browser through the GNOME menu - Then I see "I2P_router_console.png" after at most 60 seconds diff --git a/features/step_definitions/erase_memory.rb b/features/step_definitions/erase_memory.rb deleted file mode 100644 index 171f997c..00000000 --- a/features/step_definitions/erase_memory.rb +++ /dev/null @@ -1,172 +0,0 @@ -Given /^the computer is a modern 64-bit system$/ do - next if @skip_steps_while_restoring_background - @vm.set_arch("x86_64") - @vm.drop_hypervisor_feature("nonpae") - @vm.add_hypervisor_feature("pae") -end - -Given /^the computer is an old pentium without the PAE extension$/ do - next if @skip_steps_while_restoring_background - @vm.set_arch("i686") - @vm.drop_hypervisor_feature("pae") - # libvirt claim the following feature doesn't exit even though - # it's listed in the hvm i686 capabilities... -# @vm.add_hypervisor_feature("nonpae") - # ... so we use a workaround until we can figure this one out. - @vm.disable_pae_workaround -end - -def which_kernel - kernel_path = @vm.execute("/usr/local/bin/tails-get-bootinfo kernel").stdout.chomp - return File.basename(kernel_path) -end - -Given /^the PAE kernel is running$/ do - next if @skip_steps_while_restoring_background - kernel = which_kernel - assert_equal("vmlinuz2", kernel) -end - -Given /^the non-PAE kernel is running$/ do - next if @skip_steps_while_restoring_background - kernel = which_kernel - assert_equal("vmlinuz", kernel) -end - -def used_ram_in_MiB - return @vm.execute("free -m | awk '/^-\\/\\+ buffers\\/cache:/ { print $3 }'").stdout.chomp.to_i -end - -def detected_ram_in_MiB - return @vm.execute("free -m | awk '/^Mem:/ { print $2 }'").stdout.chomp.to_i -end - -Given /^at least (\d+) ([[:alpha:]]+) of RAM was detected$/ do |min_ram, unit| - @detected_ram_m = detected_ram_in_MiB - next if @skip_steps_while_restoring_background - puts "Detected #{@detected_ram_m} MiB of RAM" - min_ram_m = convert_to_MiB(min_ram.to_i, unit) - # All RAM will not be reported by `free`, so we allow a 196 MB gap - gap = convert_to_MiB(196, "MiB") - assert(@detected_ram_m + gap >= min_ram_m, "Didn't detect enough RAM") -end - -def pattern_coverage_in_guest_ram - dump = "#{$tmp_dir}/memdump" - # Workaround: when dumping the guest's memory via core_dump(), libvirt - # will create files that only root can read. We therefore pre-create - # them with more permissible permissions, which libvirt will preserve - # (although it will change ownership) so that the user running the - # script can grep the dump for the fillram pattern, and delete it. - if File.exist?(dump) - File.delete(dump) - end - FileUtils.touch(dump) - FileUtils.chmod(0666, dump) - @vm.domain.core_dump(dump) - patterns = IO.popen("grep -c 'wipe_didnt_work' #{dump}").gets.to_i - File.delete dump - # Pattern is 16 bytes long - patterns_b = patterns*16 - patterns_m = convert_to_MiB(patterns_b, 'b') - coverage = patterns_b.to_f/convert_to_bytes(@detected_ram_m.to_f, 'MiB') - puts "Pattern coverage: #{"%.3f" % (coverage*100)}% (#{patterns_m} MiB)" - return coverage -end - -Given /^I fill the guest's memory with a known pattern(| without verifying)$/ do |dont_verify| - verify = dont_verify.empty? - next if @skip_steps_while_restoring_background - - # Free some more memory by dropping the caches etc. - @vm.execute("echo 3 > /proc/sys/vm/drop_caches") - - # The (guest) kernel may freeze when approaching full memory without - # adjusting the OOM killer and memory overcommitment limitations. - [ - "echo 256 > /proc/sys/vm/min_free_kbytes", - "echo 2 > /proc/sys/vm/overcommit_memory", - "echo 97 > /proc/sys/vm/overcommit_ratio", - "echo 1 > /proc/sys/vm/oom_kill_allocating_task", - "echo 0 > /proc/sys/vm/oom_dump_tasks" - ].each { |c| @vm.execute(c) } - - # The remote shell is sometimes OOM killed when we fill the memory, - # and since we depend on it after the memory fill we try to prevent - # that from happening. - pid = @vm.pidof("autotest_remote_shell.py")[0] - @vm.execute("echo -17 > /proc/#{pid}/oom_adj") - - used_mem_before_fill = used_ram_in_MiB - - # To be sure that we fill all memory we run one fillram instance - # for each GiB of detected memory, rounded up. We also kill all instances - # after the first one has finished, i.e. when the memory is full, - # since the others otherwise may continue re-filling the same memory - # unnecessarily. - instances = (@detected_ram_m.to_f/(2**10)).ceil - instances.times { @vm.spawn('/usr/local/sbin/fillram; killall fillram') } - # We make sure that the filling has started... - try_for(10, { :msg => "fillram didn't start" }) { - @vm.has_process?("fillram") - } - STDERR.print "Memory fill progress: " - ram_usage = "" - remove_chars = 0 - # ... and that it finishes - try_for(instances*2*60, { :msg => "fillram didn't complete, probably the VM crashed" }) do - used_ram = used_ram_in_MiB - remove_chars = ram_usage.size - ram_usage = "%3d%% " % ((used_ram.to_f/@detected_ram_m)*100) - STDERR.print "\b"*remove_chars + ram_usage - ! @vm.has_process?("fillram") - end - STDERR.print "\b"*remove_chars + "finished.\n" - if verify - coverage = pattern_coverage_in_guest_ram() - # Let's aim for having the pattern cover at least 80% of the free RAM. - # More would be good, but it seems like OOM kill strikes around 90%, - # and we don't want this test to fail all the time. - min_coverage = ((@detected_ram_m - used_mem_before_fill).to_f / - @detected_ram_m.to_f)*0.75 - assert(coverage > min_coverage, - "#{"%.3f" % (coverage*100)}% of the memory is filled with the " + - "pattern, but more than #{"%.3f" % (min_coverage*100)}% was expected") - end -end - -Then /^I find very few patterns in the guest's memory$/ do - next if @skip_steps_while_restoring_background - coverage = pattern_coverage_in_guest_ram() - max_coverage = 0.005 - assert(coverage < max_coverage, - "#{"%.3f" % (coverage*100)}% of the memory is filled with the " + - "pattern, but less than #{"%.3f" % (max_coverage*100)}% was expected") -end - -Then /^I find many patterns in the guest's memory$/ do - next if @skip_steps_while_restoring_background - coverage = pattern_coverage_in_guest_ram() - min_coverage = 0.7 - assert(coverage > min_coverage, - "#{"%.3f" % (coverage*100)}% of the memory is filled with the " + - "pattern, but more than #{"%.3f" % (min_coverage*100)}% was expected") -end - -When /^I reboot without wiping the memory$/ do - next if @skip_steps_while_restoring_background - @vm.reset - @screen.wait('TailsBootSplashPostReset.png', 30) -end - -When /^I shutdown and wait for Tails to finish wiping the memory$/ do - next if @skip_steps_while_restoring_background - @vm.execute("halt") - nr_gibs_of_ram = (@detected_ram_m.to_f/(2**10)).ceil - try_for(nr_gibs_of_ram*5*60, { :msg => "memory wipe didn't finish, probably the VM crashed" }) do - # We spam keypresses to prevent console blanking from hiding the - # image we're waiting for - @screen.type(" ") - @screen.wait('MemoryWipeCompleted.png') - end -end diff --git a/features/step_definitions/i2p.rb b/features/step_definitions/i2p.rb deleted file mode 100644 index 0b8a8d3c..00000000 --- a/features/step_definitions/i2p.rb +++ /dev/null @@ -1,60 +0,0 @@ -Given /^I2P is running$/ do - next if @skip_steps_while_restoring_background - try_for(30) do - @vm.execute('service i2p status').success? - end -end - -Given /^the I2P router console is ready$/ do - next if @skip_steps_while_restoring_background - try_for(60) do - @vm.execute('. /usr/local/lib/tails-shell-library/i2p.sh; ' + - 'i2p_router_console_is_ready').success? - end -end - -When /^I start the I2P Browser through the GNOME menu$/ do - next if @skip_steps_while_restoring_background - @screen.wait_and_click("GnomeApplicationsMenu.png", 10) - @screen.wait_and_click("GnomeApplicationsInternet.png", 10) - @screen.wait_and_click("GnomeApplicationsI2PBrowser.png", 20) -end - -Then /^the I2P Browser desktop file is (|not )present$/ do |mode| - next if @skip_steps_while_restoring_background - file = '/usr/share/applications/i2p-browser.desktop' - if mode == '' - assert(@vm.execute("test -e #{file}").success?) - elsif mode == 'not ' - assert(@vm.execute("! test -e #{file}").success?) - else - raise "Unsupported mode passed: '#{mode}'" - end -end - -Then /^the I2P Browser sudo rules are (enabled|not present)$/ do |mode| - next if @skip_steps_while_restoring_background - file = '/etc/sudoers.d/zzz_i2pbrowser' - if mode == 'enabled' - assert(@vm.execute("test -e #{file}").success?) - elsif mode == 'not present' - assert(@vm.execute("! test -e #{file}").success?) - else - raise "Unsupported mode passed: '#{mode}'" - end -end - -Then /^the I2P firewall rules are (enabled|disabled)$/ do |mode| - next if @skip_steps_while_restoring_background - i2p_username = 'i2psvc' - i2p_uid = @vm.execute("getent passwd #{i2p_username} | awk -F ':' '{print $3}'").stdout.chomp - accept_rules = @vm.execute("iptables -L -n -v | grep -E '^\s+[0-9]+\s+[0-9]+\s+ACCEPT.*owner UID match #{i2p_uid}$'").stdout - accept_rules_count = accept_rules.lines.count - if mode == 'enabled' - assert_equal(13, accept_rules_count) - elsif mode == 'disabled' - assert_equal(0, accept_rules_count) - else - raise "Unsupported mode passed: '#{mode}'" - end -end diff --git a/features/step_definitions/truecrypt.rb b/features/step_definitions/truecrypt.rb deleted file mode 100644 index bc8591bc..00000000 --- a/features/step_definitions/truecrypt.rb +++ /dev/null @@ -1,12 +0,0 @@ -When /^I start TrueCrypt through the GNOME menu$/ do - next if @skip_steps_while_restoring_background - @screen.wait_and_click("GnomeApplicationsMenu.png", 10) - @screen.wait_and_click("GnomeApplicationsAccessories.png", 10) - @screen.wait_and_click("GnomeApplicationsTrueCrypt.png", 20) -end - -When /^I deal with the removal warning prompt$/ do - next if @skip_steps_while_restoring_background - @screen.wait("TrueCryptRemovalWarning.png", 60) - @screen.type(Sikuli::Key.ENTER) -end diff --git a/features/step_definitions/windows_camouflage.rb b/features/step_definitions/windows_camouflage.rb deleted file mode 100644 index 82ccd8c8..00000000 --- a/features/step_definitions/windows_camouflage.rb +++ /dev/null @@ -1,10 +0,0 @@ -Given /^I enable Microsoft Windows camouflage$/ do - @theme = "windows" - next if @skip_steps_while_restoring_background - @screen.wait_and_click("TailsGreeterWindowsCamouflage.png", 10) -end - -When /^I click the start menu$/ do - next if @skip_steps_while_restoring_background - @screen.wait_and_click("WindowsStartButton.png", 10) -end diff --git a/features/truecrypt.feature b/features/truecrypt.feature deleted file mode 100644 index db4cb5b0..00000000 --- a/features/truecrypt.feature +++ /dev/null @@ -1,12 +0,0 @@ -@product -Feature: TrueCrypt - As a Tails user - I *might* want to use TrueCrypt - - Scenario: TrueCrypt starts - Given a computer - And I set Tails to boot with options "truecrypt" - And I start Tails from DVD with network unplugged and I login - When I start TrueCrypt through the GNOME menu - And I deal with the removal warning prompt - Then I see "TrueCryptWindow.png" after at most 60 seconds diff --git a/features/windows_camouflage.feature b/features/windows_camouflage.feature deleted file mode 100644 index 1c2fa526..00000000 --- a/features/windows_camouflage.feature +++ /dev/null @@ -1,36 +0,0 @@ -@product -Feature: Microsoft Windows Camouflage - As a Tails user - when I select the Microsoft Windows Camouflage in Tails Greeter - I should be presented with a Microsoft Windows like environment - - Background: - Given a computer - And the network is unplugged - And I start the computer - And the computer boots Tails - And I enable more Tails Greeter options - And I enable Microsoft Windows camouflage - And I log in to a new session - And GNOME has started - And all notifications have disappeared - And I save the state so the background can be restored next scenario - - Scenario: I should be presented with a Microsoft Windows like desktop - Then I see "WindowsDesktop.png" after at most 10 seconds - And I see "WindowsStartButton.png" after at most 10 seconds - And I see "WindowsSysTray.png" after at most 10 seconds - - Scenario: Windows should appear like those in Microsoft Windows - When the network is plugged - And Tor is ready - And all notifications have disappeared - And available upgrades have been checked - And I start the Tor Browser - Then I see "WindowsTorBrowserWindow.png" after at most 120 seconds - And I see "WindowsTorBrowserTaskBar.png" after at most 10 seconds - And I see "WindowsWindowButtons.png" after at most 10 seconds - - Scenario: The panel menu should look like Microsoft Windows's start menu - When I click the start menu - Then I see "WindowsStartMenu.png" after at most 10 seconds |