summaryrefslogtreecommitdiff
path: root/test-cli/test/tests/qusb.py
diff options
context:
space:
mode:
Diffstat (limited to 'test-cli/test/tests/qusb.py')
-rw-r--r--test-cli/test/tests/qusb.py10
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/"):