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