start:psh_h
description: psh -h and psh -help
label:others,parallel_cmds
os:Linux
cmd:psh -h
check:rc==0
check:output=~Usage
cmd:psh --help
check:rc==0
check:output=~Usage
end

start:psh_v
description: psh -v
label:others,parallel_cmds
os:Linux
cmd:psh -v
check:output=~Version
check:rc==0
end

start:psh_node_cmd_linux
description: psh CN 'pwd' in linux
label:others,parallel_cmds
os:Linux
cmd:psh $$CN 'pwd'
check:rc==0
check:output=~$$CN
check:output=~/
end

start:psh_node_cmd_aix
description: psh CN 'pwd' in AIX
label:others,parallel_cmds
os:Aix
cmd:psh $$CN 'pwd'
check:rc==0
check:output=~$$CN
check:output=~/root
end

start:psh_l
description: psh -l user CN 'uptime' in linux
label:others,parallel_cmds
os:Linux
cmd:psh -l root $$CN 'uptime'
check:rc==0
check:output=~$$CN
end


start:psh_i
description: psh -i interface CN 'uptime' in linux
label:others,parallel_cmds
os:Linux
cmd:cp /etc/hosts /etc/hostsBK
cmd:cp /etc/hosts /etc/hosts.bak
check:rc==0
cmd:grep $$CN /etc/hosts
cmd:interface=`xdsh $$CN 'ip route' | awk '/default/ { for (i = 1; i <= NF; ++i) if ("dev" == $i) { print $(i + 1) ; exit } }'`; echo "interface=$interface"; sed -i "/$$CN/s/$/ $$CN-$interface/g" '/etc/hostsBK';yes|cp -rf /etc/hostsBK /etc/hosts;psh -i $interface $$CN 'uptime'
check:output=~$$CN
check:rc==0
cmd:grep $$CN /etc/hosts
cmd:yes|cp -rf /etc/hosts.bak /etc/hosts
check:rc==0
cmd:rm -rf /etc/hostsBK /etc/hosts.bak
end

