evince.feature 4.63 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@product
Feature: Using Evince
  As a Tails user
  I want to view and print PDF files in Evince
  And AppArmor should prevent Evince from doing dangerous things

  Background:
    Given a computer
    And I start Tails from DVD with network unplugged and I login
    And I save the state so the background can be restored next scenario

  Scenario: I can view and print a PDF file stored in /usr/share
    When I open "/usr/share/cups/data/default-testpage.pdf" with Evince
    Then I see "CupsTestPage.png" after at most 10 seconds
    And I can print the current document to "/home/amnesia/output.pdf"

  Scenario: I can view and print a PDF file stored in non-persistent /home/amnesia
    Given I copy "/usr/share/cups/data/default-testpage.pdf" to "/home/amnesia" as user "amnesia"
    When I open "/home/amnesia/default-testpage.pdf" with Evince
    Then I see "CupsTestPage.png" after at most 10 seconds
    And I can print the current document to "/home/amnesia/output.pdf"

  Scenario: I cannot view a PDF file stored in non-persistent /home/amnesia/.gnupg
    Given I copy "/usr/share/cups/data/default-testpage.pdf" to "/home/amnesia/.gnupg" as user "amnesia"
25
26
27
    Then the file "/home/amnesia/.gnupg/default-testpage.pdf" exists
    And the file "/lib/live/mount/overlay/home/amnesia/.gnupg/default-testpage.pdf" exists
    And the file "/live/overlay/home/amnesia/.gnupg/default-testpage.pdf" exists
28
    Given AppArmor has not denied "/usr/bin/evince" from opening "/home/amnesia/.gnupg/default-testpage.pdf"
29
30
    When I try to open "/home/amnesia/.gnupg/default-testpage.pdf" with Evince
    Then I see "EvinceUnableToOpen.png" after at most 10 seconds
31
    And AppArmor has denied "/usr/bin/evince" from opening "/home/amnesia/.gnupg/default-testpage.pdf"
32
    When I close Evince
anonym's avatar
anonym committed
33
34
    Given AppArmor has not denied "/usr/bin/evince" from opening "/lib/live/mount/overlay/home/amnesia/.gnupg/default-testpage.pdf"
    When I try to open "/lib/live/mount/overlay/home/amnesia/.gnupg/default-testpage.pdf" with Evince
35
    Then I see "EvinceUnableToOpen.png" after at most 10 seconds
36
    And AppArmor has denied "/usr/bin/evince" from opening "/lib/live/mount/overlay/home/amnesia/.gnupg/default-testpage.pdf"
37
    When I close Evince
38
    # Due to our AppArmor aliases, /live/overlay will be treated
39
40
41
42
    # as /lib/live/mount/overlay. We have to clear syslog we'll look for
    # the same entry as above again.
    Given I clear syslog
    And AppArmor has not denied "/usr/bin/evince" from opening "/lib/live/mount/overlay/home/amnesia/.gnupg/default-testpage.pdf"
anonym's avatar
anonym committed
43
    When I try to open "/live/overlay/home/amnesia/.gnupg/default-testpage.pdf" with Evince
44
    Then I see "EvinceUnableToOpen.png" after at most 10 seconds
45
    And AppArmor has denied "/usr/bin/evince" from opening "/lib/live/mount/overlay/home/amnesia/.gnupg/default-testpage.pdf"
46
47
48

  @keep_volumes
  Scenario: Installing Tails on a USB drive, creating a persistent partition, copying PDF files to it
49
50
    Given the USB drive "current" contains Tails with persistence configured and password "asdf"
    And a computer
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
    And I start Tails from USB drive "current" with network unplugged and I login with persistence password "asdf"
    And I copy "/usr/share/cups/data/default-testpage.pdf" to "/home/amnesia/Persistent" as user "amnesia"
    Then the file "/home/amnesia/Persistent/default-testpage.pdf" exists
    And I copy "/usr/share/cups/data/default-testpage.pdf" to "/home/amnesia/.gnupg" as user "amnesia"
    Then the file "/home/amnesia/.gnupg/default-testpage.pdf" exists
    And I shutdown Tails and wait for the computer to power off

  @keep_volumes
  Scenario: I can view and print a PDF file stored in persistent /home/amnesia/Persistent
    Given a computer
    And I start Tails from USB drive "current" with network unplugged and I login with persistence password "asdf"
    When I open "/home/amnesia/Persistent/default-testpage.pdf" with Evince
    Then I see "CupsTestPage.png" after at most 10 seconds
    And I can print the current document to "/home/amnesia/Persistent/output.pdf"

  @keep_volumes
  Scenario: I cannot view a PDF file stored in persistent /home/amnesia/.gnupg
    Given a computer
    When I start Tails from USB drive "current" with network unplugged and I login with persistence password "asdf"
70
    Then the file "/home/amnesia/Persistent/default-testpage.pdf" exists
anonym's avatar
anonym committed
71
    Given AppArmor has not denied "/usr/bin/evince" from opening "/home/amnesia/.gnupg/default-testpage.pdf"
72
73
    And I try to open "/home/amnesia/.gnupg/default-testpage.pdf" with Evince
    Then I see "EvinceUnableToOpen.png" after at most 10 seconds
anonym's avatar
anonym committed
74
    And AppArmor has denied "/usr/bin/evince" from opening "/home/amnesia/.gnupg/default-testpage.pdf"