mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #5568 from VeijoPesonen/greentea-wifi-fixes
Greentea Wifi testcase fixespull/5723/head
commit
63a923752b
|
@ -28,7 +28,24 @@ using namespace utest::v1;
|
|||
void wifi_connect_params_valid_secure(void)
|
||||
{
|
||||
WiFiInterface *wifi = get_interface();
|
||||
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA2));
|
||||
|
||||
if(wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA2) == NSAPI_ERROR_OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA_WPA2) == NSAPI_ERROR_OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WPA) == NSAPI_ERROR_OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(wifi->connect(MBED_CONF_APP_WIFI_SECURE_SSID, MBED_CONF_APP_WIFI_PASSWORD, NSAPI_SECURITY_WEP) == NSAPI_ERROR_OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
TEST_FAIL();
|
||||
}
|
||||
|
||||
#endif // defined(MBED_CONF_APP_WIFI_SECURE_SSID)
|
||||
|
|
|
@ -35,7 +35,7 @@ void wifi_get_rssi(void)
|
|||
|
||||
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->connect());
|
||||
|
||||
TEST_ASSERT_INT8_WITHIN(-35, -65, wifi->get_rssi()); // -30 ... -100
|
||||
TEST_ASSERT_INT8_WITHIN(-10, -100, wifi->get_rssi());
|
||||
}
|
||||
|
||||
#endif // defined(MBED_CONF_APP_WIFI_UNSECURE_SSID)
|
||||
|
|
|
@ -50,8 +50,7 @@ void wifi_scan(void)
|
|||
nsapi_security_t security = ap[i].get_security();
|
||||
int8_t rssi = ap[i].get_rssi();
|
||||
uint8_t ch = ap[i].get_channel();
|
||||
TEST_ASSERT_NOT_EQUAL(0, strlen(ssid));
|
||||
TEST_ASSERT_INT8_WITHIN(-35, -65, rssi);
|
||||
TEST_ASSERT_INT8_WITHIN(-10, -100, rssi);
|
||||
if (strcmp(MBED_CONF_APP_WIFI_SECURE_SSID, ssid) == 0) {
|
||||
secure_found = true;
|
||||
TEST_ASSERT_EQUAL_INT(NSAPI_SECURITY_WPA2, security);
|
||||
|
|
|
@ -40,6 +40,12 @@ void wifi_set_credential(void)
|
|||
error = iface->set_credentials("OK", NULL, NSAPI_SECURITY_WPA_WPA2);
|
||||
TEST_ASSERT(error == NSAPI_ERROR_PARAMETER);
|
||||
|
||||
error = iface->set_credentials("OK", NULL, NSAPI_SECURITY_NONE);
|
||||
TEST_ASSERT(error == NSAPI_ERROR_OK);
|
||||
|
||||
error = iface->set_credentials("OK", "12345678", NSAPI_SECURITY_WEP);
|
||||
TEST_ASSERT((error == NSAPI_ERROR_OK) || (error == NSAPI_ERROR_UNSUPPORTED));
|
||||
|
||||
error = iface->set_credentials("OK", "12345678", NSAPI_SECURITY_WPA);
|
||||
TEST_ASSERT(error == NSAPI_ERROR_OK);
|
||||
|
||||
|
@ -49,6 +55,9 @@ void wifi_set_credential(void)
|
|||
error = iface->set_credentials("OK", "12345678", NSAPI_SECURITY_WPA_WPA2);
|
||||
TEST_ASSERT(error == NSAPI_ERROR_OK);
|
||||
|
||||
error = iface->set_credentials("OK", "kUjd0PHHeAqaDoyfcDDEOvbyiVbYMpUHDukGoR6EJZnO5iLzWsfwiM9JQqOngni82", NSAPI_SECURITY_WPA2);
|
||||
error = iface->set_credentials("OK", "kUjd0PHHeAqaDoyfcDDEOvbyiVbYMpUHDukGoR6EJZnO5iLzWsfwiM9JQqOngni", NSAPI_SECURITY_WPA2);
|
||||
TEST_ASSERT(error == NSAPI_ERROR_OK);
|
||||
|
||||
error = iface->set_credentials("OK", "kUjd0PHHeAqaDoyfcDDEOvbyiVbYMpUHDukGoR6EJZnO5iLzWsfwiM9JQqOngni8", NSAPI_SECURITY_WPA2);
|
||||
TEST_ASSERT(error == NSAPI_ERROR_PARAMETER);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue