Prepare the nogfx variant of the service check
authorJan-Simon Möller <jsmoeller@linuxfoundation.org>
Tue, 10 Oct 2017 21:06:21 +0000 (23:06 +0200)
committerJan-Simon Möller <jsmoeller@linuxfoundation.org>
Tue, 10 Oct 2017 21:06:21 +0000 (23:06 +0200)
and enhance verbosity.

Change-Id: Ia95a6236ffc4229703714ad58b70b21c00884c5c
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
common/scripts/service-check-gfx.sh [moved from common/scripts/service-check.sh with 73% similarity]
common/scripts/service-check-nogfx.sh [new file with mode: 0755]
test-suites/short-smoke/service-check-nogfx.yaml [new file with mode: 0644]
test-suites/short-smoke/service-check.yaml

similarity index 73%
rename from common/scripts/service-check.sh
rename to common/scripts/service-check-gfx.sh
index 4dc0a25..2a5353b 100755 (executable)
@@ -7,16 +7,19 @@ ALL="${REQUIREDSOCKETS} ${REQUIREDSERVICES}"
 RESULT="unknown"
 
 for i in ${ALL} ; do
-    echo "########## Test for service ${i} being active ##########"
+    echo -e "\n########## Test for service ${i} being active ##########\n"
     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}
+
+    if [ x"fail" == x"${RESULT}" ] ; then
+        systemctl status ${i} || true
+    fi
+    echo -e "\n########## Result for service ${i} : $RESULT ##########\n"
 done
 
 exit 0
\ No newline at end of file
diff --git a/common/scripts/service-check-nogfx.sh b/common/scripts/service-check-nogfx.sh
new file mode 100755 (executable)
index 0000000..62d1b3d
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+REQUIREDSOCKETS="cynara.socket security-manager.socket"
+REQUIREDSERVICES="afm-system-daemon.service afm-user-daemon.service connman.service"
+
+ALL="${REQUIREDSOCKETS} ${REQUIREDSERVICES}"
+RESULT="unknown"
+
+for i in ${ALL} ; do
+    echo -e "\n########## Test for service ${i} being active ##########\n"
+    systemctl is-active ${i} >/dev/null 2>&1
+    if [ $? -eq 0 ] ; then
+        RESULT="pass"
+    else
+        RESULT="fail"
+    fi
+    lava-test-case ${i} --result ${RESULT}
+
+    if [ x"fail" == x"${RESULT}" ] ; then
+        systemctl status ${i} || true
+    fi
+    echo -e "\n########## Result for service ${i} : $RESULT ##########\n"
+done
+
+exit 0
\ No newline at end of file
diff --git a/test-suites/short-smoke/service-check-nogfx.yaml b/test-suites/short-smoke/service-check-nogfx.yaml
new file mode 100644 (file)
index 0000000..310f223
--- /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-nogfx.sh"
index ca0b4c0..8c680c9 100644 (file)
@@ -12,4 +12,4 @@ metadata:
 run:
     steps:
         - "cd common/scripts"
-        - "./service-check.sh"
+        - "./service-check-gfx.sh"