From c532114e01614de3885686e849c59746003bfacf Mon Sep 17 00:00:00 2001 From: Khouloud Touil Date: Fri, 11 Oct 2019 12:50:11 +0200 Subject: qa-testdefinitions: Split can tests to avoid failures Split the can tests in two, one for basic tests that doesn't need the two can interfaces to be related, and the other one is for a board with two related interfaces. Modify the test_can_modules to be run on a board with only one can if at least. AGL-bug: SPEC-2878 Change-Id: I6f761458c3e191aa8000d19cb05b0592566cb6c9 Signed-off-by: Khouloud Touil --- common/scripts/test_can_modules.sh | 19 ----------------- test-suites/short-smoke/can_if_hw_connection.yaml | 21 ++++++++++++++++++ test-suites/short-smoke/test_can.yaml | 26 ----------------------- test-suites/short-smoke/test_can_loopback.yaml | 17 +++++++++++++++ 4 files changed, 38 insertions(+), 45 deletions(-) create mode 100644 test-suites/short-smoke/can_if_hw_connection.yaml delete mode 100644 test-suites/short-smoke/test_can.yaml create mode 100644 test-suites/short-smoke/test_can_loopback.yaml diff --git a/common/scripts/test_can_modules.sh b/common/scripts/test_can_modules.sh index 12e82ee..6fe4b02 100755 --- a/common/scripts/test_can_modules.sh +++ b/common/scripts/test_can_modules.sh @@ -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 @@ -124,7 +114,6 @@ sleep 5 #Make sure always that the can interface is down before #starting the config step. ip link set can0 down -ip link set can1 down ip link set can0 type can bitrate 50000 if [ $? -eq 0 ];then @@ -134,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 diff --git a/test-suites/short-smoke/can_if_hw_connection.yaml b/test-suites/short-smoke/can_if_hw_connection.yaml new file mode 100644 index 0000000..acbd6a8 --- /dev/null +++ b/test-suites/short-smoke/can_if_hw_connection.yaml @@ -0,0 +1,21 @@ +# 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: can_if_hw_connection_test + format: "Lava-Test-Shell Test Definition 1.0" + description: "can_if_hw_connection_test" + version: 1.0 + +run: + steps: + - echo "CAN_tests" + - 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_bitrate + - ./common/scripts/test_can_bitrate.sh + - lava-test-set stop diff --git a/test-suites/short-smoke/test_can.yaml b/test-suites/short-smoke/test_can.yaml deleted file mode 100644 index 4472018..0000000 --- a/test-suites/short-smoke/test_can.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# these tests are applicable if and only if the board to be used has two CAN interfaces - -metadata: - name: my_can_test - format: "Lava-Test-Shell Test Definition 1.0" - description: "my_can_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 diff --git a/test-suites/short-smoke/test_can_loopback.yaml b/test-suites/short-smoke/test_can_loopback.yaml new file mode 100644 index 0000000..7074a0d --- /dev/null +++ b/test-suites/short-smoke/test_can_loopback.yaml @@ -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 -- cgit 1.2.3-korg