addfda9137ef17a111cab491abfc51608f2e7837
[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 bluetooth.service"
8
9 ALL="${REQUIREDSOCKETS} ${REQUIREDSERVICES}"
10 RESULT="unknown"
11
12 # add delay for services to fully start
13 sleep 10
14
15 for i in ${ALL} ; do
16     echo -e "\n\n########## Test for service ${i} being active ##########\n\n"
17
18     systemctl is-active ${i} >/dev/null 2>&1
19     if [ $? -eq 0 ] ; then
20         RESULT="pass"
21     else
22         RESULT="fail"
23     fi
24
25     lava-test-case ${i} --result ${RESULT}
26     systemctl status ${i} || true
27     echo -e "\n\n"
28
29     echo -e "\n\n########## Result for service ${i} : $RESULT ##########\n\n"
30 done
31
32 echo "------------------------------------------------"
33 echo "All systemd units:"
34 echo "------------------------------------------------"
35 systemctl list-units || true
36 echo "------------------------------------------------"
37 echo "Only the failed systemd units:"
38 echo "------------------------------------------------"
39 ( systemctl list-units | grep failed ) || true
40
41 exit 0