1
0
intel-media-ffmpeg/scripts/test-image.sh
James Ketrenos 9d7b325a9d Add video group from host
Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
2019-12-18 14:33:16 -08:00

53 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# Bring in the variables from SOLUTION file, supporting
# nested substitution
. SOLUTION
. MANIFEST
VARS=($(sed -nE "s,(^[^#][^=]*).*$,\1,pg" SOLUTION))
VARS+=($(sed -nE "s,(^[^#][^=]*).*$,\1,pg" MANIFEST))
for var in ${VARS[@]}; do
export ${var}
done
RELEASE_INFO=${RELEASE_INFO:-N/A}
[[ "${RELEASE_INFO}" == "N/A" ]] && {
TAG=${TAG:-test-build-${OS_DISTRO}-${PACKAGE_STREAM}-$(date +%Y%m%d)}
} || {
TAG=${TAG:-test-${OS_DISTRO}-${PACKAGE_STREAM}-${RELEASE_INFO}}
}
docker pull ${REGISTRY_URL}/${CONTAINER}:${TAG}
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 || 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."