Skip to content

Commit

Permalink
tests: fail earlier if /dev/video0 doesn't exists
Browse files Browse the repository at this point in the history
Handle timeout waiting for the device as test failure earlier.
  • Loading branch information
marmarek committed Jul 19, 2024
1 parent 724727a commit 8f1c8a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/qvctests/integ.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ def setUp(self):
self.skipTest('qubes-video-companion not installed')

def wait_for_video0(self, vm):
vm.run(
retcode = vm.run(
'for i in `seq 30`; do '
' v4l2-ctl --list-formats /dev/video0 2>/dev/null | grep -F "[0]" && break; '
' sleep 0.5; '
'done; sleep 1', wait=True)
'done; sleep 1; test -e /dev/video0', wait=True)
self.assertEqual(retcode, 0,
f"Timeout waiting for /dev/video0 in {vm.name}")

def wait_for_video0_disconnect(self, vm):
vm.run(
Expand Down

0 comments on commit 8f1c8a4

Please sign in to comment.