summaryrefslogtreecommitdiffstats
path: root/features
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2016-12-10 19:04:52 +0100
committeranonym <anonym@riseup.net>2016-12-10 19:04:52 +0100
commit95c6e874b476bbad49813d6352425625d7de13d6 (patch)
treeff410403be14281736a8a590e142a0feebde3de7 /features
parentdc854303bff703a82b2b55b10014890cca97b2f3 (diff)
Switch MAT scenario from testing PDFs to PNGs.
Because MAT doesn't clean PDFs anymore. :_( Will-fix: #11901
Diffstat (limited to 'features')
-rw-r--r--features/mat.feature6
-rw-r--r--features/misc_files/sample.pdfbin22347 -> 0 bytes
-rw-r--r--features/misc_files/sample.pngbin0 -> 150 bytes
-rw-r--r--features/misc_files/sample.tex8
-rw-r--r--features/step_definitions/checks.rb44
5 files changed, 26 insertions, 32 deletions
diff --git a/features/mat.feature b/features/mat.feature
index e492b0f..95ace5b 100644
--- a/features/mat.feature
+++ b/features/mat.feature
@@ -6,8 +6,8 @@ Feature: Metadata Anonymization Toolkit
# In this feature we cannot restore from snapshots since it's
# incompatible with filesystem shares.
- Scenario: MAT can clean a PDF file
+ Scenario: MAT can clean a PNG file
Given a computer
- And I setup a filesystem share containing a sample PDF
+ And I setup a filesystem share containing a sample PNG
And I start Tails from DVD with network unplugged and I login
- Then MAT can clean some sample PDF file
+ Then MAT can clean some sample PNG file
diff --git a/features/misc_files/sample.pdf b/features/misc_files/sample.pdf
deleted file mode 100644
index d0cc950..0000000
--- a/features/misc_files/sample.pdf
+++ /dev/null
Binary files differ
diff --git a/features/misc_files/sample.png b/features/misc_files/sample.png
new file mode 100644
index 0000000..facf4269
--- /dev/null
+++ b/features/misc_files/sample.png
Binary files differ
diff --git a/features/misc_files/sample.tex b/features/misc_files/sample.tex
deleted file mode 100644
index 043faae..0000000
--- a/features/misc_files/sample.tex
+++ /dev/null
@@ -1,8 +0,0 @@
-\documentclass[12pt]{article}
-\title{Sample PDF document}
-\author{Tails developers}
-\date{March 12, 2013}
-\begin{document}
-\maketitle
-Does this PDF still have metadata?
-\end{document}
diff --git a/features/step_definitions/checks.rb b/features/step_definitions/checks.rb
index 507a61b..61157f0 100644
--- a/features/step_definitions/checks.rb
+++ b/features/step_definitions/checks.rb
@@ -128,15 +128,15 @@ Then /^the VirtualBox guest modules are available$/ do
"The vboxguest module is not available.")
end
-Given /^I setup a filesystem share containing a sample PDF$/ do
- shared_pdf_dir_on_host = "#{$config["TMPDIR"]}/shared_pdf_dir"
- @shared_pdf_dir_on_guest = "/tmp/shared_pdf_dir"
- FileUtils.mkdir_p(shared_pdf_dir_on_host)
- Dir.glob("#{MISC_FILES_DIR}/*.pdf") do |pdf_file|
- FileUtils.cp(pdf_file, shared_pdf_dir_on_host)
+Given /^I setup a filesystem share containing a sample PNG$/ do
+ shared_png_dir_on_host = "#{$config["TMPDIR"]}/shared_png_dir"
+ @shared_png_dir_on_guest = "/tmp/shared_png_dir"
+ FileUtils.mkdir_p(shared_png_dir_on_host)
+ Dir.glob("#{MISC_FILES_DIR}/*.png") do |png_file|
+ FileUtils.cp(png_file, shared_png_dir_on_host)
end
- add_after_scenario_hook { FileUtils.rm_r(shared_pdf_dir_on_host) }
- $vm.add_share(shared_pdf_dir_on_host, @shared_pdf_dir_on_guest)
+ add_after_scenario_hook { FileUtils.rm_r(shared_png_dir_on_host) }
+ $vm.add_share(shared_png_dir_on_host, @shared_png_dir_on_guest)
end
Then /^the support documentation page opens in Tor Browser$/ do
@@ -156,24 +156,26 @@ Then /^the support documentation page opens in Tor Browser$/ do
)
end
-Then /^MAT can clean some sample PDF file$/ do
- for pdf_on_host in Dir.glob("#{MISC_FILES_DIR}/*.pdf") do
- pdf_name = File.basename(pdf_on_host)
- pdf_on_guest = "/home/#{LIVE_USER}/#{pdf_name}"
- step "I copy \"#{@shared_pdf_dir_on_guest}/#{pdf_name}\" to \"#{pdf_on_guest}\" as user \"#{LIVE_USER}\""
- check_before = $vm.execute_successfully("mat --check '#{pdf_on_guest}'",
+Then /^MAT can clean some sample PNG file$/ do
+ for png_on_host in Dir.glob("#{MISC_FILES_DIR}/*.png") do
+ png_name = File.basename(png_on_host)
+ png_on_guest = "/home/#{LIVE_USER}/#{png_name}"
+ step "I copy \"#{@shared_png_dir_on_guest}/#{png_name}\" to \"#{png_on_guest}\" as user \"#{LIVE_USER}\""
+ check_before = $vm.execute_successfully("mat --check '#{png_on_guest}'",
:user => LIVE_USER).stdout
- assert(check_before.include?("#{pdf_on_guest} is not clean"),
- "MAT failed to see that '#{pdf_on_host}' is dirty")
- $vm.execute_successfully("mat '#{pdf_on_guest}'", :user => LIVE_USER)
- check_after = $vm.execute_successfully("mat --check '#{pdf_on_guest}'",
+ assert(check_before.include?("#{png_on_guest} is not clean"),
+ "MAT failed to see that '#{png_on_host}' is dirty")
+ $vm.execute_successfully("mat '#{png_on_guest}'", :user => LIVE_USER)
+ check_after = $vm.execute_successfully("mat --check '#{png_on_guest}'",
:user => LIVE_USER).stdout
- assert(check_after.include?("#{pdf_on_guest} is clean"),
- "MAT failed to clean '#{pdf_on_host}'")
- $vm.execute_successfully("rm '#{pdf_on_guest}'")
+ assert(check_after.include?("#{png_on_guest} is clean"),
+ "MAT failed to clean '#{png_on_host}'")
+ $vm.execute_successfully("rm '#{png_on_guest}'")
end
end
+
+
Then /^AppArmor is enabled$/ do
assert($vm.execute("aa-status").success?, "AppArmor is not enabled")
end