2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-21 05:25:32 +00:00

keep /etc/dhcpd.conf file for makedhcp test case

This commit is contained in:
cxhong
2020-02-18 11:58:29 -05:00
parent 002d52a493
commit 0a82606b55
2 changed files with 9 additions and 9 deletions

View File

@ -2,7 +2,7 @@ start:makedhcp_n
description:Create a new dhcp configuration file with a network statement for each network the dhcp daemon should listen on
os:Linux
label:mn_only,ci_test,dhcp
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then cp -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then cp -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:makedhcp -n
check:rc==0
cmd:cat $(ls /etc/dhcp/dhcpd.conf || ls /etc/dhcpd.conf)
@ -36,7 +36,7 @@ start:makedhcp_n_linux
description:Create a new dhcp configuration file with a network statement for each network the dhcp daemon should listen on
label:others,ci_test
os:Linux
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then cp -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then cp -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:makedhcp -n
check:rc==0
cmd:ls /etc/dhcp/dhcpd.conf || ls /etc/dhcpd.conf
@ -44,7 +44,7 @@ check:rc==0
cmd:ps -e | grep dhcpd
check:rc==0
check:output=~dhcpd
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf.bak /etc/dhcp/dhcpd.conf ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf.bak /etc/dhcpd.conf; fi
end
start:makedhcp_a_linux
@ -55,7 +55,7 @@ cmd:mkdef -t node -o testnode1 groups=compute mac=11:22:33:55:66:88 arch=ppc64
cmd:chdef -t node -o testnode1 netboot=yaboot tftpserver=192.16.10.0 nfsserver=192.16.10.0 monserver=192.16.10.0 xcatmaster=192.16.10.0 installnic="mac" primarynic="mac"
cmd:lsdef -l testnode1 -z | tee /tmp/CN.stanza
cmd:chdef -t node -o testnode1 mac=11:22:33:44:55:66
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then cp -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then cp -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:makedhcp -n
cmd:makedhcp -a
check:rc==0
@ -64,7 +64,7 @@ check:output=~testnode1
check:output=~11:22:33:44:55:66
cmd:cat /tmp/CN.stanza | chdef -z
cmd:rmdef testnode1
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf.bak /etc/dhcp/dhcpd.conf ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf.bak /etc/dhcpd.conf; fi
end
start:makedhcp_a_linux_check_invalid_mac
@ -86,7 +86,7 @@ label:mn_only,dhcp
cmd:lsdef -t node -l -z > /tmp/all.nodes
cmd:mkdef -t node -o testnode1 groups=compute mac=11:22:33:55:66:88 arch=ppc64
cmd:mkdef -t node -o testnode2 groups=compute mac=11:22:33:55:66:99 arch=ppc64
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then cp -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then cp -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:makedhcp -n
cmd:makedhcp -a
check:rc==0
@ -110,7 +110,7 @@ os:Linux
label:mn_only,dhcp
cmd:mkdef -t node -o testnode1 groups=compute mac=11:22:33:55:66:88 arch=ppc64
cmd:chdef -t node -o testnode1 netboot=yaboot tftpserver=192.16.10.0 nfsserver=192.16.10.0 monserver=192.16.10.0 xcatmaster=192.16.10.0 installnic="mac" primarynic="mac"
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then mv -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:if [ -f "/etc/dhcp/dhcpd.conf" ];then cp -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak ; elif [ -f "/etc/dhcpd.conf" ]; then cp -f /etc/dhcpd.conf /etc/dhcpd.conf.bak; fi
cmd:lsdef -l testnode1 -z > /tmp/CN.stanza
cmd:chdef -t node -o testnode1 mac=11:22:33:44:55:66
cmd:makedhcp -n

View File

@ -514,7 +514,7 @@ elif [ "$1" = "-s" ];then
str_inst_gateway=`ip ro ls|grep default|awk '{print $3}'|head -1`
fi
fi
elif [ -f "/etc/SuSE-release" ];then
elif [ "$str_os_type" = "sles" ];then
str_lease_file="/var/lib/dhcpcd/dhcpcd-"$str_inst_nic".info"
if [ -e "$str_lease_file" ];then
str_inst_ip=`grep IPADDR $str_lease_file | tail -n 1 | awk -F'=' '{print $2}' | sed "s/'//g"`
@ -623,7 +623,7 @@ elif [ "$1" = "-s" ];then
hostname $NODE
echo $NODE > /etc/hostname
elif [ -f "/etc/SuSE-release" ];then
elif [ "$str_os_type" = "sles" ];then
str_conf_file="/etc/sysconfig/network/ifcfg-${str_inst_nic}"
echo "DEVICE=${str_inst_nic}" > $str_conf_file
echo "BOOTPROTO=static" >> $str_conf_file