summaryrefslogtreecommitdiffstats
path: root/features
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2018-09-14 13:27:18 +0000
committerintrigeri <intrigeri@boum.org>2018-09-14 13:55:42 +0000
commit0a86adfc841b11edcdc3fdb40acb3a7e31b6d019 (patch)
tree6e260e0008fa3f7c12edf5275f9c262418552781 /features
parent2178fd8cf77942d9d851905e9e872450ed56fd37 (diff)
VeraCrypt test suite: give up on unmounting/locking via GNOME Files.
It is way too fragile. Nautilus will sometimes fire up a "Unable to eject 105 MB Volume" "Cannot eject drive in use: Encrypted device /dev/sda is unlocked" error dialog while according to the Journal, everything is correctly unmounted and locked by udisksd. There is probably a bug in Nautilus, GVfs, udisks, or the way they talk to each other. I've occasionally seen it for years with LUKS devices too, so this is not specific to VeraCrypt and outside of the scope of this project. So let's use udisksctl to unmount and lock VeraCrypt volumes instead. And as a consequence, no notification is displayed so instead of looking for one, let's verify that the volume was correctly unmounted (which we did already) and locked (which we did not do, we were believing the desktop notification).
Diffstat (limited to 'features')
-rw-r--r--features/images/NautilusFocusedEjectButton.pngbin1093 -> 0 bytes
-rw-r--r--features/step_definitions/veracrypt.rb34
-rw-r--r--features/veracrypt.feature16
3 files changed, 21 insertions, 29 deletions
diff --git a/features/images/NautilusFocusedEjectButton.png b/features/images/NautilusFocusedEjectButton.png
deleted file mode 100644
index 9895624..0000000
--- a/features/images/NautilusFocusedEjectButton.png
+++ /dev/null
Binary files differ
diff --git a/features/step_definitions/veracrypt.rb b/features/step_definitions/veracrypt.rb
index f56ee19..2b979d8 100644
--- a/features/step_definitions/veracrypt.rb
+++ b/features/step_definitions/veracrypt.rb
@@ -219,27 +219,19 @@ When /^I open this VeraCrypt volume in GNOME Files$/ do
)
end
-When /^I lock the currently opened VeraCrypt (?:volume|file container)$/ do
- # notifications sometimes interfere with mouse focus
- step "all notifications have disappeared"
- # Sometimes the eject button is not updated fast enough and is still
- # about the drive that contains the VeraCrypt volume, which cannot
- # be ejected as it's still in use.
- sleep 5
- @screen.click('NautilusFocusedEjectButton.png')
- try_for(10) do
- ! $vm.execute('ls /media/amnesia/*/SecretFile').success?
- end
+When /^I lock the currently opened VeraCrypt (volume|file container)$/ do |support|
+ $vm.execute_successfully(
+ 'udisksctl unmount --block-device /dev/mapper/tcrypt-*',
+ :user => LIVE_USER
+ )
+ device = support == 'volume' ? '/dev/sda' : '/dev/loop1'
+ $vm.execute_successfully(
+ "udisksctl lock --block-device #{device}",
+ :user => LIVE_USER
+ )
end
-Then /^I am told the VeraCrypt (volume|file container) has been unmounted$/ do |support|
- case support
- when 'volume'
- notification_text = "You can now unplug QEMU QEMU HARDDISK"
- when 'file container'
- volume_name = "#{veracrypt_volume_size_in_GNOME(@veracrypt_is_hidden)} Volume"
- notification_text = "#{volume_name} has been unmounted"
- end
- step "I see the \"#{notification_text}\"" \
- + " notification after at most 30 seconds"
+Then /^the VeraCrypt (volume|file container) has been unmounted and locked$/ do |support|
+ assert(! $vm.execute('ls /media/amnesia/*/SecretFile').success?)
+ assert(! $vm.execute('ls /dev/mapper/tcrypt-*').success?)
end
diff --git a/features/veracrypt.feature b/features/veracrypt.feature
index b3e8352..23b7c14 100644
--- a/features/veracrypt.feature
+++ b/features/veracrypt.feature
@@ -15,7 +15,7 @@ Feature: Using VeraCrypt encrypted volumes
And I open this VeraCrypt volume in GNOME Files
Then I see "SecretFileOnVeraCryptVolume.png" after at most 10 seconds
When I lock the currently opened VeraCrypt volume
- Then I am told the VeraCrypt volume has been unmounted
+ Then the VeraCrypt volume has been unmounted and locked
Scenario: Use Unlock VeraCrypt Volumes to unlock a USB drive that has a hidden VeraCrypt volume
When I plug a USB drive containing a hidden VeraCrypt volume
@@ -23,7 +23,7 @@ Feature: Using VeraCrypt encrypted volumes
And I open this VeraCrypt volume in GNOME Files
Then I see "SecretFileOnVeraCryptVolume.png" after at most 10 seconds
When I lock the currently opened VeraCrypt volume
- Then I am told the VeraCrypt volume has been unmounted
+ Then the VeraCrypt volume has been unmounted and locked
Scenario: Use Unlock VeraCrypt Volumes to unlock a basic VeraCrypt file container
When I plug and mount a USB drive containing a basic VeraCrypt file container
@@ -31,7 +31,7 @@ Feature: Using VeraCrypt encrypted volumes
And I open this VeraCrypt volume in GNOME Files
Then I see "SecretFileOnVeraCryptVolume.png" after at most 10 seconds
When I lock the currently opened VeraCrypt file container
- Then I am told the VeraCrypt file container has been unmounted
+ Then the VeraCrypt file container has been unmounted and locked
Scenario: Use Unlock VeraCrypt Volumes to unlock a hidden VeraCrypt file container
When I plug and mount a USB drive containing a hidden VeraCrypt file container
@@ -39,7 +39,7 @@ Feature: Using VeraCrypt encrypted volumes
And I open this VeraCrypt volume in GNOME Files
Then I see "SecretFileOnVeraCryptVolume.png" after at most 10 seconds
When I lock the currently opened VeraCrypt file container
- Then I am told the VeraCrypt file container has been unmounted
+ Then the VeraCrypt file container has been unmounted and locked
### GNOME Disks
@@ -49,7 +49,7 @@ Feature: Using VeraCrypt encrypted volumes
And I open this VeraCrypt volume in GNOME Files
Then I see "SecretFileOnVeraCryptVolume.png" after at most 10 seconds
When I lock the currently opened VeraCrypt volume
- Then I am told the VeraCrypt volume has been unmounted
+ Then the VeraCrypt volume has been unmounted and locked
Scenario: Use GNOME Disks to unlock a USB drive that has a hidden VeraCrypt volume
When I plug a USB drive containing a hidden VeraCrypt volume
@@ -57,7 +57,7 @@ Feature: Using VeraCrypt encrypted volumes
And I open this VeraCrypt volume in GNOME Files
Then I see "SecretFileOnVeraCryptVolume.png" after at most 10 seconds
When I lock the currently opened VeraCrypt volume
- Then I am told the VeraCrypt volume has been unmounted
+ Then the VeraCrypt volume has been unmounted and locked
Scenario: Use GNOME Disks to unlock a basic VeraCrypt file container with a keyfile
When I plug and mount a USB drive containing a basic VeraCrypt file container with a keyfile
@@ -65,7 +65,7 @@ Feature: Using VeraCrypt encrypted volumes
And I open this VeraCrypt volume in GNOME Files
Then I see "SecretFileOnVeraCryptVolume.png" after at most 10 seconds
When I lock the currently opened VeraCrypt file container
- Then I am told the VeraCrypt file container has been unmounted
+ Then the VeraCrypt file container has been unmounted and locked
Scenario: Use GNOME Disks to unlock a hidden VeraCrypt file container
When I plug and mount a USB drive containing a hidden VeraCrypt file container
@@ -73,4 +73,4 @@ Feature: Using VeraCrypt encrypted volumes
And I open this VeraCrypt volume in GNOME Files
Then I see "SecretFileOnVeraCryptVolume.png" after at most 10 seconds
When I lock the currently opened VeraCrypt file container
- Then I am told the VeraCrypt file container has been unmounted
+ Then the VeraCrypt file container has been unmounted and locked