-
Notifications
You must be signed in to change notification settings - Fork 361
[Nexthop] Run_test option to run on reference board #695
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
base: main
Are you sure you want to change the base?
[Nexthop] Run_test option to run on reference board #695
Conversation
|
Hi @anna-nexthop! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
**Pre-submission checklist**
- [x] I've ran the linters locally and fixed lint errors related to the
files I modified in this PR. You can install the linters by running `pip
install -r requirements-dev.txt && pre-commit install`
- [x] `pre-commit run`
Explicitly control when the config should be modified to set
AUTOLOAD_BOARD_SETTINGS instead of autodetecting montblanc since not all
montblancs are reference boards. As well, modified a copy of the
original config to preserve the original and passed in the copy to the
tests.
Verified the help output:
```
[root@fboss101 fboss]# ./bin/run_test.py --help
Setting fboss environment variables
usage: run_test.py [-h] [--coldboot_only] [--filter FILTER] [--filter_file FILTER_FILE] [--list_tests] [--config CONFIG] [--qsfp-config QSFP_CONFIG] [--sai_replayer_logging SAI_REPLAYER_LOGGING]
[--skip-known-bad-tests SKIP_KNOWN_BAD_TESTS] [--known-bad-tests-file KNOWN_BAD_TESTS_FILE] [--unsupported-tests-file UNSUPPORTED_TESTS_FILE] [--mgmt-if MGMT_IF] [--sai-bin SAI_BIN] [--oss]
[--no-oss] [--fruid-path FRUID_PATH] [--simulator SIMULATOR] [--sai_logging SAI_LOGGING] [--fboss_logging FBOSS_LOGGING] [--setup-for-coldboot SETUP_FOR_COLDBOOT]
[--setup-for-warmboot SETUP_FOR_WARMBOOT] [--run-on-reference-board]
{bcm,sai,qsfp,link,sai_agent} ...
Run tests.
...
--setup-for-warmboot SETUP_FOR_WARMBOOT
run script before warm boot run
--run-on-reference-board
Modify SAI settings to run on reference board instead of real product
```
Ran the script with the option enabled, verified that a copy of the
config was made and the original remained unchanged.
```
[root@fboss101 fboss]# ./bin/run_test.py sai --filter=*HwEmptyTest.CheckInit* --config /opt/fboss/share/hw_test_configs/montblanc.agent.materialized_JSON --run-on-reference-board
Setting fboss environment variables
The --skip-known-bad-tests option is not set, therefore unsupported tests will be run.
HwEmptyTest.
CheckInit
Using a modified config file {self._config_file_modified} for test runs
Replaced AUTOLOAD_BOARD_SETTINGS: 0 by AUTOLOAD_BOARD_SETTINGS: 1 in file /tmp/modified-montblanc.agent.materialized_JSON
...
[root@fboss101 fboss]# grep -l 'AUTOLOAD_BOARD_SETTINGS: 1' /tmp/modified-montblanc.agent.materialized_JSON
/tmp/modified-montblanc.agent.materialized_JSON
[root@fboss101 fboss]# grep -l 'AUTOLOAD_BOARD_SETTINGS: 0' /tmp/modified-montblanc.agent.materialized_JSON
[root@fboss101 fboss]# grep -l 'AUTOLOAD_BOARD_SETTINGS: 1' /opt/fboss/share/hw_test_configs/montblanc.agent.materialized_JSON
[root@fboss101 fboss]# grep -l 'AUTOLOAD_BOARD_SETTINGS: 0' /opt/fboss/share/hw_test_configs/montblanc.agent.materialized_JSON
/opt/fboss/share/hw_test_configs/montblanc.agent.materialized_JSON
[root@fboss101 fboss]#
```
b4c54de to
b006332
Compare
| self._config_file_modified = f"/tmp/modified-{config_filename}" | ||
| shutil.copy2(conf_file, self._config_file_modified) | ||
|
|
||
| print("Using a modified config file {self._config_file_modified} for test runs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| print("Using a modified config file {self._config_file_modified} for test runs") | |
| print(f"Using a modified config file {self._config_file_modified} for test runs") |
| def __init__(self): | ||
| super().__init__() | ||
| self._config_file_modified = None | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove this since you are returning the path in _backup_and_modify_config anyways
|
Thanks for the review, @KevinYakar . I have addressed both your review comments in the latest diff. Please let me know if any other change is needed in this PR. |
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runExplicitly control when the config should be modified to set AUTOLOAD_BOARD_SETTINGS instead of autodetecting montblanc since not all montblancs are reference boards. As well, modified a copy of the original config to preserve the original and passed in the copy to the tests.
Verified the help output:
Ran the script with the option enabled, verified that a copy of the config was made and the original remained unchanged.