Skip to content

Fix for configurable network driver tests #5335

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 4 commits into from
Nov 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
5 changes: 5 additions & 0 deletions tools/test_configs/__init__.py
Original file line number Diff line number Diff line change
@@ -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"))
Expand All @@ -9,6 +10,8 @@
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 {}

Expand All @@ -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
4 changes: 0 additions & 4 deletions tools/test_configs/target_configs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down