External webcam requirement should be added into screenshot graphic tests

Bug #1400578 reported by Chih-Hsyuan Ho
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Won't Fix
Undecided
Unassigned

Bug Description

This requirement
"environ: EXTERNAL_WEBCAM_DEVICE"
should be added to those external USB webcam related test cases.
e.g. graphics/generator_screenshot_fullscreen_video

Otherwise CDTS itself will hang.

Tags: jobs
Revision history for this message
Chih-Hsyuan Ho (chih) wrote :
Revision history for this message
Chih-Hsyuan Ho (chih) wrote :
Po-Hsu Lin (cypressyew)
Changed in cdts:
assignee: nobody → Po-Hsu Lin (cypressyew)
status: New → In Progress
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

I think there are several issues here.
1. EXTERNAL_WEBCAM_DEVICE should be used as how we did in opencv test.
2. Without external webcam connected, it should at least fail itself like the opencv test.
(it will fail since we don't have hardware requirements there, this kind of opencv fail is quite common in SRU reports)

Maybe it's more related to checkbox provider, I will change the affected project.

information type: Proprietary → Public
affects: cdts → plainbox-provider-checkbox
tags: added: jobs
Revision history for this message
Daniel Manrique (roadmr) wrote :

Hey, wait, environ: is only needed for jobs that will run as root. Notice that the example job given (the fullscreen video screenshot jobs) are NOT run as root:

  [ -f ${PLAINBOX_PROVIDER_DATA}/video/Ogg_Theora_Video.ogv ] || { echo "Video file not found"; exit 1; }
  dbus-launch gsettings set org.gnome.totem repeat true
  totem --fullscreen ${PLAINBOX_PROVIDER_DATA}/video/Ogg_Theora_Video.ogv 2>/dev/null &
  set -o pipefail
  sleep 15 && camera_test still --device=/dev/external_webcam -f ${PLAINBOX_SESSION_SHARE}/screenshot_fullscreen_video_${index}.jpg -q 2>&1 | ansi_parser
  sleep 5 && totem --quit 2>/dev/null
  dbus-launch gsettings set org.gnome.totem repeat false
 _summary: Test FSV screenshot for $product
 _description:
  PURPOSE:
      Take a screengrab of the current screen during fullscreen video playback using the $product graphics card
  STEPS:
      1. Start a fullscreen video playback
      2. Take picture using USB webcam after a few seconds
  VERIFICATION:
      Review attachment manually later
 EOF

So in this case it shouldn't need the environ: setting.

The only job which uses th EXTERNAL_WEBCAM_DEVICE variable is graphics/screenshot_opencv_validation, as Sam mentioned:

plugin: shell
id: graphics/screenshot_opencv_validation
requires: package.name == 'python-opencv'
environ: EXTERNAL_WEBCAM_DEVICE
command:
 screenshot_validation \
    ${PLAINBOX_PROVIDER_DATA}/images/logo_Ubuntu_stacked_black.png \
    --device=${EXTERNAL_WEBCAM_DEVICE:-/dev/external_webcam} \
    -o ${PLAINBOX_SESSION_SHARE}/screenshot_opencv_validation.jpg
_summary: Test that a screenshot is valid, automatically
_description:
 Take a screengrab of the screen displaying a black and white Ubuntu logo.
 Check that the screenshot matches the original file using OpenCV ORB detection.

But note that this is also not run as root, so the environ setting is unneeded.

The EXTERNAL_WEBCAM_DEVICE setting should already be in the environment when checkbox is invoked. I think the issue here is that the fullscreen test (and others) have /dev/external_webcam hardcoded. Instead, as Sam said, we should add --device=${EXTERNAL_WEBCAM_DEVICE:-/dev/external_webcam} to them. But note that again, unless the job is run as root, the environ: key is NOT needed.

Perhaps I'd also look at the camera_test script to ensure it fails gracefully if the device it receives is not available.

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Hi Daniel,
thanks for the hint!

And indeed, these minor modification can't make it work as expected.
We need to add hardware requirements or deal with the camera_test script.

Changed in plainbox-provider-checkbox:
status: In Progress → Confirmed
assignee: Po-Hsu Lin (cypressyew) → nobody
milestone: none → future
Changed in plainbox-provider-checkbox:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.