diff options
author | Manel Caro <mcaro@iseebcn.com> | 2019-03-09 21:25:56 +0100 |
---|---|---|
committer | Manel Caro <mcaro@iseebcn.com> | 2019-03-09 21:25:56 +0100 |
commit | 9332c933fc05f42882640c9a4e35fab09854af84 (patch) | |
tree | 2b9b00b5a411b27f9705603c0d93b8925afd4677 /test-cli/test/tests/qscreen.py | |
download | board-9332c933fc05f42882640c9a4e35fab09854af84.zip board-9332c933fc05f42882640c9a4e35fab09854af84.tar.gz board-9332c933fc05f42882640c9a4e35fab09854af84.tar.bz2 |
Board: Client Test Suite Initial Commit
Diffstat (limited to 'test-cli/test/tests/qscreen.py')
-rw-r--r-- | test-cli/test/tests/qscreen.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test-cli/test/tests/qscreen.py b/test-cli/test/tests/qscreen.py new file mode 100644 index 0000000..3beff83 --- /dev/null +++ b/test-cli/test/tests/qscreen.py @@ -0,0 +1,36 @@ +from test.helpers.syscmd import SysCommand +import unittest +import time +from test.helpers.cv_display_test import pattern_detect + +class Qscreen(unittest.TestCase): + + def __init__(self, testname, testfunc, display): + super(Qscreen, self).__init__(testfunc) + self.__display = display + self._testMethodDoc = testname + + def execute(self): + str_cmd = "fbi -T 1 --noverbose -d /dev/{} test/files/test_pattern.png 2> /dev/null".format(self.__display) + display_image = SysCommand("display_image", str_cmd) + if display_image.execute() == 0: + str_cmd = "ls /dev/v4l/by-id/usb-Creative_Technology*" + camera_check = SysCommand("camera_check", str_cmd) + if camera_check.execute() == 0: + test_screen = pattern_detect(1) + if not test_screen=="0": + self.fail("failed: {}".format(test_screen)) + str_cmd= "fbi -T 1 /home/root/result_hdmi_img.jpg -d /dev/fb0 --noverbose -a" + show_img = SysCommand("show-image", str_cmd) + show_img.execute() + else: + self.fail("failed: camera not found. USB PROBLEM??") + else: + self.fail("failed: could not display the image") + try: + str_cmd= "fbi -T 1 /home/root/result_hdmi_img.jpg -d /dev/fb0 --noverbose -a" + show_img = SysCommand("show-image", str_cmd) + show_img.execute() + except ValueError: + print("COULD NOT DISPLAY IMAGE") + |