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.py9
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/"):