Skip to content

Update greentea tests to use default interface #7812

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 8 commits into from
Aug 25, 2018
Merged

Update greentea tests to use default interface #7812

merged 8 commits into from
Aug 25, 2018

Conversation

mikaleppanen
Copy link

Description

Updated greentea tests to use default interface: NetworkInterface::get_default_instance()

Created one configuration .json file for boards with internal wifi (HeapBlockDeviceAndWifiInterface.json). Removed dedicated Odin, Wiced and Realtek wifi configuration files. Removed Odin ethernet configuration file and replaced that with general ethernet configuration.

Updated UDP socket, TCP socket, DNS, Wifi and Emac tests to use default instance.

Tested with K64F, K64F + ESP8266, Realtek RTL8195AM, UBLOX EVK ODIN W2, NUCLEO F401RE + X-NUCLEO-IDW.

Pull request type

[ ] Fix
[X] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change

@mikaleppanen
Copy link
Author

@SeppoTakalo @kjbracey-arm Please review.

@mikaleppanen
Copy link
Author

Fixed travis errors in 0112b5a3735e0576b0d016b132b589e07374e705

@jeromecoutant
Copy link
Collaborator

Hi

I have the impression that in json file,
"network-configuration-available" is a duplication for "target.network-default-interface-type" ?

When type is null, configuration-available is false,
When type is not null, configuration-available is true.

@SeppoTakalo
Copy link
Contributor

@jeromecoutant Good catch, actually you are right.

@mikaleppanen Please check, whether the "target.default-network-interface" satisfies us, so we would not need any more config values.

Default is null so it being set is clear indication that there is a network available.
https://github.com/ARMmbed/mbed-os/blob/master/targets/targets.json#L22

@cmonr cmonr requested review from kjbracey and a team August 17, 2018 16:03
@mikaleppanen
Copy link
Author

@jeromecoutant @SeppoTakalo I think I may have chosen a bad name for that macro, but what it intends to do is to be a general config option that indicates that greentea test configuration is set properly when compiling the build (e.g. by setting mbed test ... --test-config HEAPBLOCKDEVICE_AND_WIFI or using --app-config filename or automatically for ethernet targets).

If that would be removed, then there would need to be some other check for greentea .json configuration. E.g. UDP/TCP tests should check whether echo-server-addr is set and not to compile if not. And wifi and emac tests have their own fields in .json that must be present.

Intend was to define some general define which all tests could use.

@SeppoTakalo
Copy link
Contributor

I see the point.

However, would it be hard to actually check build time that all macros are provided in the compile time.
Basically https://github.com/ARMmbed/mbed-os/blob/master/features/netsocket/NetworkInterfaceDefaults.cpp#L69..L133 this list all the requirements

Seems that it is basically like this:

#define ETHERNET 1
#define WIFI 2
#define MESH 3
#define CELLULAR 4
#if !MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE \
    || (MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == WIFI && !MBED_CONF_NSAPI_DEFAULT_WIFI_SSID)
#error [NOT_SUPPORTED] No network configuration found for this target.
#endif

So only WiFi require mandatory SSID parameter. Rest have defaults.

@mikaleppanen
Copy link
Author

Yes, it would work for default interface related configuration options.

That combined with the check to MBED_CONF_APP_ECHO_SERVER_ADDR on tests needing the echo server (and other checks for tests needing other parameters like EMAC or detailed WIFI settings) would verify that both interface and the test options are configured correctly. I can change the configurations in this way.

@mikaleppanen
Copy link
Author

Removed the "network-configuration-available" configuration and added checks to default interface and echo server address. Please review again.

Copy link
Contributor

@jamesbeyond jamesbeyond left a comment

Choose a reason for hiding this comment

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

Looks good

@cmonr cmonr added the risk: G label Aug 23, 2018
@mikaleppanen
Copy link
Author

@kjbracey-arm Please review

@0xc0170 0xc0170 changed the title Updated greentea tests to use default interface Update greentea tests to use default interface Aug 23, 2018
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 24, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Aug 24, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Aug 24, 2018

@mbed-ci
Copy link

mbed-ci commented Aug 24, 2018

@cmonr cmonr merged commit 5ffcc01 into ARMmbed:master Aug 25, 2018
@cmonr cmonr removed the risk: G label Aug 25, 2018
@mikaleppanen mikaleppanen deleted the greentea_def_interf branch August 27, 2018 08:27
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.

8 participants