SPEC-2996: handle rcar_can 83/23083/1
authorCorentin LABBE <clabbe@baylibre.com>
Thu, 28 Nov 2019 09:10:49 +0000 (10:10 +0100)
committerCorentin LABBE <clabbe@baylibre.com>
Thu, 28 Nov 2019 09:10:49 +0000 (10:10 +0100)
The test remove can_dv module fail on H3 due to rcar_can using it.
This patchs handle this case.

Change-Id: I452a61813567ad09f3f819ce73c1c11753326514
Bug-AGL: SPEC-2996
Signed-off-by: Corentin LABBE <clabbe@baylibre.com>
common/scripts/test_can_modules.sh

index 9a5a6bd..2a16897 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+RCAR_CAN=0
+
 if [ ! -e /sys/class/net/can1 ];then
        lava-test-case show_can_modules --result skip
        lava-test-case unload_can_raw_module --result skip
@@ -48,7 +50,13 @@ remove_module c_can_platform
 
 remove_module c_can
 
-remove_module can_dev unload_can_dev_module
+lsmod | grep -q rcar_can
+if [ $? -eq 0 ];then
+       RCAR_CAN=1
+       remove_module rcar_can
+fi
+
+remove_module can_dev
 
 ip -V | grep -q -i BusyBox
 if [ $? -eq 0 ];then
@@ -72,6 +80,10 @@ modprobe_module c_can_platform
 
 modprobe_module can_dev
 
+if [ $RCAR_CAN -eq 1 ];then
+       modprobe_module rcar_can
+fi
+
 #Make sure always that the can interface is down before
 #starting the config step.
 ip link set can0 down