예제 #1
0
 def test_no_space_left(self):
     utils.filesystem.mount(self.VFAT_DEVICE, self.VFAT_MOUNTPOINT)
     utils.filesystem.create_file(
         os.path.join(self.VFAT_MOUNTPOINT, "tfile"), 5)
     test_manager = DriveMonitor(self.VFAT_MOUNTPOINT, self.VFAT_DEVICE)
     time.sleep(self.LONG_SLEEP)
     self.assertTrue(test_manager.is_NotEnoughMemory(),
                     msg="Current state: {}".format(test_manager.state))
     test_manager.stop()
예제 #2
0
 def test_format_then_full(self):
     utils.filesystem.mount(self.VFAT_DEVICE, self.VFAT_MOUNTPOINT)
     test_manager = DriveMonitor(self.VFAT_MOUNTPOINT, self.VFAT_DEVICE)
     time.sleep(self.LONG_SLEEP)
     self.assertTrue(test_manager.is_Ok(),
                     msg="Current state: {}".format(test_manager.state))
     test_manager.format_drive()
     time.sleep(self.SHORT_SLEEP)
     self.assertTrue(test_manager.is_Ok(),
                     msg="Current state: {}".format(test_manager.state))
     try:
         utils.filesystem.create_file(
             os.path.join(self.VFAT_MOUNTPOINT, "tfile"), 19.9)
     except:
         pass
     time.sleep(self.LONG_SLEEP)
     self.assertTrue(test_manager.is_NotEnoughMemory(),
                     msg="Current state: {}".format(test_manager.state))
     test_manager.stop()