aboutsummaryrefslogtreecommitdiffstats
path: root/common/scripts/service-check.sh
blob: 4dc0a250065f430bda1979ebbb4a5fe2c1513612 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

REQUIREDSOCKETS="cynara.socket dbus.socket security-manager.socket"
REQUIREDSERVICES="afm-system-daemon.service afm-user-daemon.service connman.service ofono.service weston.service HomeScreen.service lightmediascanner.service bluetooth.service"

ALL="${REQUIREDSOCKETS} ${REQUIREDSERVICES}"
RESULT="unknown"

for i in ${ALL} ; do
    echo "########## Test for service ${i} being active ##########"
    systemctl is-active ${i} >/dev/null 2>&1
    if [ $? -eq 0 ] ; then
        RESULT="pass"
    else
        systemctl status ${i} || true
        RESULT="fail"
    fi
    echo "########## Result for service ${i} : $RESULT ##########"
    lava-test-case ${i} --result ${RESULT}
done

exit 0