[SPEC-272] Add service test 07/11007/1
authorLoys Ollivier <lollivier@baylibre.com>
Fri, 22 Sep 2017 14:23:41 +0000 (16:23 +0200)
committerLoys Ollivier <lollivier@baylibre.com>
Fri, 22 Sep 2017 14:23:41 +0000 (16:23 +0200)
New test definition. Check that needed services are up.

Signed-off-by: Loys Ollivier <lollivier@baylibre.com>
common/scripts/service-check.sh [new file with mode: 0755]
test-suites/short-smoke/service-check.yaml [new file with mode: 0644]

diff --git a/common/scripts/service-check.sh b/common/scripts/service-check.sh
new file mode 100755 (executable)
index 0000000..6ffa6f6
--- /dev/null
@@ -0,0 +1,19 @@
+#!/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
+    systemctl is-active ${i} >/dev/null 2>&1
+    if [ $? -eq 0 ] ; then
+        RESULT="pass"
+    else
+        RESULT="fail"
+    fi
+    lava-test-case ${i} --result ${RESULT}
+done
+
+exit 0
\ No newline at end of file
diff --git a/test-suites/short-smoke/service-check.yaml b/test-suites/short-smoke/service-check.yaml
new file mode 100644 (file)
index 0000000..ca0b4c0
--- /dev/null
@@ -0,0 +1,15 @@
+metadata:
+    name: services
+    format: "Lava-Test-Shell Test Definition 1.0"
+    description: "Check all services and sockets are up on the device"
+    maintainer:
+        - lollivier@baylibre.com
+    os:
+        - openembedded
+    scope:
+        - functional
+
+run:
+    steps:
+        - "cd common/scripts"
+        - "./service-check.sh"