samples: net: sockets: can: Fix the test termination criteria

If enabling CONFIG_POSIX_API, we get three file descriptors open
before any socket descriptors. The sample exit criteria checks
socket 0 and 1 which is no longer a valid one, so change the
check to be either 0 or 3, and 1 or 4 so that the test can be
run in both when POSIX API is enabled or disabled.

Also disable color printing for the test run so that it is
easier to read the output log.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
Jukka Rissanen 2024-03-10 10:40:10 +02:00 committed by David Leach
parent 66bc15d89d
commit c0fcd8c9b5

View file

@ -12,20 +12,22 @@ tests:
sample.net.sockets.can.one_socket:
extra_configs:
- CONFIG_NET_SOCKETS_CAN_RECEIVERS=1
- CONFIG_LOG_BACKEND_SHOW_COLOR=n
harness_config:
type: multi_line
ordered: true
regex:
- "(.*)\\[0\\] CAN frame: IDE 0x0 RTR 0x0 ID 0x1 DLC 0x8"
- "(.*)\\[0|3\\] CAN frame: IDE 0x0 RTR 0x0 ID 0x1 DLC 0x8"
- "(.*)f0 f1 f2 f3 f4 f5 f6 f7"
sample.net.sockets.can.two_sockets:
extra_configs:
- CONFIG_NET_SOCKETS_CAN_RECEIVERS=2
- CONFIG_LOG_BACKEND_SHOW_COLOR=n
harness_config:
type: multi_line
ordered: true
regex:
- "(.*)\\[0\\] CAN frame: IDE 0x0 RTR 0x0 ID 0x1 DLC 0x8"
- "(.*)\\[0|3\\] CAN frame: IDE 0x0 RTR 0x0 ID 0x1 DLC 0x8"
- "(.*)f0 f1 f2 f3 f4 f5 f6 f7"
- "(.*)\\[1\\] CAN frame: IDE 0x0 RTR 0x0 ID 0x1 DLC 0x8"
- "(.*)\\[1|4\\] CAN frame: IDE 0x0 RTR 0x0 ID 0x1 DLC 0x8"
- "(.*)f0 f1 f2 f3 f4 f5 f6 f7"