Adapt service checks for gfx and nogfx case
[src/qa-testdefinitions.git] / common / scripts / service-check-gfx.sh
1 #!/bin/bash
2
3 export LANG=C
4 export TERM=dumb
5
6 REQUIREDSOCKETS="cynara.socket dbus.socket security-manager.socket"
7 REQUIREDSERVICES="afm-system-daemon.service connman.service ofono.service weston.service HomeScreen.service lightmediascanner.service bluetooth.service"
8
9 ALL="${REQUIREDSOCKETS} ${REQUIREDSERVICES}"
10 RESULT="unknown"
11
12 for i in ${ALL} ; do
13     echo -e "\n\n########## Test for service ${i} being active ##########\n\n"
14
15     systemctl is-active ${i} >/dev/null 2>&1
16     if [ $? -eq 0 ] ; then
17         RESULT="pass"
18     else
19         RESULT="fail"
20     fi
21
22     lava-test-case ${i} --result ${RESULT}
23     systemctl status ${i} || true
24     echo -e "\n\n"
25
26     echo -e "\n\n########## Result for service ${i} : $RESULT ##########\n\n"
27 done
28
29 echo "------------------------------------------------"
30 echo "All systemd units:"
31 echo "------------------------------------------------"
32 systemctl list-units || true
33 echo "------------------------------------------------"
34 echo "Only the failed systemd units:"
35 echo "------------------------------------------------"
36 ( systemctl list-units | grep failed ) || true
37
38 exit 0