Commit b006332
committed
[Nexthop] Run_test option to run on reference board
**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]#
```1 parent 9921520 commit b006332
1 file changed
+41
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
284 | 285 | | |
285 | 286 | | |
286 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
287 | 292 | | |
288 | 293 | | |
289 | 294 | | |
| |||
621 | 626 | | |
622 | 627 | | |
623 | 628 | | |
624 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
625 | 654 | | |
626 | 655 | | |
627 | 656 | | |
| |||
662 | 691 | | |
663 | 692 | | |
664 | 693 | | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | 694 | | |
674 | 695 | | |
675 | 696 | | |
| |||
773 | 794 | | |
774 | 795 | | |
775 | 796 | | |
776 | | - | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
777 | 802 | | |
778 | 803 | | |
779 | 804 | | |
| |||
1419 | 1444 | | |
1420 | 1445 | | |
1421 | 1446 | | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
1422 | 1453 | | |
1423 | 1454 | | |
1424 | 1455 | | |
| |||
0 commit comments