diff --git a/tests/p_network/network_device_test.sh b/tests/p_network/network_device_test.sh index 0235fea..ef7369c 100755 --- a/tests/p_network/network_device_test.sh +++ b/tests/p_network/network_device_test.sh @@ -3,6 +3,8 @@ t_Log "Running $0 - Check if a least one network device is available." -ifconfig | grep -q eth0 +ifconfig | grep -q ether + +export eth_int=$(ip addr|grep -B 1 "link/ether"|head -n 1|awk '{print $2}'|tr -d ':') t_CheckExitStatus $? diff --git a/tests/p_network/networking_enabled_test.sh b/tests/p_network/networking_enabled_test.sh index 84e54c2..9131395 100755 --- a/tests/p_network/networking_enabled_test.sh +++ b/tests/p_network/networking_enabled_test.sh @@ -3,7 +3,10 @@ t_Log "Running $0 - Check if networking is enabled." -grep -Eqi "NETWORKING=.*yes" /etc/sysconfig/network - - -t_CheckExitStatus $? +if [ "$centos_ver" = "7" ] ; then + t_Log "CentOS $centos_ver -> SKIP" + exit 0 +else + grep -Eqi "NETWORKING=.*yes" /etc/sysconfig/network + t_CheckExitStatus $? +fi diff --git a/tests/p_network/networking_vlan_test.sh b/tests/p_network/networking_vlan_test.sh index c4b2c30..9a6f655 100755 --- a/tests/p_network/networking_vlan_test.sh +++ b/tests/p_network/networking_vlan_test.sh @@ -11,9 +11,12 @@ then fi t_Log 'This is no C5-system, commencing test' -# create VLAN-IF 10 on eth0 -ip link add dev eth0.10 link eth0 type vlan id 10 -ip addr list | grep -q eth0.10 + +export eth_int=$(ip addr|grep -B 1 "link/ether"|head -n 1|awk '{print $2}'|tr -d ':') + +# create VLAN-IF 10 on ethernet device +ip link add dev ${eth_int}.10 link ${eth_int} type vlan id 10 +ip addr list | grep -q ${eth_int}.10 if [ $? == 1 ] then t_Log "VLAN-IF creation failed" @@ -23,29 +26,29 @@ else fi #assign IP address on VLAN-IF -ip address add 172.16.30.1/32 dev eth0.10 +ip address add 172.16.30.1/32 dev ${eth_int}.10 ip addr list | grep -q 172.16.30.1 if [ $? == 1 ] then - t_Log "IP address assignment on eth0.10 failed" + t_Log "IP address assignment on ${eth_int}.10 failed" ret_val=1 else - t_Log "IP address successfully assigned on eth0.10" + t_Log "IP address successfully assigned on ${eth_int}.10" fi #testing address with ping ping -c 4 -q 172.16.30.1 | grep -q '4 received' if [ $? == 1 ] then - t_Log "pinging on eth0.10 failed" + t_Log "pinging on ${eth_int}.10 failed" ret_val=1 else t_Log "local ping on VLAN IF worked" fi -# delete VLAN-IF 10 on eth0 -ip link delete eth0.10 -ip addr list | grep -q eth0.10 +# delete VLAN-IF 10 on ethernet interface +ip link delete ${eth_int}.10 +ip addr list | grep -q ${eth_int}.10 if [ $? == 0 ] then t_Log "Removing VLAN IF failed"