summaryrefslogtreecommitdiff
path: root/test-cli/test/tests/qusbdual.py
diff options
context:
space:
mode:
authorHector Fernandez <hector@iatec.biz>2020-07-06 14:08:27 +0200
committerHector Fernandez <hector@iatec.biz>2020-07-06 14:08:27 +0200
commit0e8e3ecd4b9be71c41008b95950d089819622dff (patch)
tree6c73dd034d81eaf1b5381e6c665277903d369408 /test-cli/test/tests/qusbdual.py
parent5dcd213c28451ac210703dc5bf9bf538671a0682 (diff)
downloadboard-0e8e3ecd4b9be71c41008b95950d089819622dff.zip
board-0e8e3ecd4b9be71c41008b95950d089819622dff.tar.gz
board-0e8e3ecd4b9be71c41008b95950d089819622dff.tar.bz2
Corrected some errors in USB and USBDUAL tests.
Diffstat (limited to 'test-cli/test/tests/qusbdual.py')
-rw-r--r--test-cli/test/tests/qusbdual.py7
1 files changed, 6 insertions, 1 deletions
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")