2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

Add testcase to setup/clear openbmc simulator

This commit is contained in:
XuWei 2017-05-31 21:48:42 -04:00
parent af5783a843
commit b1d75f8704
3 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#!/bin/bash
flag=$1
mnhn=$2
cnhn=$3
if [ $flag = "-s" ]; then
cnip=`lsdef $cnhn -i bmc -c | awk -F '=' '{print $2}'`
echo $cnip > "/tmp/simulator"
mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'`
chdef $cnhn bmc=$mnip
elif [ $flag = "-c" ]; then
cnip=`cat /tmp/simulator`
chdef $cnhn bmc=$cnip
process=`ps aux | grep "simulator" | grep "python" | awk -F ' ' '{print $2}'`
kill $process
rm -rf "openbmc_simulator"
fi
exit $?

View File

@ -0,0 +1,4 @@
start:clear_openbmc_simulator
cmd:sh /opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -c $$MN $$CN
check:rc==0
end

View File

@ -0,0 +1,8 @@
start:setup_openbmc_simulator
cmd:git clone git@github.com:xuweibj/openbmc_simulator.git
check:rc==0
cmd:/root/openbmc_simulator/simulator &
check:rc==0
cmd:sh /opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -s $$MN $$CN
check:rc==0
end