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:
parent
af5783a843
commit
b1d75f8704
19
xCAT-test/autotest/testcase/simulator/change_ip.sh
Normal file
19
xCAT-test/autotest/testcase/simulator/change_ip.sh
Normal 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 $?
|
4
xCAT-test/autotest/testcase/simulator/clear_simulator
Normal file
4
xCAT-test/autotest/testcase/simulator/clear_simulator
Normal 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
|
8
xCAT-test/autotest/testcase/simulator/setup_simulator
Normal file
8
xCAT-test/autotest/testcase/simulator/setup_simulator
Normal 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
|
Loading…
x
Reference in New Issue
Block a user