Merge "Differ platform and user scope in service and application"
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Thu, 17 Oct 2019 19:06:00 +0000 (19:06 +0000)
committerGerrit Code Review <gerrit@automotivelinux.org>
Thu, 17 Oct 2019 19:06:00 +0000 (19:06 +0000)
common/scripts/service-check-gfx.sh
common/scripts/test_can_bitrate.sh
common/scripts/test_can_loopback_mode.sh
common/scripts/test_can_modules.sh
common/scripts/test_can_send_receive.sh
skiplists/qemuarm [new file with mode: 0644]
skiplists/qemuarm64 [new file with mode: 0644]
test-suites/short-smoke/can_if_hw_connection.yaml [moved from test-suites/short-smoke/test_can.yaml with 55% similarity]
test-suites/short-smoke/service-check.yaml
test-suites/short-smoke/test_can_loopback.yaml [new file with mode: 0644]

index addfda9..9064dbd 100755 (executable)
@@ -3,6 +3,21 @@
 export LANG=C
 export TERM=dumb
 
+while getopts ":b:d:" option; do
+    case "${option}" in
+        b)
+            if [[ $OPTARG = -* ]]; then
+                ((OPTIND--))
+                continue
+            fi
+            BUILD_TAGS=${OPTARG}
+            ;;
+        d)
+            DEVICE_TAGS=${OPTARG}
+            ;;
+    esac
+done
+
 REQUIREDSOCKETS="cynara.socket dbus.socket security-manager.socket"
 REQUIREDSERVICES="afm-system-daemon.service connman.service ofono.service weston.service bluetooth.service"
 
@@ -14,12 +29,19 @@ sleep 10
 
 for i in ${ALL} ; do
     echo -e "\n\n########## Test for service ${i} being active ##########\n\n"
-
-    systemctl is-active ${i} >/dev/null 2>&1
-    if [ $? -eq 0 ] ; then
-        RESULT="pass"
-    else
-        RESULT="fail"
+    RESULT=""
+    if [[ ${i} == "weston.service" ]]; then
+        if [[ ${DEVICE_TAGS} != *"screen"* ]] || [[ ${BUILD_TAGS} != *"screen"* ]]; then
+            RESULT="skip"
+        fi
+    fi
+    if [[ -z $RESULT ]]; then
+        systemctl is-active ${i} >/dev/null 2>&1
+        if [ $? -eq 0 ] ; then
+            RESULT="pass"
+        else
+            RESULT="fail"
+        fi
     fi
 
     lava-test-case ${i} --result ${RESULT}
index 2461fa0..3a8f225 100755 (executable)
@@ -69,9 +69,9 @@ for b in `seq 778 790`;do
                candump can1 > $file_can &
                sleep 3
                if [ -s $file_can ];then
-                       lava-test-case can1_xfer_config_range_start --result pass --measurement $b --units bit/s
-               else
                        lava-test-case can1_xfer_config_range_start --result fail --measurement $b --units bit/s
+               else
+                       lava-test-case can1_xfer_config_range_start --result pass --measurement $b --units bit/s
                        sleep 2
                        echo "This bitrate $b belongs to the domain but doesn't provide frames transmission"
                fi
index 7f86ef9..4425c5d 100755 (executable)
@@ -9,6 +9,11 @@ if [ ! -e /sys/class/net/can0 ];then
         exit 0
 fi
 sleep 2
+
+#Make sure always that the can interface is down before
+#starting the config step.
+ip link set can0 down
+
 #config the can interfaces
 ip link set can0 type can bitrate 50000 loopback on
 sleep 2
index d6caf54..6fe4b02 100755 (executable)
@@ -8,13 +8,11 @@ if [ ! -e /sys/class/net/can1 ];then
        lava-test-case unload_c_can_module --result skipp
        lava-test-case unload_can_dev_module --result skip
        lava-test-case canconfig_can0 --result skip
-       lava-test-case canconfig_can1 --result skip
        lava-test-case load_can_module --result skip
        lava-test-case load_can_raw_module --result skip
        lava-test-case load_c_can_module --result skip
        lava-test-case load_can_dev_module --result skip
        lava-test-case canconfig_can0 --result skip
-       lava-test-case canconfig_can1 --result skip
         exit 0
 fi
 lsmod | grep can
@@ -70,14 +68,6 @@ else
        lava-test-case canconfig_can0 --result pass
 fi
 
-sleep 3
-
-ip link set can1 type can bitrate 50000
-if [ $? -eq 0 ];then
-       lava-test-case canconfig_can1 --result fail
-else
-       lava-test-case canconfig_can1 --result pass
-fi
 
 sleep 5
 
@@ -121,6 +111,10 @@ fi
 
 sleep 5
 
+#Make sure always that the can interface is down before
+#starting the config step.
+ip link set can0 down
+
 ip link set can0 type can bitrate 50000
 if [ $? -eq 0 ];then
        lava-test-case canconfig_can0 --result pass
@@ -129,11 +123,3 @@ else
 fi
 
 sleep 3
-ip link set can1 type can bitrate 50000
-if [ $? -eq 0 ];then
-       lava-test-case canconfig_can1 --result pass
-else
-       lava-test-case canconfig_can1 --result fail
-fi
-
-sleep 3
index 06bde6f..150ce37 100755 (executable)
@@ -13,6 +13,11 @@ if [ ! -e /sys/class/net/can1 ];then
        exit 0
 fi
 
+#Make sure always that the can interface is down before
+#starting the config step.
+ip link set can0 down
+ip link set can1 down
+
 #config the can interfaces
 ip link set can0 type can bitrate 50000
 if [ $? -eq 0 ];then
diff --git a/skiplists/qemuarm b/skiplists/qemuarm
new file mode 100644 (file)
index 0000000..56f5eb9
--- /dev/null
@@ -0,0 +1 @@
+weston.service
diff --git a/skiplists/qemuarm64 b/skiplists/qemuarm64
new file mode 100644 (file)
index 0000000..56f5eb9
--- /dev/null
@@ -0,0 +1 @@
+weston.service
similarity index 55%
rename from test-suites/short-smoke/test_can.yaml
rename to test-suites/short-smoke/can_if_hw_connection.yaml
index 4472018..acbd6a8 100644 (file)
@@ -1,26 +1,21 @@
-# these tests are applicable if and only if the board to be used has two CAN interfaces
+# These tests are applicable if and only if the board to be used has two CAN interfaces.
+# These two interfaces should be wired to eachother.
 
 metadata:
-  name: my_can_test
+  name: can_if_hw_connection_test
   format: "Lava-Test-Shell Test Definition 1.0"
-  description: "my_can_test"
+  description: "can_if_hw_connection_test"
   version: 1.0
 
 run:
   steps:
         - echo "CAN_tests"
-        - lava-test-set start test_can_loopback_mode
-        - ./common/scripts/test_can_loopback_mode.sh
-        - lava-test-set stop
         - lava-test-set start test_can_send_receive
         - ./common/scripts/test_can_send_receive.sh
         - lava-test-set stop
         - lava-test-set start test_stats
         - ./common/scripts/test_stats.sh
         - lava-test-set stop
-        - lava-test-set start test_can_modules
-        - ./common/scripts/test_can_modules.sh
-        - lava-test-set stop
         - lava-test-set start test_can_bitrate
         - ./common/scripts/test_can_bitrate.sh
         - lava-test-set stop
index 8c680c9..a7f7b1d 100644 (file)
@@ -8,8 +8,11 @@ metadata:
         - openembedded
     scope:
         - functional
+params:
+  BUILD_TAGS: ""
+  DEVICE_TAGS: ""
 
 run:
     steps:
-        - "cd common/scripts"
-        - "./service-check-gfx.sh"
+        - cd common/scripts
+        - ./service-check-gfx.sh -b "${BUILD_TAGS}" -d "${DEVICE_TAGS}"
diff --git a/test-suites/short-smoke/test_can_loopback.yaml b/test-suites/short-smoke/test_can_loopback.yaml
new file mode 100644 (file)
index 0000000..7074a0d
--- /dev/null
@@ -0,0 +1,17 @@
+# These tests are applicable if the board to be used has at least one CAN interface.
+
+metadata:
+  name: Test_can_loopback
+  format: "Lava-Test-Shell Test Definition 1.0"
+  description: "Test_can_loopback"
+  version: 1.0
+
+run:
+  steps:
+        - echo "basic_CAN_tests"
+        - lava-test-set start test_can_loopback_mode
+        - ./common/scripts/test_can_loopback_mode.sh
+        - lava-test-set stop
+        - lava-test-set start test_can_modules
+        - ./common/scripts/test_can_modules.sh
+        - lava-test-set stop
\ No newline at end of file