From c300b2db330fe6e6379b91c7788836cd46f495f3 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 6 Sep 2017 09:08:44 -0400 Subject: [PATCH 1/3] modify pping testcase for issue:#3639 --- xCAT-test/autotest/testcase/pping/cases0 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/pping/cases0 b/xCAT-test/autotest/testcase/pping/cases0 index 98f4571a5..0a569ab89 100644 --- a/xCAT-test/autotest/testcase/pping/cases0 +++ b/xCAT-test/autotest/testcase/pping/cases0 @@ -18,5 +18,11 @@ end start:pping_node cmd:pping $$CN check:rc==0 -check:output=~ping +check:output=~ping|noping +end + +start:pping_invalidnode +cmd:pping test +check:rc!=0 +check:output=~Warning: Invalid nodes in noderange:test end From 210d4782e9bcf2cc48ef84fc7ac84f4dcb37d76f Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 7 Sep 2017 09:16:26 -0400 Subject: [PATCH 2/3] modify ppping testcase for issue:#3639 --- xCAT-test/autotest/testcase/ppping/cases0 | 35 ++++++----------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/xCAT-test/autotest/testcase/ppping/cases0 b/xCAT-test/autotest/testcase/ppping/cases0 index 133c6240a..b98e64c7d 100644 --- a/xCAT-test/autotest/testcase/ppping/cases0 +++ b/xCAT-test/autotest/testcase/ppping/cases0 @@ -11,48 +11,34 @@ check:output=~Version end start:ppping_node -cmd:ping -c 3 $$CN > /dev/null 2>&1 -check:rc==0 -cmd:ppping $$CN -check:rc==0 -check:output=~$$CN: pinged all nodes successfully +cmd:ping -c 3 $$CN > /dev/null 2>&1;if [[ $? -eq 1 ]]; then output=`ppping $$CN`;if [[ $? -eq 1 ]]&&[[ $output =~ "noping" ]];then exit 0;else exit 1;fi;else output=`ppping $$CN`; if [[ $? -eq 0 ]]&&[[ $output =~ "pinged all nodes successfully" ]];then exit 0;else exit 1;fi;fi +check:rc==0 end start:ppping_V_node -cmd:ping -c 3 $$CN > /dev/null 2>&1 +cmd:ping -c 3 $$CN > /dev/null 2>&1;if [[ $? -eq 1 ]]; then output=`ppping -V $$CN`;if [[ $? -eq 1 ]]&&[[ $output =~ "$$CN: noping" ]];then exit 0;else exit 1;fi;else output=`ppping -V $$CN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: $$CN: ping" ]];then exit 0;else exit 1;fi;fi check:rc==0 -cmd:ppping -V $$CN -check:rc==0 -check:output=~$$CN: $$CN: ping end start:ppping_q_node -cmd:ping -c 3 $$CN > /dev/null 2>&1 +cmd:ping -c 3 $$CN > /dev/null 2>&1;if [[ $? -eq 1 ]]; then output=`ppping -q $$CN`;if [[ $? -eq 1 ]]&&[[ $output =~ "$$CN: noping" ]];then exit 0;else exit 1;fi;else output=`ppping -q $$CN`; if [[ $? -eq 0 ]]&&[[ $output =~ "" ]];then exit 0;else exit 1;fi;fi check:rc==0 -cmd:ppping -q $$CN -check:rc==0 -check:output=~ end start:ppping_d_node -cmd:ppping -d $$CN +cmd:ping -c 3 $$CN > /dev/null 2>&1;if [[ $? -eq 1 ]]; then output=`ppping -d $$CN`;if [[ $? -eq 1 ]]&&[[ $output =~ "start" ]]&&[[ $output =~ "stop" ]];then exit 0;else exit 1;fi;else output=`ppping -d $$CN`; if [[ $? -eq 0 ]]&&[[ $output =~ "start" ]]&&[[ $output =~ "stop" ]];then exit 0;else exit 1;fi;fi check:rc==0 -check:output=~[start] -check:output=~[stop] end start:ppping_i_node -cmd:ping -c 3 $$CN > /dev/null 2>&1 -check:rc==0 cmd:cp /etc/hosts /etc/hosts.bak check:rc==0 cmd:a=`cat /etc/hosts |grep ' $$CN.'|awk '{print $1}'`;b=`cat /etc/resolv.conf |grep search|awk '{print $2}'`;echo "$a $$CN-eth0.$b $$CN-eth0" >> /etc/hosts check:rc==0 cmd:makedns -n check:rc==0 -cmd:ppping $$CN -i eth0 +cmd:ping -c 3 $$CN > /dev/null 2>&1;if [[ $? -eq 1 ]]; then output=`ppping $$CN -i eth0`;if [[ $? -eq 1 ]]&&[[ $output =~ "$$CN: noping" ]];then exit 0;else exit 1;fi;else output=`ppping $$CN -i eth0`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: pinged all nodes successfully on interface eth0" ]];then exit 0;else exit 1;fi;fi check:rc==0 -check:output=~$$CN: pinged all nodes successfully on interface eth0 cmd:rm -f /etc/hosts check:rc==0 cmd:mv /etc/hosts.bak /etc/hosts @@ -60,14 +46,9 @@ check:rc==0 end start:ppping_nodes -cmd:ping -c 3 $$CN > /dev/null 2>&1 +cmd:rc1=`ping -c 3 $$CN > /dev/null 2>&1`;rc2=`ping -c 3 $$SN > /dev/null 2>&1`;if [[ $rc1 -eq 1 ]]&&[[ $rc2 -eq 1 ]];then output=`ppping $$CN,$$SN`;if [[ $? -eq 1 ]]&&[[ $output =~ "$$CN: noping" ]]&&[[ $output =~ "$$SN: noping" ]];then exit 0;else exit 1;fi;elif [[ $rc1 -eq 0 ]]&&[[ $rc2 -eq 1 ]]; then output=`ppping $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$SN: noping" ]]&&[[ "$$CN: $$SN: noping" ]];then exit 0;else exit 1;fi;elif [[ $rc1 -eq 1 ]]&&[[ $rc2 -eq 0 ]]; then output=`ppping $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: noping" ]]&&[[ "$$SN: $$CN: noping" ]];then exit 0;else exit 1;fi;else output=`ppping $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: pinged all nodes successfully" ]]&&[[ "$$SN: pinged all nodes successfully" ]];then exit 0;else exit 1;fi;fi + check:rc==0 -cmd:ping -c 3 $$SN > /dev/null 2>&1 -check:rc==0 -cmd:ppping $$SN,$$CN -check:rc==0 -check:output=~$$SN: pinged all nodes successfully -check:output=~$$CN: pinged all nodes successfully end start:ppping_V_nodes From b6099e86ef8da2d31f6583ab52bda884735dc638 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 8 Sep 2017 08:10:54 -0400 Subject: [PATCH 3/3] modify ppping testcase for issue:#3639 --- xCAT-test/autotest/testcase/ppping/cases0 | 38 +++++++++++++---------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/xCAT-test/autotest/testcase/ppping/cases0 b/xCAT-test/autotest/testcase/ppping/cases0 index b98e64c7d..b36f9f62f 100644 --- a/xCAT-test/autotest/testcase/ppping/cases0 +++ b/xCAT-test/autotest/testcase/ppping/cases0 @@ -1,36 +1,48 @@ start:ppping_h +description:get ppping help information cmd:ppping -h check:rc==0 check:output=~Usage end start:ppping_v +description:Display verbose output cmd:ppping -v check:rc==0 check:output=~Version end start:ppping_node +description:ppping node +Attribute: $$CN-The operation object of ppping command cmd:ping -c 3 $$CN > /dev/null 2>&1;if [[ $? -eq 1 ]]; then output=`ppping $$CN`;if [[ $? -eq 1 ]]&&[[ $output =~ "noping" ]];then exit 0;else exit 1;fi;else output=`ppping $$CN`; if [[ $? -eq 0 ]]&&[[ $output =~ "pinged all nodes successfully" ]];then exit 0;else exit 1;fi;fi check:rc==0 end start:ppping_V_node +description:Display verbose output of ppping node. +Attribute: $$CN-The operation object of ppping command cmd:ping -c 3 $$CN > /dev/null 2>&1;if [[ $? -eq 1 ]]; then output=`ppping -V $$CN`;if [[ $? -eq 1 ]]&&[[ $output =~ "$$CN: noping" ]];then exit 0;else exit 1;fi;else output=`ppping -V $$CN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: $$CN: ping" ]];then exit 0;else exit 1;fi;fi check:rc==0 end start:ppping_q_node +description:Display minimum output of ppping node. +Attribute: $$CN-The operation object of ppping command cmd:ping -c 3 $$CN > /dev/null 2>&1;if [[ $? -eq 1 ]]; then output=`ppping -q $$CN`;if [[ $? -eq 1 ]]&&[[ $output =~ "$$CN: noping" ]];then exit 0;else exit 1;fi;else output=`ppping -q $$CN`; if [[ $? -eq 0 ]]&&[[ $output =~ "" ]];then exit 0;else exit 1;fi;fi check:rc==0 end start:ppping_d_node +description:Print debug information of ppping node. +Attribute: $$CN-The operation object of ppping command cmd:ping -c 3 $$CN > /dev/null 2>&1;if [[ $? -eq 1 ]]; then output=`ppping -d $$CN`;if [[ $? -eq 1 ]]&&[[ $output =~ "start" ]]&&[[ $output =~ "stop" ]];then exit 0;else exit 1;fi;else output=`ppping -d $$CN`; if [[ $? -eq 0 ]]&&[[ $output =~ "start" ]]&&[[ $output =~ "stop" ]];then exit 0;else exit 1;fi;fi check:rc==0 end start:ppping_i_node +description:A comma separated list of network interface names that should be pinged instead of the interface represented by the nodename/hostname +Attribute: $$CN-The operation object of ppping command cmd:cp /etc/hosts /etc/hosts.bak check:rc==0 cmd:a=`cat /etc/hosts |grep ' $$CN.'|awk '{print $1}'`;b=`cat /etc/resolv.conf |grep search|awk '{print $2}'`;echo "$a $$CN-eth0.$b $$CN-eth0" >> /etc/hosts @@ -46,34 +58,26 @@ check:rc==0 end start:ppping_nodes -cmd:rc1=`ping -c 3 $$CN > /dev/null 2>&1`;rc2=`ping -c 3 $$SN > /dev/null 2>&1`;if [[ $rc1 -eq 1 ]]&&[[ $rc2 -eq 1 ]];then output=`ppping $$CN,$$SN`;if [[ $? -eq 1 ]]&&[[ $output =~ "$$CN: noping" ]]&&[[ $output =~ "$$SN: noping" ]];then exit 0;else exit 1;fi;elif [[ $rc1 -eq 0 ]]&&[[ $rc2 -eq 1 ]]; then output=`ppping $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$SN: noping" ]]&&[[ "$$CN: $$SN: noping" ]];then exit 0;else exit 1;fi;elif [[ $rc1 -eq 1 ]]&&[[ $rc2 -eq 0 ]]; then output=`ppping $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: noping" ]]&&[[ "$$SN: $$CN: noping" ]];then exit 0;else exit 1;fi;else output=`ppping $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: pinged all nodes successfully" ]]&&[[ "$$SN: pinged all nodes successfully" ]];then exit 0;else exit 1;fi;fi - +description:test the connectivity between nodes in the noderange using ping +Attribute: $$CN,$$SN-The operation object of ppping command +cmd:ping -c 3 $$CN > /dev/null 2>&1;rc1=$?;ping -c 3 $$SN > /dev/null 2>&1;rc2=$?;if [[ $rc1 -eq 1 ]]&&[[ $rc2 -eq 1 ]];then output=`ppping $$CN,$$SN`;if [[ $? -eq 1 ]]&&[[ $output =~ "$$CN: noping" ]]&&[[ $output =~ "$$SN: noping" ]];then exit 0;else exit 1;fi;elif [[ $rc1 -eq 0 ]]&&[[ $rc2 -eq 1 ]]; then output=`ppping $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$SN: noping" ]]&&[[ "$$CN: $$SN: noping" ]];then exit 0;else exit 1;fi;elif [[ $rc1 -eq 1 ]]&&[[ $rc2 -eq 0 ]]; then output=`ppping $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: noping" ]]&&[[ "$$SN: $$CN: noping" ]];then exit 0;else exit 1;fi;else output=`ppping $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: pinged all nodes successfully" ]]&&[[ "$$SN: pinged all nodes successfully" ]];then exit 0;else exit 1;fi;fi check:rc==0 end start:ppping_V_nodes -cmd:ping -c 3 $$CN > /dev/null 2>&1 +description:test the connectivity between nodes in the noderange using ping and print verbose output. +Attribute: $$CN,$$SN-The operation object of ppping command +cmd:ping -c 3 $$CN > /dev/null 2>&1;rc1=$?;ping -c 3 $$SN > /dev/null 2>&1;rc2=$?;if [[ $rc1 -eq 1 ]]&&[[ $rc2 -eq 1 ]];then output=`ppping -V $$CN,$$SN`;if [[ $? -eq 1 ]]&&[[ $output =~ "$$CN: noping" ]]&&[[ $output =~ "$$SN: noping" ]];then exit 0;else exit 1;fi;elif [[ $rc1 -eq 0 ]]&&[[ $rc2 -eq 1 ]]; then output=`ppping -V $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$SN: noping" ]]&&[[ $output =~ "$$CN: $$SN: noping" ]]&&[[ $output =~ "$$CN: $$CN: ping" ]];then exit 0;else exit 1;fi;elif [[ $rc1 -eq 1 ]]&&[[ $rc2 -eq 0 ]]; then output=`ppping -V $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: noping" ]]&&[[ $output =~ "$$SN: $$CN: noping" ]];then exit 0;else exit 1;fi;else output=`ppping -V $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$SN: $$CN: ping" ]]&&[[ $output =~ "$$SN: $$SN: ping" ]]&&[[ $output =~ "$$CN: $$SN: ping" ]]&&[[ $output =~ "$$CN: $$CN: ping" ]];then exit 0;else exit 1;fi;fi check:rc==0 -cmd:ping -c 3 $$SN > /dev/null 2>&1 -check:rc==0 -cmd:ppping -V $$SN,$$CN -check:rc==0 -check:output=~$$CN: $$CN: ping -check:output=~$$CN: $$SN: ping -check:output=~$$SN: $$SN: ping -check:output=~$$SN: $$CN: ping end start:ppping_V_s_nodes -cmd:ping -c 3 $$CN > /dev/null 2>&1 +description:test the connectivity between nodes in the noderange using ping and print Ping serially instead of in parallel information. +Attribute: $$CN,$$SN-The operation object of ppping command +cmd:ping -c 3 $$CN > /dev/null 2>&1;rc1=$?;ping -c 3 $$SN > /dev/null 2>&1;rc2=$?;if [[ $rc1 -eq 1 ]]&&[[ $rc2 -eq 1 ]];then output=`ppping -V -s $$CN,$$SN`;if [[ $? -eq 1 ]]&&[[ $output =~ "$$CN: noping" ]]&&[[ $output =~ "$$SN: noping" ]];then exit 0;else exit 1;fi;elif [[ $rc1 -eq 0 ]]&&[[ $rc2 -eq 1 ]]; then output=`ppping -V -s $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$SN: noping" ]]&&[[ $output =~ "$$CN: $$SN: noping" ]]&&[[ $output =~ "$$CN: $$CN: ping" ]];then exit 0;else exit 1;fi;elif [[ $rc1 -eq 1 ]]&&[[ $rc2 -eq 0 ]]; then output=`ppping -V -s $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$CN: noping" ]]&&[[ $output =~ "$$SN: $$CN: noping" ]];then exit 0;else exit 1;fi;else output=`ppping -V -s $$CN,$$SN`; if [[ $? -eq 0 ]]&&[[ $output =~ "$$SN: $$CN: ping" ]]&&[[ $output =~ "$$SN: $$SN: ping" ]]&&[[ $output =~ "$$CN: $$SN: ping" ]]&&[[ $output =~ "$$CN: $$CN: ping" ]];then exit 0;else exit 1;fi;fi check:rc==0 -cmd:ping -c 3 $$SN > /dev/null 2>&1 -check:rc==0 -cmd:ppping -V -s $$SN,$$CN -check:rc==0 -check:output=~$$SN: $$SN: ping*\n$$SN: $$CN: ping*\n$$CN: $$SN: ping*\n$$CN: $$CN: ping end