Skip to content

Greentea wifi test cases - disconnect done as teardown after each connect #5743

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

Merged
merged 6 commits into from
Dec 28, 2017
Merged

Greentea wifi test cases - disconnect done as teardown after each connect #5743

merged 6 commits into from
Dec 28, 2017

Conversation

VeijoPesonen
Copy link
Contributor

Description

Assumed behavior of the drivers is that when connect method is called the modem is not in connected state. In other words when a test case executes connect successfully the next case assumes that disconnect has also been called.

If AP is not found instead of expecting NSAPI_ERROR_PARAMETER we are expecting NSAPI_ERROR_NO_SSID from now on.

NSAPI_SECURITY_WPA_WPA2 used in WIFI_CONNECT_SECURE from now on.

Don't check against assumed channel if user configures channel number as 0. This is helpful if a driver does not support setting the channel.

Status

READY

Migrations

NO

Steps to test or reproduce

...\mbed-os> mbed test --compile -t ARM -m REALTEK_RTL8195AM --app-config .\TESTS\network\wifi\template_mbed_app.txt -n tests-network-wifi
...\mbed-os> mbedhtrun -f .\BUILD\tests\REALTEK_RTL8195AM\ARM\TESTS\network\wifi\wifi.bin -d X: -p COMY:9600

Veijo Pesonen added 3 commits December 21, 2017 08:29
Call disconnect when connect has been tested. Also instead of waiting
for parameter error in case of missing SSID give missing SSID error
code.
…hannel

It's possible that a device does not support setting the channel to be used.
In case channel is not set by the device lets disable the check.
@VeijoPesonen
Copy link
Contributor Author

@SeppoTakalo and @jarlamsa, please review

@@ -54,12 +54,16 @@ void wifi_scan(void)
if (strcmp(MBED_CONF_APP_WIFI_SECURE_SSID, ssid) == 0) {
secure_found = true;
TEST_ASSERT_EQUAL_INT(NSAPI_SECURITY_WPA2, security);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be changed also to WPA/WPA2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should and I'll change it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security to check against should be defined in the .json which also defines the wlan ap to connect to.

@SeppoTakalo
Copy link
Contributor

Partially dublicate of this: #5723

The disconnect phase is added there.

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 22, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Dec 22, 2017

Build : SUCCESS

Build number : 750
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5743/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@@ -28,6 +28,5 @@ void wifi_connect_nocredentials(void)
WiFiInterface *wifi = get_interface();
nsapi_error_t error;
error = wifi->connect();
wifi->disconnect();
TEST_ASSERT(error == NSAPI_ERROR_PARAMETER);
TEST_ASSERT(error == NSAPI_ERROR_NO_SSID);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also accept the NSAPI_ERROR_PARAMETER

I'm not sure that all drivers currently return this NO_SSID.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add it.

@mbed-ci
Copy link

mbed-ci commented Dec 22, 2017

@mbed-ci
Copy link

mbed-ci commented Dec 22, 2017

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 22, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Dec 22, 2017

Build : SUCCESS

Build number : 759
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5743/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Dec 22, 2017

@mbed-ci
Copy link

mbed-ci commented Dec 28, 2017

@cmonr cmonr merged commit 43af0d7 into ARMmbed:master Dec 28, 2017
@VeijoPesonen VeijoPesonen deleted the greentea-wifi-fixes-disconnect branch January 2, 2018 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants