diff options
author | Hector Fernandez <hector@iatec.biz> | 2020-04-16 17:09:19 +0200 |
---|---|---|
committer | Hector Fernandez <hector@iatec.biz> | 2020-04-16 17:09:19 +0200 |
commit | 6a680137694233008005415e22cf889b85baa292 (patch) | |
tree | b0b1c68dab8a76383e18c4d16f231f6171524ea2 /test-cli/test/tests/qusb.py | |
parent | 9f613e33f27f772682ab7d7bd2261a9c4bd014c5 (diff) | |
download | board-6a680137694233008005415e22cf889b85baa292.zip board-6a680137694233008005415e22cf889b85baa292.tar.gz board-6a680137694233008005415e22cf889b85baa292.tar.bz2 |
First release
Diffstat (limited to 'test-cli/test/tests/qusb.py')
-rw-r--r-- | test-cli/test/tests/qusb.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test-cli/test/tests/qusb.py b/test-cli/test/tests/qusb.py index 6c22c48..4c177d9 100644 --- a/test-cli/test/tests/qusb.py +++ b/test-cli/test/tests/qusb.py @@ -1,6 +1,7 @@ import sh import unittest import re +import os from test.helpers.changedir import changedir @@ -14,7 +15,9 @@ class Qusb(unittest.TestCase): def execute(self): # Execute script usb.sh - p = sh.bash('test/scripts/usb.sh') + test_abspath = os.path.dirname(os.path.abspath(__file__)) + test_abspath = os.path.join(test_abspath, "..", "..") + p = sh.bash(os.path.join(test_abspath, 'test/scripts/usb.sh')) # Search in the stdout a pattern "/dev/sd + {letter} + {number} q = re.search("/dev/sd\w\d", p.stdout.decode('ascii')) # get the first device which matches the pattern @@ -33,7 +36,9 @@ class Qusb(unittest.TestCase): p = sh.mount(device, "/mnt/pendrive") if p.exit_code == 0: # copy files - p = sh.cp("test/files/usbtest/usbdatatest.bin", "test/files/usbtest/usbdatatest.md5", "/mnt/pendrive") + p = sh.cp(os.path.join(test_abspath, "test/files/usbtest/usbdatatest.bin"), + os.path.join(test_abspath, "test/files/usbtest/usbdatatest.md5"), + "/mnt/pendrive") if p.exit_code == 0: # check md5 with changedir("/mnt/pendrive/"): |