Merge pull request #5335 from yennster/test-configs-update

Fix for configurable network driver tests
pull/5518/head
Jimmy Brisson 2017-11-16 14:13:01 -06:00 committed by GitHub
commit 6720bfdbdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -2003,7 +2003,7 @@ def get_test_config(config_name, target_name):
"""Finds the path to a test configuration file
config_name: path to a custom configuration file OR mbed OS interface "ethernet, wifi_odin, etc"
target_name: name of target to determing if mbed OS interface given is valid
returns path to config, boolean of whether it is a module or mbed OS interface
returns path to config, will return None if no valid config is found
"""
# If they passed in a full path
if exists(config_name):

View File

@ -1,6 +1,7 @@
from os.path import dirname, abspath, join
from tools.utils import json_file_to_dict
from tools.targets import TARGET_MAP
CONFIG_DIR = dirname(abspath(__file__))
CONFIG_MAP = json_file_to_dict(join(CONFIG_DIR, "config_paths.json"))
@ -9,6 +10,8 @@ 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):
target_config = { "default_test_configuration": "ETHERNET", "test_configurations": ["ETHERNET"] }
else:
return {}
@ -31,5 +34,7 @@ def get_default_config(target_name):
if config_name == "NONE":
return None
return join(CONFIG_DIR, CONFIG_MAP[config_name])
elif (target_name in TARGET_MAP and 'LWIP' in TARGET_MAP[target_name].features):
return join(CONFIG_DIR, CONFIG_MAP["ETHERNET"])
else:
return None

View File

@ -3,10 +3,6 @@
"default_test_configuration": "NONE",
"test_configurations": ["ODIN_WIFI", "ODIN_ETHERNET"]
},
"K64F": {
"default_test_configuration": "ETHERNET",
"test_configurations": ["ETHERNET"]
},
"REALTEK_RTL8195AM": {
"default_test_configuration": "NONE",
"test_configurations": ["REALTEK_WIFI"]