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
3 changes: 2 additions & 1 deletion tests/kvmtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ PYTEST_CLI_COMMON_OPTS="\
-m individual \
-q 1 \
-a False \
-e --disable_loganalyzer"
-e --disable_loganalyzer \
-O"

cd $SONIC_MGMT_DIR/tests
rm -rf logs
Expand Down
14 changes: 12 additions & 2 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function show_help_and_exit()
echo " -m <method> : specify test method group|individual|debug (default group)"
echo " -n <testbed> : specify testbed name (*)"
echo " -o : omit the file logs"
echo " -O : run tests in input order rather than alphabetical order"
echo " -p <path> : specify log path (default: logs)"
echo " -q <n> : test will stop after <n> failures (default: not stop on failure)"
echo " -r : retain individual file log for suceeded tests (default: remove)"
Expand Down Expand Up @@ -79,6 +80,7 @@ function setup_environment()
SKIP_FOLDERS="ptftests acstests saitests scripts"
TESTBED_FILE="${BASE_PATH}/ansible/testbed.csv"
TEST_CASES=""
TEST_INPUT_ORDER="False"
TEST_METHOD='group'
TEST_MAX_FAIL=0

Expand Down Expand Up @@ -107,7 +109,11 @@ function setup_test_options()
done
fi
# Ignore the scripts specified in $SKIP_SCRIPTS
TEST_CASES=$(python -c "print '\n'.join(set('''$all_scripts'''.split()) - set('''$SKIP_SCRIPTS'''.split()))" | sort)
if [[ x"${TEST_INPUT_ORDER}" == x"True" ]]; then
TEST_CASES=$(python -c "print '\n'.join([testcase for testcase in list('''$all_scripts'''.split()) if testcase not in set('''$SKIP_SCRIPTS'''.split())])")
else
TEST_CASES=$(python -c "print '\n'.join(set('''$all_scripts'''.split()) - set('''$SKIP_SCRIPTS'''.split()))" | sort)
fi

PYTEST_COMMON_OPTS="--inventory ${INVENTORY} \
--host-pattern ${DUT_NAME} \
Expand Down Expand Up @@ -179,6 +185,7 @@ function run_debug_tests()
echo "SKIP_SCRIPTS: ${SKIP_SCRIPTS}"
echo "SKIP_FOLDERS: ${SKIP_FOLDERS}"
echo "TEST_CASES: ${TEST_CASES}"
echo "TEST_INPUT_ORDER: ${TEST_INPUT_ORDER}"
echo "TEST_MAX_FAIL: ${TEST_MAX_FAIL}"
echo "TEST_METHOD: ${TEST_METHOD}"
echo "TESTBED_FILE: ${TESTBED_FILE}"
Expand Down Expand Up @@ -250,7 +257,7 @@ function run_individual_tests()

setup_environment

while getopts "h?a:c:d:e:f:i:k:l:m:n:op:q:rs:t:ux" opt; do
while getopts "h?a:c:d:e:f:i:k:l:m:n:oOp:q:rs:t:ux" opt; do
case ${opt} in
h|\? )
show_help_and_exit 0
Expand Down Expand Up @@ -288,6 +295,9 @@ while getopts "h?a:c:d:e:f:i:k:l:m:n:op:q:rs:t:ux" opt; do
o )
OMIT_FILE_LOG="True"
;;
O )
TEST_INPUT_ORDER="True"
;;
p )
LOG_PATH=${OPTARG}
;;
Expand Down