Skip to content
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

[sdn_tests]: Adding testrunner to pins_ondatra. #12678

Merged
merged 17 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
680d39d
[sdn_tests]: Adding Build support for pins_ondatra
VSuryaprasad-HCL Apr 30, 2024
d6db82f
[sdn_tests]: Adding binding infra to pins_ondatra.
VSuryaprasad-HCL Apr 30, 2024
02209fe
[sdn_tests]: Adding cert generation script and certs folder to pins_o…
VSuryaprasad-HCL Apr 30, 2024
1a702ed
[sdn_tests]: Adding Data Infra to pins_ondatra.
VSuryaprasad-HCL Apr 30, 2024
9fe0193
[sdn_tests]: Adding gnmi testhelper to pins_ondatra.
VSuryaprasad-HCL Apr 30, 2024
cee4711
[sdn_tests]: Adding GNOI testhelper to pins_ondatra.
VSuryaprasad-HCL Apr 30, 2024
02e6ea8
[sdn_tests]: Adding LACP testhelper to pins_ondatra.
VSuryaprasad-HCL Apr 30, 2024
71a6bb8
[sdn_tests]: Adding P4RT testhelper to pins_ondatra.
VSuryaprasad-HCL Apr 30, 2024
c425f07
[sdn_tests]: Adding Platform and port_management testhelper to pins_o…
VSuryaprasad-HCL May 1, 2024
1cda56a
[sdn_tests]: Adding testhelper to pins_ondatra.
VSuryaprasad-HCL May 1, 2024
2a44fcf
[sdn_tests]: Adding Augment testhelper Infra to pins_ondatra.
VSuryaprasad-HCL May 1, 2024
196a1ad
[sdn_tests]: Adding results testhelper to pins_ondatra.
VSuryaprasad-HCL May 1, 2024
bf25cb5
[sdn_tests]: Adding ssh testhelper to pins_ondatra.
VSuryaprasad-HCL May 1, 2024
9d2e155
[sdn_tests]: Adding ondatra bazel tests to pins_ondatra.
VSuryaprasad-HCL May 1, 2024
5f064c6
[sdn_tests]: Adding testrunner to pins_ondatra.
VSuryaprasad-HCL May 1, 2024
664f7f3
Merge branch 'master' into Branch15
VSuryaprasad-HCL May 16, 2024
f4a1690
Merge branch 'master' into Branch15
VSuryaprasad-HCL May 19, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ go_library(
"platform_info.go",
"port_management.go",
"results.go",
"ssh.go",
"ssh.go",
"//infrastructure/testhelper/platform_info:platform_info",
],
data = [
Expand Down
49 changes: 49 additions & 0 deletions sdn_tests/pins_ondatra/testrunner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

test_name=''
push_config_after_test='false'
push_config_before_test='false'
push_config_success='true'

print_usage() {
printf "Use:\n\t'-t tests/ondatra:test_name' to run the test.\n\t'-b' to push the switch config before the test.\n\t'-a' to push the config after the test.\n"
}

while getopts 'abt:' arg; do
case "${arg}" in
t) test_name="${OPTARG}" ;;
a) push_config_after_test='true' ;;
b) push_config_before_test='true' ;;
*) print_usage
exit 1 ;;
esac
done

function push_config() {
bazel test --test_output=streamed tests/ondatra:installation_test --test_strategy=exclusive --cache_test_results=no
if [ $? -ne 0 ]; then
push_config_success='false'
fi
}

# Pushes the config before/after test.
function run_test() {
if [ -z "$test_name" ]; then
print_usage
exit 1
fi

if [ $push_config_before_test = 'true' ]; then
push_config
fi

if [ $push_config_success = 'true' ]; then
bazel test --test_output=streamed "$test_name" --test_strategy=exclusive --cache_test_results=no --test_timeout=10000000
fi

if [ $push_config_after_test = 'true' ]; then
push_config
fi
}

run_test
Loading