From eba3e1f1f192361a3d42acdd7371e1c53091d39a Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Fri, 17 Nov 2017 14:44:34 +0800 Subject: [PATCH] * Minor enhance on xcatperftest to put all logs into one file * Fix a bug in simulatorctl.sh, and it cause the script cannot be found --- xCAT-test/autotest/testcase/performance/case0 | 6 +++--- xCAT-test/autotest/testcase/performance/simulatorctl.sh | 6 +++--- xCAT-test/bin/xcatperftest | 6 +++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/performance/case0 b/xCAT-test/autotest/testcase/performance/case0 index 57e7f449d..58d9299b5 100644 --- a/xCAT-test/autotest/testcase/performance/case0 +++ b/xCAT-test/autotest/testcase/performance/case0 @@ -58,7 +58,7 @@ cmd:if [[ -f /var/lib/dhcp/db/dhcpd.leases ]]; then cat /var/lib/dhcp/db/dhcpd.l #After starting installation, began run fake nodes testing on MN cmd:which yum &>/dev/null && yum install -y bridge-utils || apt install -y bridge-utils -cmd:FAKE_NETWORK_PRO=173.18 FAKE_NETWORK_BMC=192.169 xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst +cmd:FAKE_NETWORK_PRO=173.18 FAKE_NETWORK_BMC=192.169 PERF_RPT_FILE=perfreport-5000.log.daily xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst check:rc==0 cmd:PERF_CREATE_ONLY=y FAKE_NETWORK_PRO=173.18 FAKE_NETWORK_BMC=192.169 xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst @@ -95,7 +95,7 @@ cmd:ping 192.169.251.252 -c 3 check:rc==0 # Testing for HW remote control CLIs -cmd:PERF_NOCREATE=1 xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/testcase/performance/hwcmd.lst +cmd:PERF_NOCREATE=1 PERF_RPT_FILE=perfreport-5000.log.daily xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/testcase/performance/hwcmd.lst check:rc==0 cmd:xdsh $$SN PERF_SIM_NIC=$$SECONDNIC PERF_SIM_ADDR=192.169.251.252 bash /tmp/perf/simulatorctl.sh clean openbmc check:rc==0 @@ -125,7 +125,7 @@ cmd:ping 173.18.251.252 -c 3 check:rc==0 # Testing for updatenode, xdsh, nodestat, pping, etc -cmd:PERF_NOCREATE=1 xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/testcase/performance/nodecmd.lst +cmd:PERF_NOCREATE=1 PERF_RPT_FILE=perfreport-5000.log.daily xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/testcase/performance/nodecmd.lst check:rc==0 cmd:xdsh $$CN,$$SN PERF_SIM_NIC=$$SECONDNIC bash /tmp/perf/simulatorctl.sh clean docker diff --git a/xCAT-test/autotest/testcase/performance/simulatorctl.sh b/xCAT-test/autotest/testcase/performance/simulatorctl.sh index 829652e63..764536862 100644 --- a/xCAT-test/autotest/testcase/performance/simulatorctl.sh +++ b/xCAT-test/autotest/testcase/performance/simulatorctl.sh @@ -84,7 +84,7 @@ setup_docker() run_docker() { echo "Run docker simulator for node range..." - script=$(ls -1t {$PERF_SIM_TESTING_CWD, $PERF_SIM_RESULT_DIR}/perf-docker-create.sh 2>/dev/null | head -n1) + script=$(ls -1 $PERF_SIM_TESTING_CWD/perf-docker-create.sh || ls -1 $PERF_SIM_RESULT_DIR}/perf-docker-create.sh) if [ ! "x" = "x$script" ]; then sh -x $script return @@ -128,7 +128,7 @@ setup_openbmc() run_openbmc() { echo "Run openbmc simulator for node range..." - script=$(ls -1t {$PERF_SIM_TESTING_CWD, $PERF_SIM_RESULT_DIR}/perf-openbmc-create.sh 2>/dev/null | head -n1) + script=$(ls -1 $PERF_SIM_TESTING_CWD/perf-openbmc-create.sh || ls -1 $PERF_SIM_RESULT_DIR}/perf-openbmc-create.sh) if [ ! "x" = "x$script" ]; then sh $script setup return @@ -147,7 +147,7 @@ clean_openbmc() echo "Cleanup openbmc simulator for node range..." - script=$(ls -1t {$PERF_SIM_TESTING_CWD, $PERF_SIM_RESULT_DIR}/perf-openbmc-create.sh 2>/dev/null | head -n1) + script=$(ls -1 $PERF_SIM_TESTING_CWD/perf-openbmc-create.sh || ls -1 $PERF_SIM_RESULT_DIR}/perf-openbmc-create.sh) if [ ! "x" = "x$script" ]; then sh $script clean ip addr del $PERF_SIM_ADDR/$prefix dev $PERF_SIM_NIC #label $PERF_SIM_NIC:100 diff --git a/xCAT-test/bin/xcatperftest b/xCAT-test/bin/xcatperftest index 64b73c7d0..547291fd8 100755 --- a/xCAT-test/bin/xcatperftest +++ b/xCAT-test/bin/xcatperftest @@ -172,9 +172,13 @@ if [ -z $PERFORMANCE_DIR ]; then PERFORMANCE_DIR=$XCATROOT/share/xcat/tools/autotest/result fi PERFORMANCE_NODE_TMPL=$PERFORMANCE_DIR/perf-node.tmpl -PERFORMANCE_REPORT=$PERFORMANCE_DIR/perfreport-$FAKE_NODE_TOTAL.log.$MYSUFFIX PERFORMANCE_STANZ=$PERFORMANCE_DIR/perfstanz-$FAKE_NODE_TOTAL.$MYSUFFIX +if [ -z $PERF_RPT_FILE ]; then + PERF_RPT_FILE=perfreport-$FAKE_NODE_TOTAL.log.$MYSUFFIX +fi +PERFORMANCE_REPORT=$PERFORMANCE_DIR/$PERF_RPT_FILE + # Get a random MAC address genMAC() {