summaryrefslogtreecommitdiff
path: root/automated/linux/pritee_test_utility/pritee_test_utility.sh
blob: 5f92beb84eafa239225436688558978da070b360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

. ../../lib/sh-test-lib
OUTPUT="$(pwd)/output"
LOG_FILE="${OUTPUT}/pritee_test_utility.log"
RESULT_FILE="${OUTPUT}/result.txt"
DEFAULT_OPTS="-drmpath:/usr/share/playready"
OPTS=${DEFAULT_OPTS}

if [ -n "$1" ]; then
    OPTS="$1"
fi

create_out_dir "${OUTPUT}"

chmod a+x /usr/bin/pritee_test_utility.exe
/usr/bin/pritee_test_utility.exe "${OPTS}" | tee "${LOG_FILE}"

while read -r line; do
    line=$(echo "${line}" | tr -d '[:space:]')
    case $line in
        TestArea:* )
            ta=${line#TestArea:}
            ;;
        TEST_* )
            tc=$line
            ;;
        RESULT=* )
            result=${line#RESULT=}
            result=$(echo "${result}" | tr '[:upper:]' '[:lower:]')
            echo "${ta}-${tc} ${result}" >> "${RESULT_FILE}"
            ;;
    esac
done < "${LOG_FILE}"