Ejemplo n.º 1
0
 def test_format_invalid_unmounted(self):
     test_manager = DriveMonitor(self.NTFS_MOUNTPOINT, self.NTFS_DEVICE)
     time.sleep(self.SHORT_SLEEP)
     self.assertTrue(test_manager.is_InvalidDevice(),
                     msg="Current state: {}".format(test_manager.state))
     self.format_invalid(test_manager)
     test_manager.stop()
Ejemplo n.º 2
0
 def test_remove_device(self):
     utils.filesystem.mount(self.VFAT_DEVICE, self.VFAT_MOUNTPOINT)
     test_manager = DriveMonitor(self.VFAT_MOUNTPOINT, self.VFAT_DEVICE)
     time.sleep(self.SHORT_SLEEP)
     self.assertTrue(test_manager.is_DeviceOk(),
                     msg="Current state: {}".format(test_manager.state))
     utils.filesystem.unmount(self.VFAT_MOUNTPOINT)
     time.sleep(self.LONG_SLEEP)
     self.assertTrue(test_manager.is_InvalidDevice(),
                     msg="Current state: {}".format(test_manager.state))
     test_manager.stop()
Ejemplo n.º 3
0
 def test_format_exfat(self):
     test_manager = DriveMonitor(self.NTFS_MOUNTPOINT, self.NTFS_DEVICE)
     time.sleep(self.SHORT_SLEEP)
     self.assertTrue(test_manager.is_InvalidDevice(),
                     msg="Current state: {}".format(test_manager.state))
     test_manager.format_drive("exfat")
     time.sleep(self.SHORT_SLEEP)
     if 'fuseblk' in test_manager.SUPPORTED_FILESYSTEMS:
         self.assertTrue(test_manager.is_DeviceOk(),
                         msg="Current state: {}".format(test_manager.state))
     else:
         self.assertTrue(test_manager.is_DeviceNotCompatible(),
                         msg="Current state: {}".format(test_manager.state))
     test_manager.stop()
Ejemplo n.º 4
0
 def test_format_read_only_fs(self):
     os.chmod(self.VFAT_RO_DEVICE, 0o444)
     test_manager = DriveMonitor(self.VFAT_RO_MOUNTPOINT,
                                 self.VFAT_RO_DEVICE)
     time.sleep(self.SHORT_SLEEP)
     self.assertTrue(test_manager.is_InvalidDevice(),
                     msg="Current state: {}".format(test_manager.state))
     time.sleep(self.SHORT_SLEEP)
     test_manager.format_drive()
     time.sleep(self.LONG_SLEEP)
     self.assertTrue(test_manager.is_DeviceReadOnly(),
                     msg="Current state: {}".format(test_manager.state))
     utils.filesystem.unmount(self.VFAT_RO_MOUNTPOINT)
     os.remove(self.VFAT_RO_DEVICE)
     time.sleep(self.SHORT_SLEEP)
     self.assertTrue(test_manager.is_NoDeviceDetected(),
                     msg="Current state: {}".format(test_manager.state))
     test_manager.stop()
Ejemplo n.º 5
0
 def test_invalid_device(self):
     test_manager = DriveMonitor("/tmp/tmountpoint", self.NTFS_DEVICE)
     time.sleep(self.SHORT_SLEEP)
     self.assertTrue(test_manager.is_InvalidDevice(),
                     msg="Current state: {}".format(test_manager.state))
     test_manager.stop()