From 586a62a87b705e6886ef2aa23c84532e5c4a446d Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Wed, 31 Jan 2018 11:55:43 +0200 Subject: [PATCH] Adjust test configurations for EMAC Make ETHERNET configuration the default if DEVICE_EMAC is present, instead of if FEATURE_LWIP is present. This limits it to targets which have been ported to the new EMAC API. Add LWIP feature to JSON config, as in principle the targets shouldn't be adding it themselves. Opens scope to having Nanostack-based tests. Disable tests for the Realtek and Wifi drivers that aren't ported yet. --- tools/test_configs/EthernetInterface.json | 6 ++++++ .../HeapBlockDeviceAndEthernetInterface.json | 6 ++++++ tools/test_configs/OdinInterface.json | 10 ++++++++-- tools/test_configs/Odin_EthernetInterface.json | 7 ++++--- tools/test_configs/RealtekInterface.json | 10 ++++++++-- tools/test_configs/__init__.py | 4 ++-- 6 files changed, 34 insertions(+), 9 deletions(-) diff --git a/tools/test_configs/EthernetInterface.json b/tools/test_configs/EthernetInterface.json index 517474721a..b758c33fb0 100644 --- a/tools/test_configs/EthernetInterface.json +++ b/tools/test_configs/EthernetInterface.json @@ -23,5 +23,11 @@ "help" : "Some servers send a prefix before echoed message", "value" : "\"u-blox AG TCP/UDP test service\\n\"" } + }, + "target_overrides": { + "*": { + "target.features_add": ["LWIP"], + "nsapi.default-stack": "LWIP" + } } } diff --git a/tools/test_configs/HeapBlockDeviceAndEthernetInterface.json b/tools/test_configs/HeapBlockDeviceAndEthernetInterface.json index 93b1b1ce00..feedcae388 100644 --- a/tools/test_configs/HeapBlockDeviceAndEthernetInterface.json +++ b/tools/test_configs/HeapBlockDeviceAndEthernetInterface.json @@ -28,5 +28,11 @@ "macro_name": "MBED_TEST_SIM_BLOCKDEVICE", "value": "HeapBlockDevice" } + }, + "target_overrides": { + "*": { + "target.features_add": ["LWIP"], + "nsapi.default-stack": "LWIP" + } } } diff --git a/tools/test_configs/OdinInterface.json b/tools/test_configs/OdinInterface.json index 75e7931ccb..9b2358a550 100644 --- a/tools/test_configs/OdinInterface.json +++ b/tools/test_configs/OdinInterface.json @@ -8,8 +8,8 @@ "value" : "new OdinWiFiInterface()" }, "connect-statement" : { - "help" : "Must use 'net' variable name", - "value" : "net->wifiInterface()->connect(WIFI_SSID, WIFI_PASSWORD)" + "help" : "Disabled until EMAC updated", + "value" : null }, "echo-server-addr" : { "help" : "IP address of echo server", @@ -28,5 +28,11 @@ "macro_name": "MBED_TEST_SIM_BLOCKDEVICE", "value": "HeapBlockDevice" } + }, + "target_overrides": { + "*": { + "target.features_add": ["LWIP"], + "nsapi.default-stack": "LWIP" + } } } diff --git a/tools/test_configs/Odin_EthernetInterface.json b/tools/test_configs/Odin_EthernetInterface.json index 7eec91001d..feedcae388 100644 --- a/tools/test_configs/Odin_EthernetInterface.json +++ b/tools/test_configs/Odin_EthernetInterface.json @@ -29,9 +29,10 @@ "value": "HeapBlockDevice" } }, - "target_overrides": { - "UBLOX_EVK_ODIN_W2": { - "target.device_has_remove": ["EMAC"] + "target_overrides": { + "*": { + "target.features_add": ["LWIP"], + "nsapi.default-stack": "LWIP" } } } diff --git a/tools/test_configs/RealtekInterface.json b/tools/test_configs/RealtekInterface.json index 063179270e..ee016d2e26 100644 --- a/tools/test_configs/RealtekInterface.json +++ b/tools/test_configs/RealtekInterface.json @@ -8,8 +8,8 @@ "value" : "new RTWInterface()" }, "connect-statement" : { - "help" : "Must use 'net' variable name, replace WIFI_SSID, WIFI_PASSWORD, WIFI_SECURITY, WIFI_CHANNEL with your WiFi settings", - "value" : "net->wifiInterface()->connect(WIFI_SSID, WIFI_PASSWORD, WIFI_SECURITY, WIFI_CHANNEL)" + "help" : "Disabled until EMAC updated", + "value" : null }, "echo-server-addr" : { "help" : "IP address of echo server", @@ -28,5 +28,11 @@ "macro_name": "MBED_TEST_SIM_BLOCKDEVICE", "value": "HeapBlockDevice" } + }, + "target_overrides": { + "*": { + "target.features_add": ["LWIP"], + "nsapi.default-stack": "LWIP" + } } } diff --git a/tools/test_configs/__init__.py b/tools/test_configs/__init__.py index 4f884465e7..e397374339 100644 --- a/tools/test_configs/__init__.py +++ b/tools/test_configs/__init__.py @@ -11,7 +11,7 @@ TARGET_CONFIGS = json_file_to_dict(join(CONFIG_DIR, "target_configs.json")) def get_valid_configs(target_name): if target_name in TARGET_CONFIGS: target_config = TARGET_CONFIGS[target_name] - elif (target_name in TARGET_MAP and 'LWIP' in TARGET_MAP[target_name].features): + elif (target_name in TARGET_MAP and 'EMAC' in TARGET_MAP[target_name].device_has): target_config = { "default_test_configuration": "ETHERNET", "test_configurations": ["ETHERNET"] } else: return {} @@ -37,7 +37,7 @@ def get_default_config(source_dir, target_name): return join(CONFIG_DIR, CONFIG_MAP[config_name]) elif Config.find_app_config(source_dir): return None - elif (target_name in TARGET_MAP and 'LWIP' in TARGET_MAP[target_name].features): + elif (target_name in TARGET_MAP and 'EMAC' in TARGET_MAP[target_name].device_has): return join(CONFIG_DIR, CONFIG_MAP["ETHERNET"]) else: return None