Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fix wifi testing #232

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/rtos_drivers/wifi/check_wifi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
31 changes: 29 additions & 2 deletions test/rtos_drivers/wifi/src/individual_tests/wifi/local/wifi_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -264,10 +291,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;
}

Expand Down
Loading