diff --git a/src/cryptobox/tests/test.cryptobox.py b/src/cryptobox/tests/test.cryptobox.py index cfafdc5..0182bbd 100755 --- a/src/cryptobox/tests/test.cryptobox.py +++ b/src/cryptobox/tests/test.cryptobox.py @@ -31,6 +31,8 @@ import cryptobox.core.settings from cryptobox.tests.base import CommonTestClass import os +# which other devices are safe (cannot cause harm)? +COMMON_ALLOWED_DEVICES = [ '/dev/ubdb' ] class CryptoBoxDeviceTests(CommonTestClass): """Some unittests for the CryptoBox @@ -41,8 +43,13 @@ class CryptoBoxDeviceTests(CommonTestClass): def test_allowed_devices(self): '''is_device_allowed should accept permitted devices''' - self.assertTrue(self.cb.is_device_allowed("/dev/ram1")) - self.assertTrue(self.cb.is_device_allowed("/dev/pts/../ram1")) + # check if one of the common devices exists and is allowed + blockdevice_found = False + for dev_node in COMMON_ALLOWED_DEVICES: + if os.path.exists(dev_node): + self.assertTrue(self.cb.is_device_allowed(dev_node)) + blockdevice_found = True + self.assertTrue(blockdevice_found) def test_denied_devices(self):