From 0e8e3ecd4b9be71c41008b95950d089819622dff Mon Sep 17 00:00:00 2001 From: Hector Fernandez Date: Mon, 6 Jul 2020 14:08:27 +0200 Subject: Corrected some errors in USB and USBDUAL tests. --- test-cli/test/tests/qusbdual.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test-cli/test/tests/qusbdual.py') diff --git a/test-cli/test/tests/qusbdual.py b/test-cli/test/tests/qusbdual.py index bb295b8..ad95b84 100644 --- a/test-cli/test/tests/qusbdual.py +++ b/test-cli/test/tests/qusbdual.py @@ -37,7 +37,7 @@ class Qusbdual(unittest.TestCase): if p.exit_code != 0: self.fail("failed: Unable to mount the mass storage gadget.") # execute test - for i in range(self.__repetitions): + for i in range(int(self.__repetitions)): # copy files try: p = sh.cp("/tmp/station/hdd_gadget/usb-test.bin", "/tmp/station/hdd_gadget/usb-test.bin.md5", @@ -46,6 +46,11 @@ class Qusbdual(unittest.TestCase): sh.umount("/tmp/station/hdd_gadget") sh.rmdir("/tmp/station/hdd_gadget") self.fail("failed: Unable to copy files through USB.") + # check if the device is still mounted + if not os.path.ismount("/tmp/station/hdd_gadget"): + sh.rm("/tmp/station/hdd_gadget/*") + sh.rmdir("/tmp/station/hdd_gadget") + self.fail("failed: USB device unmounted during/after copying files.") # Check md5 try: p = sh.md5sum("/tmp/stationnfs/usb-test.bin") -- cgit v1.1