From df2f0ad34a283f1d680721d2fbf2849971909c75 Mon Sep 17 00:00:00 2001 From: cs-xm Date: Tue, 23 Jan 2024 11:12:47 +0000 Subject: [PATCH 1/4] Increase wifi test task timeout to 60 seconds In a loud enterprise wifi environment 30 seconds isn't always enough to find, connect and setup the wifi stack, then also test. --- .../wifi/src/individual_tests/wifi/local/wifi_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/rtos_drivers/wifi/src/individual_tests/wifi/local/wifi_test.c b/test/rtos_drivers/wifi/src/individual_tests/wifi/local/wifi_test.c index 0d1e9146..fe86e7d4 100644 --- a/test/rtos_drivers/wifi/src/individual_tests/wifi/local/wifi_test.c +++ b/test/rtos_drivers/wifi/src/individual_tests/wifi/local/wifi_test.c @@ -264,10 +264,10 @@ static int main_test(wifi_test_ctx_t *ctx) BaseType_t ret = xTaskNotifyWait((uint32_t)0, (uint32_t)0, (uint32_t*) &status, - pdMS_TO_TICKS(30000)); + pdMS_TO_TICKS(60000)); if (ret == pdFALSE) { - local_printf("Failed to recieve ping result after 30 seconds"); + local_printf("Failed to recieve ping result after 60 seconds"); return -1; } From 30b68a54b966ad909030308958b6082a734da2f6 Mon Sep 17 00:00:00 2001 From: cs-xm Date: Tue, 23 Jan 2024 15:31:06 +0000 Subject: [PATCH 2/4] add ip_info_print functionality to wifi testing This allows us to print the full IP info actually used during wifi testing, to quickly see any potential issues with the IP stack. --- .../individual_tests/wifi/local/wifi_test.c | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/rtos_drivers/wifi/src/individual_tests/wifi/local/wifi_test.c b/test/rtos_drivers/wifi/src/individual_tests/wifi/local/wifi_test.c index fe86e7d4..ce381b1a 100644 --- a/test/rtos_drivers/wifi/src/individual_tests/wifi/local/wifi_test.c +++ b/test/rtos_drivers/wifi/src/individual_tests/wifi/local/wifi_test.c @@ -94,6 +94,32 @@ static void scan(void) { } } +static void ip_info_printf(void) { + + uint32_t ulIPAddress, ulNetMask, ulGatewayAddress, ulDNSServerAddress; + int8_t cBuffer[ 16 ]; + + local_printf("Getting FreeRTOS IP Configuration"); + FreeRTOS_GetAddressConfiguration( &ulIPAddress, &ulNetMask, &ulGatewayAddress, + &ulDNSServerAddress ); + + /* Convert the IP address to a string then print it out. */ + FreeRTOS_inet_ntoa( ulIPAddress, cBuffer ); + local_printf( "IP Address: %s", cBuffer ); + + /* Convert the net mask to a string then print it out. */ + FreeRTOS_inet_ntoa( ulNetMask, cBuffer ); + local_printf( "Subnet Mask: %s", cBuffer ); + + /* Convert the IP address of the gateway to a string then print it out. */ + FreeRTOS_inet_ntoa( ulGatewayAddress, cBuffer ); + local_printf( "Gateway IP Address: %s", cBuffer ); + + /* Convert the IP address of the DNS server to a string then print it out. */ + FreeRTOS_inet_ntoa( ulDNSServerAddress, cBuffer ); + local_printf( "DNS server IP Address: %s", cBuffer ); +} + int wifi_conn_mgr_event_cb(int event, char *ssid, char *password) { switch (event) { case WIFI_CONN_MGR_EVENT_STARTUP: @@ -122,6 +148,7 @@ int wifi_conn_mgr_event_cb(int event, char *ssid, char *password) { while (WIFI_GetIP(ip) != eWiFiSuccess) { vTaskDelay(pdMS_TO_TICKS(100)); } + ip_info_printf(); WIFI_GetHostIP("xmos.com", ip); local_printf("xmos.com has IP address %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); local_printf("Attemping to ping xmos.com"); From 8a08a7b16060d0391b75d16f89cea2b82bc9fe72 Mon Sep 17 00:00:00 2001 From: cs-xm Date: Tue, 23 Jan 2024 16:04:11 +0000 Subject: [PATCH 3/4] Increase timeout on wifi shell script to 90 This is so we leave the now extended test enough time to fail after 60 seconds before cutting it off from the calling bash script. --- test/rtos_drivers/wifi/check_wifi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rtos_drivers/wifi/check_wifi.sh b/test/rtos_drivers/wifi/check_wifi.sh index 7398ab4b..cd311b09 100755 --- a/test/rtos_drivers/wifi/check_wifi.sh +++ b/test/rtos_drivers/wifi/check_wifi.sh @@ -28,7 +28,7 @@ done # assign vars REPORT=testing/test.rpt FIRMWARE=test_rtos_driver_wifi.xe -TIMEOUT_S=60 +TIMEOUT_S=90 if [ ! -z "${@:$OPTIND:1}" ] then ADAPTER_ID="--adapter-id ${@:$OPTIND:1}" From ef2d2bfa872dd26002f663fc8ea45ab9856125fd Mon Sep 17 00:00:00 2001 From: cs-xm Date: Sat, 27 Jan 2024 14:36:57 +0000 Subject: [PATCH 4/4] Re-enable Jenkins Wifi testing --- Jenkinsfile | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ae6ec84e..96db3809 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,21 +106,20 @@ pipeline { sh "rm -f ~/.xtag/status.lock ~/.xtag/acquired" } } - // TODO Disabled till https://xmosjira.atlassian.net/browse/AP-353 is fixed - //stage('Run RTOS Drivers WiFi test') { - // steps { - // withTools(params.TOOLS_VERSION) { - // withVenv { - // script { - // withXTAG(["$RTOS_TEST_RIG_TARGET"]) { adapterIDs -> - // sh "test/rtos_drivers/wifi/check_wifi.sh " + adapterIDs[0] - // } - // sh "pytest test/rtos_drivers/wifi" - // } - // } - // } - // } - //} + stage('Run RTOS Drivers WiFi test') { + steps { + withTools(params.TOOLS_VERSION) { + withVenv { + script { + withXTAG(["$RTOS_TEST_RIG_TARGET"]) { adapterIDs -> + sh "test/rtos_drivers/wifi/check_wifi.sh " + adapterIDs[0] + } + sh "pytest test/rtos_drivers/wifi" + } + } + } + } + } stage('Run RTOS Drivers HIL test') { steps { withTools(params.TOOLS_VERSION) {