From 9d7b325a9dd5c60badf5e82c79b58828fdb1be82 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Wed, 18 Dec 2019 14:33:16 -0800 Subject: [PATCH] Add video group from host Signed-off-by: James Ketrenos --- scripts/test-image.sh | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/scripts/test-image.sh b/scripts/test-image.sh index bc4e67b..c314bc3 100755 --- a/scripts/test-image.sh +++ b/scripts/test-image.sh @@ -20,22 +20,33 @@ RELEASE_INFO=${RELEASE_INFO:-N/A} docker pull ${REGISTRY_URL}/${CONTAINER}:${TAG} -echo "Downloading test content" - function fail { >&2 echo "$*" exit -1 } +VIDEO=$(getent group video | sed -E 's,^video:[^:]*:([^:]*):.*$,\1,') + +cat << EOF + +Running test with video GID as ${VIDEO} + +------------------------------------------------------------------------------- + +EOF + +echo -e "Downloading test content: " mkdir $(pwd)/media wget -q -O $(pwd)/media/AUD_MW_E.264 \ https://fate-suite.libav.org/h264-conformance/AUD_MW_E.264 || fail "Unable to download test content." -chmod -R 777 $(pwd)/media -docker run \ - --rm \ - --device=/dev/dri \ - -e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \ - --volume $(pwd)/media:/media \ - ${REGISTRY_URL}/${CONTAINER}:${TAG} \ - test || fail "Unable to execute docker" +chmod -R 777 $(pwd)/media || fail "Unable to set permissions" +echo "done" + +docker run --group-add ${VIDEO} \ + --rm \ + --device=/dev/dri \ + -e QSV_DEVICE=${QSV_DEVICE:-/dev/dri/renderD128} \ + --volume $(pwd)/media:/media \ + ${REGISTRY_URL}/${CONTAINER}:${TAG} \ + test || fail "Unable to execute 'test' on image."