From 6f666ccf26e43ae1aa69f36b26df7e3c6b201686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 19 Jul 2024 20:16:55 +0200 Subject: [PATCH] tests: rename "screenshare" to "source" It better matches the function, since "screenshare" service is not used in the webcam service anymore. --- tests/qvctests/integ.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/qvctests/integ.py b/tests/qvctests/integ.py index ba9b252..ed929ba 100644 --- a/tests/qvctests/integ.py +++ b/tests/qvctests/integ.py @@ -8,10 +8,10 @@ class TC_00_QVCTest(qubes.tests.extra.ExtraTestCase): def setUp(self): super(TC_00_QVCTest, self).setUp() - self.screenshare, self.view = self.create_vms( - ["share", "view"]) - self.screenshare.start() - if self.screenshare.run('which qubes-video-companion', wait=True) != 0: + self.source, self.view = self.create_vms( + ["source", "view"]) + self.source.start() + if self.source.run('which qubes-video-companion', wait=True) != 0: self.skipTest('qubes-video-companion not installed') def wait_for_video0(self, vm): @@ -74,12 +74,12 @@ def compare_images(self, img1, img2): return sqrt(sum2/len(img1)) - def test_010_screenshare(self): + def test_010_source(self): self.view.start() self.qrexec_policy('qvc.ScreenShare', self.view.name, '@default', - target=self.screenshare.name) + target=self.source.name) p = self.view.run('qubes-video-companion screenshare', passio_popen=True, passio_stderr=True) # wait for device to appear, or a timeout @@ -90,11 +90,11 @@ def test_010_screenshare(self): p.returncode, *p.communicate())) # capture in source: - source_image = self.capture_from_screen(self.screenshare) + source_image = self.capture_from_screen(self.source) destination_image = self.capture_from_video(self.view) diff = self.compare_images(source_image, destination_image) self.assertLess(diff, 2.0) - self.click_stop(self.screenshare, 'screenshare') + self.click_stop(self.source, 'source') # wait for device to disappear, or a timeout self.wait_for_video0_disconnect(self.view) stdout, stderr = p.communicate() @@ -109,23 +109,23 @@ def test_010_screenshare(self): def test_020_webcam(self): """Webcam test - screenshare -> view (webcam) + source -> view (webcam) """ # give a bit more memory for webcam, it runs both sender and receiver - self.loop.run_until_complete(self.wait_for_session(self.screenshare)) + self.loop.run_until_complete(self.wait_for_session(self.source)) self.view.start() self.loop.run_until_complete(self.wait_for_session(self.view)) self.qrexec_policy('qvc.Webcam', self.view.name, '@default', - target=self.screenshare.name) - self.screenshare.run("modprobe v4l2loopback", user="root", wait=True) - p = self.screenshare.run( + target=self.source.name) + self.source.run("modprobe v4l2loopback", user="root", wait=True) + p = self.source.run( "gst-launch-1.0 -q testvideosrc pattern=checkers-8" " ! v4l2sink device=/dev/video0", passio_popen=True, passio_stderr=True) # wait for device to appear, or a timeout - self.wait_for_video0(self.screenshare) + self.wait_for_video0(self.source) self.loop.run_until_complete(asyncio.sleep(3)) if p.returncode is not None: self.fail("'gst-launch-1.0 testvideosrc' exited early ({}): {} {}".format( @@ -138,13 +138,13 @@ def test_020_webcam(self): self.fail("'qubes-video-companion webcam' exited early ({}): {} {}".format( p2.returncode, *p2.communicate())) - source_image = self.capture_from_video(self.screenshare) + source_image = self.capture_from_video(self.source) destination_image = self.capture_from_video(self.view) diff = self.compare_images(source_image, destination_image) self.assertLess(diff, 2.5) - self.click_stop(self.screenshare, 'screenshare') + self.click_stop(self.source, 'source') self.wait_for_video0_disconnect(self.view) - self.screenshare.run("pkill gst-launch-1.0", wait=True) + self.source.run("pkill gst-launch-1.0", wait=True) stdout, stderr = p2.communicate() if p2.returncode != 0: self.fail("'qubes-video-companion webcam' failed ({}): {} {}".format(