From 398e63f1809c5de8cf3c17841d9f9a417282fa9c Mon Sep 17 00:00:00 2001 From: huweihua Date: Fri, 21 Mar 2014 02:08:10 -0400 Subject: [PATCH] add testcase for pscp --- xCAT-test/autotest/testcase/pscp/cases0 | 84 +++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 xCAT-test/autotest/testcase/pscp/cases0 diff --git a/xCAT-test/autotest/testcase/pscp/cases0 b/xCAT-test/autotest/testcase/pscp/cases0 new file mode 100644 index 000000000..2d1e02b1a --- /dev/null +++ b/xCAT-test/autotest/testcase/pscp/cases0 @@ -0,0 +1,84 @@ +start:pscp_h +cmd:pscp -h +check:rc==0 +check:output=~Usage +end + +start:pscp_v +cmd:pscp -v +check:rc==0 +check:output=~Version +end + +#copy single file +start:pscp_node +cmd:echo "test" > /tmp/pscp.tmp +check:rc==0 +cmd:pscp /tmp/pscp.tmp $$CN:/tmp/ +check:rc==0 +check:$$CN: done +cmd:xdsh $$CN "ls -l /tmp |grep pscp.tmp" +check:rc==0 +check:output=~pscp.tmp +cmd:xdsh $$CN "cat /tmp/pscp.tmp" +check:rc==0 +check:output=~test +cmd:xdsh $$CN "rm -f /tmp/pscp.tmp" +check:rc==0 +cmd:rm -f /tmp/pscp.tmp +check:rc==0 +end + +#copy a directory +start:pscp_r_node +cmd: mkdir -p /tmp/pscp +check:rc==0 +cmd:echo "test" > /tmp/pscp/pscp.tmp +check:rc==0 +cmd:pscp -r /tmp/pscp $$CN:/tmp/ +check:rc==0 +check:$$CN: done +cmd:xdsh $$CN "ls -l /tmp |grep pscp" +check:rc==0 +check:output=~pscp +cmd:xdsh $$CN "ls -l /tmp/pscp |grep pscp.tmp" +check:rc==0 +check:output=~pscp.tmp +cmd:xdsh $$CN "cat /tmp/pscp/pscp.tmp" +check:rc==0 +check:output=~test +cmd:xdsh $$CN "rm -rf /tmp/pscp" +check:rc==0 +cmd:rm -rf /tmp/pscp +check:rc==0 +end + + +start:pscp_i_node +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:echo "pscp" > /tmp/pscp.tmp +check:rc==0 +cmd:pscp -i eth0 /tmp/pscp.tmp $$CN:/tmp +check:rc==0 +check:output=~$$CN-eth0: done +cmd:xdsh $$CN "ls -l /tmp |grep pscp.tmp" +check:rc==0 +check:output=~pscp.tmp +cmd:xdsh $$CN "cat /tmp/pscp.tmp" +check:rc==0 +check:output=~pscp +cmd:xdsh $$CN "rm -rf /tmp/pscp.tmp" +check:rc==0 +cmd:rm -rf /tmp/pscp.tmp +check:rc==0 +cmd:rm -f /etc/hosts +check:rc==0 +cmd:mv /etc/hosts.bak /etc/hosts +check:rc==0 +end +