Пример #1
0
 def test_read_only_fs(self):
     test_manager = DriveMonitor(self.VFAT_RO_MOUNTPOINT,
                                 self.VFAT_RO_DEVICE)
     time.sleep(self.SHORT_SLEEP)
     utils.filesystem.mount(self.VFAT_RO_DEVICE, self.VFAT_RO_MOUNTPOINT)
     time.sleep(self.SHORT_SLEEP)
     self.assertTrue(test_manager.is_DeviceReadOnly(),
                     msg="Current state: {}".format(test_manager.state))
     test_manager.stop()
Пример #2
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()