[run_tests] improve run_tests.sh's usability#1990
Merged
yxieca merged 1 commit intosonic-net:masterfrom Jul 29, 2020
Merged
Conversation
- Skip folder scripts, this folder contains helper scripts. Not intended to hold test cases. - Allow issue -c -e -s multiple times, so user could issue each value (pair) with an option. Signed-off-by: Ying Xie <ying.xie@microsoft.com>
neethajohn
reviewed
Jul 29, 2020
| ;; | ||
| e ) | ||
| EXTRA_PARAMETERS=${OPTARG} | ||
| EXTRA_PARAMETERS="${EXTRA_PARAMETERS} ${OPTARG}" |
Contributor
There was a problem hiding this comment.
How is this consumed in the testcase? How do we differentiate between single arg vs key value pair?
Collaborator
Author
There was a problem hiding this comment.
pytest would handle the difference, the script would just pass the parameter list to pytest.
neethajohn
approved these changes
Jul 29, 2020
daall
reviewed
Jul 29, 2020
daall
approved these changes
Jul 29, 2020
Collaborator
Author
|
This change is more useful for human user than to a repeated scheduled tests. For instance, one is running a test manually and want to check another test also, then he/she can simple add another -c another_test to the command line instead of changing the existing -c original_test to -c "original_test another_test" and having to add the quotes. |
kazinator-arista
pushed a commit
to kazinator-arista/sonic-mgmt
that referenced
this pull request
Mar 4, 2026
Commits: f147d9e - 2021-10-27 : [Mux orch] Handle setting unknown mux state (sonic-net#1984) [Prince Sunny] 4618b2b - 2021-10-28 : Change tunnel orch order (sonic-net#1990) [Prince Sunny] 505d52d - 2021-10-20 : Fix the option missing in kernel config issue (sonic-net#1973) [xumia] 7bf4dfb - 2021-10-18 : SAI_REDIS_SWITCH_ATTR_CONTEXT shouldbe the last attribute. This is what sairedis library expects (sonic-net#1935) [judyjoseph] c58919e - 2021-10-08 : [logfile][202012]: Add option to specify swss rec file name (sonic-net#1946) [judyjoseph]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
Making run_tests.sh more user friendly.
How did you do it?
Signed-off-by: Ying Xie ying.xie@microsoft.com
How did you verify/test it?
yinxi@acs-trusty8:/var/src/sonic-mgmt/tests$ ./run_tests.sh -d str-dx010-acs-1 -n vms3-t1-dx010-1 -i /var/src/sonic-mgmt/ansible/str,/var/src/sonic-mgmt/ansible/veos -u -p /tmp/logs-01 -m debug -c test_a -c test_b -s test_c -s test_d -e param_1 -e "param2 2"
=== Show test settings ===
SCRIPT: ./run_tests.sh
FULL_PATH: /var/src/sonic-mgmt/tests/run_tests.sh
SCRIPT_PATH: /var/src/sonic-mgmt/tests
BASE_PATH: /var/src/sonic-mgmt
ANSIBLE_CONFIG: /var/src/sonic-mgmt/ansible
ANSIBLE_LIBRARY: /var/src/sonic-mgmt/ansible/library/
BYPASS_UTIL: True
CLI_LOG_LEVEL: warning
EXTRA_PARAMETERS: param_1 param2 2
FILE_LOG_LEVEL: debug
INVENTORY: /var/src/sonic-mgmt/ansible/str,/var/src/sonic-mgmt/ansible/veos
LOG_PATH: /tmp/logs-01
OMIT_FILE_LOG: False
RETAIN_SUCCESS_LOG: False
SKIP_SCRIPTS: test_c test_d
SKIP_FOLDERS: ptftests acstests saitests scripts
TEST_CASES: test_a test_b
TEST_METHOD: debug
TESTBED_FILE: /var/src/sonic-mgmt/ansible/testbed.csv
TEST_LOGGING_OPTIONS: --junit-xml=/tmp/logs-01/tr.xml --log-file=/tmp/logs-01/test.log
TEST_TOPOLOGY_OPTIONS:
PRET_LOGGING_OPTIONS: --junit-xml=/tmp/logs-01/pretest.xml --log-file=/tmp/logs-01/pretest.log
POST_LOGGING_OPTIONS: --junit-xml=/tmp/logs-01/posttest.xml --log-file=/tmp/logs-01/posttest.log
UTIL_TOPOLOGY_OPTIONS: --topology util
PYTEST_COMMON_OPTS: --inventory /var/src/sonic-mgmt/ansible/str,/var/src/sonic-mgmt/ansible/veos --host-pattern str-dx010-acs-1 --testbed vms3-t1-dx010-1 --testbed_file /var/src/sonic-mgmt/ansible/testbed.csv --log-cli-level warning --log-file-level debug --allow_recover --showlocals --assert plain --show-capture no -rav --ignore=test_c --ignore=test_d --ignore=ptftests --ignore=acstests --ignore=saitests --ignore=scripts