3 REQUIREDPTESTS="acl attr bluez5 busybox dbus-test"
5 # Check if ptest packages are installed
6 command -v ptest-runner >/dev/null 2>&1
8 lava-test-case ptest-installed --result SKIP
10 # Run ptests for specified packages
11 for unit in ${REQUIREDPTESTS}; do
12 UNIT_LOG=$(ptest-runner ${unit} 2> /dev/null)
13 if [ $? -eq 0 ] ; then
14 lava-test-set start ptest-$unit
15 # grep: Get only the ptests results, no log
16 # sed 1: replace spaces by hyphens
17 # sed 2: remove any special character
18 # sed 3: find status and test name, wrap it in a lava-test-case call
19 # sh: execute the lava-test-case commands
20 test_pass=$(echo "$UNIT_LOG" | grep -e 'PASS' | wc -l)
21 test_fail=$(echo "$UNIT_LOG" | grep -e 'FAIL' | wc -l)
22 lava-test-case passed-commands --result PASS --measurement $test_pass --units pass
23 lava-test-case failed-commands --result FAIL --measurement $test_fail --units fail
24 lava-test-set stop ptest-$unit
26 lava-test-case ptest-runner ${unit} --result fail
29 lava-test-case ptest-runtime --measurement $SECONDS --units seconds --result PASS
32 # Wait for LAVA to parse all the tests from stdout