Skip to content
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
65 changes: 65 additions & 0 deletions docs/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This page covers the following topics:
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Testing](#testing)
- [Additional Configuration Options](#additional-configuration-options)
- [Troubleshooting](#troubleshooting)
- [Review the report](#review-the-report)
- [Uninstall](#uninstall)
Expand Down Expand Up @@ -101,6 +102,70 @@ Note: For qualification purposes, you must select all.
12. Once the Waiting for Device notification appears, power on the device under test. A report appears under the Reports icon once the test sequence is complete.
![Reports button](/docs/ui/getstarted--m4si1otdu5d.png)

# Additional Configuration Options

Some configuration options are available but not exposed through the user interface and requires direct access.
Modification of various configuration files is necessary to access these options.

## Override test module timeout at the system level

Testrun attempts to set reasonable timeouts for test modules to prevent overly long test times but sometimes
a device or series of device may require longer than these default values. These can be overridden at
the test module configuration level but is not preferred since these changes will be undone during every
version upgrade. To modify these values:

1. Navigate to the testrun installation directory. By default, this will be at:
`/usr/local/testrun`

2. Open the system.json file and add the following section:
`"test_modules":{}`

3. Add the module name(s) and timeout property into this test_modules section you wish to
set the timeout property for:
```
"test_modules":{
"connection":{
"timeout": 500
}
}
```

Before timeout options:
```
{
"network": {
"device_intf": "ens0",
"internet_intf": "ens1"
},
"log_level": "DEBUG",
"startup_timeout": 60,
"monitor_period": 60,
"max_device_reports": 5,
"org_name": "",
"single_intf": false
}
```

After timeout options:
```
{
"network": {
"device_intf": "ens0",
"internet_intf": "ens1"
},
"log_level": "DEBUG",
"startup_timeout": 60,
"monitor_period": 60,
"max_device_reports": 5,
"org_name": "",
"single_intf": false,
"test_modules":{
"connection":{
"timeout": 500
}
}
```

# Troubleshooting

If you encounter any issues, try the following:
Expand Down
21 changes: 18 additions & 3 deletions framework/python/src/core/docker/test_docker_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ def setup_module(self, module_json):
# Set the defaults
self.network = True
self.total_tests = 0
self.time = DEFAULT_TIMEOUT
self.tests: list = []

if 'timeout' in module_json['config']['docker']:
self.timeout = module_json['config']['docker']['timeout']
self.timeout = self._get_module_timeout(module_json)

# Determine if this module needs network access
if 'network' in module_json['config']:
Expand Down Expand Up @@ -133,3 +131,20 @@ def get_mounts(self):
read_only=True)
]
return mounts

def _get_module_timeout(self, module_json):
timeout = DEFAULT_TIMEOUT
try:
timeout = DEFAULT_TIMEOUT
test_modules = self.get_session().get_config().get('test_modules', {})
test_config = test_modules.get(self.name, {})
sys_timeout = test_config.get('timeout', None)

if sys_timeout is not None:
timeout = sys_timeout
elif 'timeout' in module_json['config']['docker']:
timeout = module_json['config']['docker']['timeout']
except Exception: # pylint: disable=W0718
# Ignore errors, just use default
timeout = DEFAULT_TIMEOUT
return timeout # pylint: disable=W0150
6 changes: 6 additions & 0 deletions framework/python/src/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
API_PORT_KEY = 'api_port'
MAX_DEVICE_REPORTS_KEY = 'max_device_reports'
ORG_NAME_KEY = 'org_name'
TEST_CONFIG_KEY = 'test_modules'
CERTS_PATH = 'local/root_certs'
CONFIG_FILE_PATH = 'local/system.json'
STATUS_TOPIC = 'status'
Expand Down Expand Up @@ -241,6 +242,11 @@ def _load_config(self):
ORG_NAME_KEY
)

if TEST_CONFIG_KEY in config_file_json:
self._config[TEST_CONFIG_KEY] = config_file_json.get(
TEST_CONFIG_KEY
)

def _load_version(self):
version_cmd = util.run_command(
'dpkg-query --showformat=\'${Version}\' --show testrun')
Expand Down