3 REQUIREDPTESTS="acl attr systemd cynara xmlsec1 libxml2 openssl openssh lua smack afb-test agl-service-signal-composer 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 ${unit}-passed-commands --result PASS --measurement $test_pass --units pass
23 if ! [ x"0" = x"$test_fail" ] ; then
24 lava-test-case ${unit}-failed-commands --result FAIL --measurement $test_fail --units fail
25 echo "$UNIT_LOG" | grep -e 'FAIL'
27 lava-test-set stop ptest-$unit
29 lava-test-case ptest-runner ${unit} --result fail
32 lava-test-case ptest-runtime --measurement $SECONDS --units seconds --result PASS
35 # Wait for LAVA to parse all the tests from stdout