File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,8 @@ TESTS = \
6060 test/simple.sh \
6161 test/filename.sh \
6262 test/test_mk.sh \
63- test/test_ffv1.sh
63+ test/test_ffv1.sh \
64+ test/test_policy.sh
6465
6566SAMPLES_DIR = test/SampleFiles
6667
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ PATH_SCRIPT=$( dirname " ${0} " )
4+ . " ${PATH_SCRIPT} /utils.sh"
5+
6+ FILES_DIRECTORY=" ${PATH_SCRIPT} /SampleFiles/PolicyTestFiles"
7+
8+ MC=" ${PWD} /mediaconch"
9+
10+ RCODE=0
11+
12+ while read LINE ; do
13+ POLICY=" $( echo " ${LINE} " | cut -d' :' -f1) "
14+ FILE=" $( echo " ${LINE} " | cut -d' :' -f2) "
15+ OUTCOME=" $( echo " ${LINE} " | cut -d' :' -f3) "
16+ TEST=" ${POLICY} :$( basename " ${FILE} " ) :${OUTCOME} "
17+
18+ if [ ! -e " ${FILES_DIRECTORY} /Policy/${POLICY} " ] ; then
19+ echo " NOK: ${TEST} /${POLICY} , file not found" >&9
20+ RCODE=1
21+ continue
22+ fi
23+
24+ if [ ! -e " ${FILES_DIRECTORY} /${FILE} " ] ; then
25+ echo " NOK: ${TEST} /${FILE} , file not found" >&9
26+ RCODE=1
27+ continue
28+ fi
29+
30+ pushd " ${FILES_DIRECTORY} " > /dev/null 2>&1
31+ DATA=" $( ${MC} -p Policy/${POLICY} -fx ${FILE} ) "
32+
33+ T1=` echo " ${DATA} " | xmllint --xpath \
34+ " string(/*[local-name()='MediaConch']/*[local-name()='media']/*[local-name()='policy']/@outcome)" -`
35+
36+ if [ " ${T1} " == " ${OUTCOME} " ] ; then
37+ echo " OK: ${TEST} " >&9
38+ else
39+ echo " NOK: ${TEST} , failed" >&9
40+ RCODE=1
41+ fi
42+ popd > /dev/null 2>&1
43+ done < " ${PATH_SCRIPT} /test_policy.txt"
44+
45+ exit ${RCODE}
Original file line number Diff line number Diff line change 1+ value.xml:Matroska/videofirst.mkv:pass
2+ value.xml:Matroska/audiofirst.mkv:fail
3+ info.xml:Matroska/audiofirst.mkv:info
4+ warn.xml:Matroska/audiofirst.mkv:warn
5+ levelcap.xml:Matroska/audiofirst.mkv:info
6+ operators.xml:Matroska/videofirst.mkv:pass
7+ mmt.xml:Matroska/videofirst.mkv:pass
You can’t perform that action at this time.
0 commit comments