diff options
Diffstat (limited to 'test-cli/test/tests')
-rw-r--r-- | test-cli/test/tests/qusbdual.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test-cli/test/tests/qusbdual.py b/test-cli/test/tests/qusbdual.py index 054d7f4..fcbb9aa 100644 --- a/test-cli/test/tests/qusbdual.py +++ b/test-cli/test/tests/qusbdual.py @@ -1,6 +1,7 @@ import sh import unittest import os.path +import time class Qusbdual(unittest.TestCase): @@ -25,10 +26,12 @@ class Qusbdual(unittest.TestCase): p = sh.modprobe("g_mass_storage", "file=/var/lib/hwtest-files/mass-otg-test.img") if p.exit_code != 0: self.fail("failed: Unable to create a mass storage gadget.") + # wait to detect the new device + time.sleep(3) # find the mass storage device try: p = sh.grep(sh.lsblk("-So", "NAME,VENDOR"), "Linux") - except sh.ErrorReturnCode as e: + except sh.ErrorReturnCode: self.fail("failed: could not find any mass storage gadget") device = p.stdout.decode().split(" ")[0] # mount the mass storage gadget @@ -40,8 +43,9 @@ class Qusbdual(unittest.TestCase): for i in range(int(self.__repetitions)): # copy files try: - p = sh.cp("/mnt/station_ramdisk/hdd_gadget/usb-test.bin", "/mnt/station_ramdisk/hdd_gadget/usb-test.bin.md5", - "/tmp/stationnfs") + p = sh.cp("/mnt/station_ramdisk/hdd_gadget/usb-test.bin", + "/mnt/station_ramdisk/hdd_gadget/usb-test.bin.md5", + "/mnt/station_nfsdisk/") except sh.ErrorReturnCode as e: sh.umount("/mnt/station_ramdisk/hdd_gadget") sh.rmdir("/mnt/station_ramdisk/hdd_gadget") |