From ec2dd1b4b31a3b8d8f1276ec52aab9e69490c0f1 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Tue, 1 Feb 2022 15:10:40 -0800 Subject: [PATCH] regression-test: Improve lf_dataplane_test Use DUT that earlier test logic created, allow specifying testbed name on the cmd line. Add exit code for dpt, but not sure it is correct since currently it fails trying to copy the results locally since my GUI is on localhost and LANforge system is elsewhere. Added TODO to allow this usage. Signed-off-by: Ben Greear --- py-scripts/lf_dataplane_test.py | 8 ++++++++ py-scripts/regression_test.sh | 18 +++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/py-scripts/lf_dataplane_test.py b/py-scripts/lf_dataplane_test.py index 8a8223c7..bc02b603 100755 --- a/py-scripts/lf_dataplane_test.py +++ b/py-scripts/lf_dataplane_test.py @@ -326,6 +326,10 @@ def main(): help="--local_lf_report_dir default '' put where dataplane script run from", default="") + # TODO: Add debug and log-level support, and propagate as needed. + # TODO: Add ability to pull from a machine that is not running the + # GUI, for instance when GUI is running locally against a remote LANforge system. + args = parser.parse_args() # use json config file @@ -418,6 +422,10 @@ def main(): CV_Test.check_influx_kpi(args) + if CV_Test.passes(): + CV_Test.exit_success() + else: + CV_Test.exit_fail() if __name__ == "__main__": main() diff --git a/py-scripts/regression_test.sh b/py-scripts/regression_test.sh index ec246e9e..e6a8dd83 100755 --- a/py-scripts/regression_test.sh +++ b/py-scripts/regression_test.sh @@ -24,8 +24,11 @@ Help() HOMEPATH=$(realpath ~) REPORT_DIR="${HOMEPATH}/html-reports" +TESTBED=UNKNOWN +NOW=$(date +"%Y-%m-%d-%H-%M") +NOW="${NOW/:/-}" -while getopts ":h:s:S:p:w:m:r:R:F:B:u:U:D:H:M:C:e:V:E:" option; do +while getopts ":h:s:S:p:w:m:r:R:F:B:u:U:D:H:M:C:e:V:E:T:" option; do case "${option}" in h) # display Help Help @@ -37,6 +40,9 @@ while getopts ":h:s:S:p:w:m:r:R:F:B:u:U:D:H:M:C:e:V:E:" option; do S) SHORT="yes" ;; + T) + TESTBED=${OPTARG} + ;; p) PASSWD_USED=${OPTARG} ;; @@ -221,13 +227,15 @@ function testgroup_delete_group() { } function create_station_and_dataplane() { - ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR + set -x + ./create_station.py --radio $RADIO_USED --ssid $SSID_USED --passwd $PASSWD_USED --security $SECURITY --debug --mgr $MGR --noclean ./lf_dataplane_test.py --mgr $MGR --lf_user lanforge --lf_password lanforge \ --instance_name dataplane-instance --config_name test_con --upstream $UPSTREAM \ - --dut linksys-8450 --duration 15s --station $RESOURCE.sta0001 \ + --dut regression_dut --duration 15s --station $RESOURCE.sta0001 \ --download_speed 85% --upload_speed 0 \ - --test_rig Testbed-01 --pull_report \ - --local_lf_report_dir ~/html-reports/dataplane_"$NOW" + --test_rig $TESTBED --pull_report \ + --local_lf_report_dir ~/html-reports/dataplane_${NOW} + set +x } function create_dut_and_chamberview() { ./create_chamberview_dut.py --lfmgr $MGR --dut_name regression_dut \