diff options
author | Hector Fernandez <hector@iatec.biz> | 2020-03-10 17:37:16 +0100 |
---|---|---|
committer | Hector Fernandez <hector@iatec.biz> | 2020-03-11 10:15:20 +0100 |
commit | 41ffba6a76a80a7ef4553cb8856393dd209d172e (patch) | |
tree | f8ad8a10870ff4b489eb35f04eef643191a7a705 /test-cli/test/tests/qusb.py | |
parent | d38c92bfd7b6abe3a52b51b87b1a2949b857d9b4 (diff) | |
download | board-41ffba6a76a80a7ef4553cb8856393dd209d172e.zip board-41ffba6a76a80a7ef4553cb8856393dd209d172e.tar.gz board-41ffba6a76a80a7ef4553cb8856393dd209d172e.tar.bz2 |
First release of the test. All the tests work correctly for SOPA0000.
Diffstat (limited to 'test-cli/test/tests/qusb.py')
-rw-r--r-- | test-cli/test/tests/qusb.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test-cli/test/tests/qusb.py b/test-cli/test/tests/qusb.py index 6a004f0..6c22c48 100644 --- a/test-cli/test/tests/qusb.py +++ b/test-cli/test/tests/qusb.py @@ -21,11 +21,19 @@ class Qusb(unittest.TestCase): device = q.group(0) # create a new folder where the pendrive is going to be mounted sh.mkdir("-p", "/mnt/pendrive") + # check if the device is mounted, and umount it + try: + p = sh.findmnt("-n", device) + if p.exit_code == 0: + sh.umount(device) + except sh.ErrorReturnCode_1: + # error = 1 means "no found" + pass # mount the device p = sh.mount(device, "/mnt/pendrive") if p.exit_code == 0: # copy files - p = sh.cp("/root/usbtest/usbdatatest.bin", "/root/usbtest/usbdatatest.md5", "/mnt/pendrive") + p = sh.cp("test/files/usbtest/usbdatatest.bin", "test/files/usbtest/usbdatatest.md5", "/mnt/pendrive") if p.exit_code == 0: # check md5 with changedir("/mnt/pendrive/"): |