From 42e2cc0da902335ee40b9a0adf540a0fc4f8936a Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 7 Apr 2010 08:36:42 +0200 Subject: [PATCH] testsuite: Check presence and properties of loop devices --- tests/run | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/run b/tests/run index 48044b0..9803ba4 100755 --- a/tests/run +++ b/tests/run @@ -31,7 +31,6 @@ # and check added/removed devices and emitted signals # - Add LUKS stresstest (was racy in the past) # - Test LinuxMd* D-BUS interface -# - Test loop devices (without MD on top), udisks supports them now import subprocess import os @@ -1323,6 +1322,27 @@ class LVM(UDisksTestCase): # ---------------------------------------------------------------------------- +class Loop(UDisksTestCase): + '''Test loop device detection.''' + + def test_properties(self): + '''Loop: presence and properties''' + + # our MD test partition is not a loop device + p = self.partition_props() + self.assertEqual(p.Get(I_D, 'DeviceIsLinuxLoop'), False) + self.assertEqual(p.Get(I_D, 'LinuxLoopFilename'), '') + + for i in range(NUM_VDEV): + vdev_p = dbus.Interface(dbus.SystemBus().get_object( + 'org.freedesktop.UDisks', + self.manager_iface.FindDeviceByDeviceFile(self.test_vdev[i])), + dbus.PROPERTIES_IFACE) + self.assertEqual(vdev_p.Get(I_D, 'DeviceIsLinuxLoop'), True) + self.assert_(vdev_p.Get(I_D, 'LinuxLoopFilename').startswith('/tmp')) + +# ---------------------------------------------------------------------------- + class GlobalOps(UDisksTestCase): '''Check various global operations.''' -- 2.7.4