-
Notifications
You must be signed in to change notification settings - Fork 3k
Cypress: Initial commit of SoftAP host tests. #12125
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
92c6e00
Initial commit of SoftAP host tests
82eda78
Merge branch 'kyle-softap-test' into 'pr-dev/softap-test'
cydriftcloud 6f4e884
Update template argument names to not collide with Arduino names
cy-opm a1e5c6a
Merge branch 'master' into kyle-bsp-test
yarbcy f141cbc
Merge branch 'master' into kyle-bsp-test
yarbcy b100759
Merge commit '823d50d6' into kyle-bsp-test
yarbcy 9f98a06
MR is pending:
cd02017
Merge branch 'master' into kyle-bsp-test
yarbcy 6eff658
Merge commit 'a79b1b3' into kyle-bsp-test
yarbcy 0b237e1
Merge branch 'master' into kyle-bsp-test
yarbcy 673eeb3
Merge branch 'master' into pr-dev/softap-test
d728701
Merge tag 'cy-bsp-acceptance' into pr-dev/softap-test
yarbcy d6ca071
Merge branch 'master' into kyle-bsp-test
yarbcy bd0a264
Merge branch 'kyle-bsp-test' into pr-dev/softap-test
yarbcy fa9f777
Cypress: Initial commit of SoftAP host tests.
yarbcy d62f10c
Fix mbed astyle
yarbcy f9dd2cd
Fix mbed astyle
yarbcy 8229f53
Addressed comments from ARM PR 12125
yarbcy f58f5c2
Merge branch 'master' into pr/add-new-tests-softap
yarbcy a1f3d57
Merge from kyle-bsp-test
yarbcy 983f32c
Fix folders structure for SoftAP tests
yarbcy cee56b7
Merge from softap-test br
yarbcy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright (c) 2017-2019, ARM Limited, All Rights Reserved | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#if !defined(MBED_CONF_APP_SOFTAP_SSID) || \ | ||
!defined(MBED_CONF_APP_SOFTAP_CHANNEL) || \ | ||
!defined(MBED_CONF_APP_SOFTAP_PASSWORD) | ||
|
||
#error [NOT_SUPPORTED] Requires parameters from mbed_app.json | ||
#endif | ||
|
||
#define SOFTAP 1 | ||
|
||
#if MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE != SOFTAP | ||
|
||
#error [NOT_SUPPORTED] SoftAP testing need to be enabled | ||
#endif | ||
|
||
#if !defined(TARGET_PSOC6) | ||
#error [NOT_SUPPORTED] Wifi tests are not valid for the target | ||
#endif | ||
|
||
#define SOFTAP_IP_ADDRESS "192.168.10.1" | ||
#define NETMASK "255.255.255.0" | ||
#define GATEWAY "192.168.10.1" | ||
|
||
#include "greentea-client/test_env.h" | ||
#include "unity.h" | ||
#include "utest.h" | ||
|
||
#include "WhdSoftAPInterface.h" | ||
|
||
using namespace utest::v1; | ||
|
||
static char _key[256] = { 0 }; | ||
static char _value[128] = { 0 }; | ||
|
||
void host_os_type_verification() | ||
{ | ||
greentea_send_kv("get_os_type", "host"); | ||
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value)); | ||
TEST_ASSERT_EQUAL_STRING("Linux", _value); | ||
} | ||
|
||
void softap_test() | ||
{ | ||
WhdSoftAPInterface *softap = WhdSoftAPInterface::get_default_instance(); | ||
TEST_ASSERT_TRUE(softap != NULL); | ||
|
||
softap->set_network(SOFTAP_IP_ADDRESS, NETMASK, GATEWAY); | ||
int ret = softap->start(MBED_CONF_APP_SOFTAP_SSID, MBED_CONF_APP_SOFTAP_PASSWORD, NSAPI_SECURITY_WPA_WPA2, | ||
MBED_CONF_APP_SOFTAP_CHANNEL); | ||
TEST_ASSERT_EQUAL_INT(0, ret); | ||
greentea_send_kv("softap", "up"); | ||
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value)); | ||
TEST_ASSERT_EQUAL_STRING("passed", _key); | ||
} | ||
|
||
utest::v1::status_t greentea_test_setup(const size_t number_of_cases) | ||
{ | ||
// here, we specify the timeout (150) and the host runner (the name of our Python file) | ||
GREENTEA_SETUP(150, "softap_basic"); | ||
return greentea_test_setup_handler(number_of_cases); | ||
} | ||
|
||
Case cases[] = { | ||
Case("Host OS Type Verification", host_os_type_verification), | ||
Case("SoftAP test", softap_test) | ||
}; | ||
|
||
Specification specification(greentea_test_setup, cases, greentea_test_teardown_handler); | ||
|
||
int main() | ||
{ | ||
return Harness::run(specification); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see this test requires
softap_basic
host test but seems this python script is not part of this PR