summaryrefslogtreecommitdiff
path: root/test-cli/test/tests/qusbdual.py
diff options
context:
space:
mode:
authorHector Fernandez <hector@iatec.biz>2020-07-07 09:57:58 +0200
committerHector Fernandez <hector@iatec.biz>2020-07-07 09:57:58 +0200
commit43f688b414ea182cd9baf06ee83df072c3f563f5 (patch)
tree7195e69d9f6cf28f0627e7db0cbfacaf9c9e2698 /test-cli/test/tests/qusbdual.py
parent47827e40f71696e04ad805296dedc44a03451db3 (diff)
downloadboard-43f688b414ea182cd9baf06ee83df072c3f563f5.zip
board-43f688b414ea182cd9baf06ee83df072c3f563f5.tar.gz
board-43f688b414ea182cd9baf06ee83df072c3f563f5.tar.bz2
Added full support for USBLOOP test. Reboot board always if autotest is enabled.
Diffstat (limited to 'test-cli/test/tests/qusbdual.py')
-rw-r--r--test-cli/test/tests/qusbdual.py10
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")