diff --git a/centos_ci_build b/centos_ci_build index 3d81147..8d82e41 100755 --- a/centos_ci_build +++ b/centos_ci_build @@ -3,4 +3,4 @@ yum -y update uname -a -SKIP_QA_HARNESS=1 ./runtests.sh +SKIP_QA_HARNESS=1 ./runtests.sh p_vconfig diff --git a/tests/p_vconfig/0_install_vconfig.sh b/tests/p_vconfig/0_install_vconfig.sh index 82ffc73..659fe5c 100755 --- a/tests/p_vconfig/0_install_vconfig.sh +++ b/tests/p_vconfig/0_install_vconfig.sh @@ -1,6 +1,10 @@ #!/bin/bash -# Author: Christoph Galuschka - -# Install vconfig -t_InstallPackage vconfig +# Author: Christoph Galuschka +if [ $centos_ver = 5 ] || [ $centos_ver = 6 ] +then + # Install vconfig + t_InstallPackage vconfig +else + t_Log 'This is only supported on C5 and C6, skipping' +fi diff --git a/tests/p_vconfig/10_test_vconfig.sh b/tests/p_vconfig/10_test_vconfig.sh index e3fa674..eed326f 100755 --- a/tests/p_vconfig/10_test_vconfig.sh +++ b/tests/p_vconfig/10_test_vconfig.sh @@ -1,51 +1,56 @@ #!/bin/sh -# Author: Christoph Galuschka +# Author: Christoph Galuschka # Athmane Madjoudj t_Log "Running $0 - create VLAN IF, assign IP on VLAN IF and tear down VLAN IF test" ret_val=0 -# create VLAN-IF 10 on eth0 -vconfig add eth0 10 -ip addr list | grep -q eth0.10 -if [ $? == 1 ] - then - t_Log "VLAN-IF creation failed" - ret_val=1 -else - t_Log "VLAN-IF successfully created" -fi +if [ $centos_ver = 5 ] || [ $centos_ver = 6 ] +then + # create VLAN-IF 10 on eth0 + vconfig add eth0 10 + ip addr list | grep -q eth0.10 + if [ $? == 1 ] + then + t_Log "VLAN-IF creation failed" + ret_val=1 + else + t_Log "VLAN-IF successfully created" + fi -#assign IP address on VLAN-IF -ifconfig eth0.10 172.16.30.1 netmask 255.255.255.255 -ip addr list | grep -q 172.16.30.1 -if [ $? == 1 ] - then - t_Log "IP address assignment on eth0.10 failed" - ret_val=1 -else - t_Log "IP address successfully assigned on eth1.10" -fi + #assign IP address on VLAN-IF + ifconfig eth0.10 172.16.30.1 netmask 255.255.255.255 + ip addr list | grep -q 172.16.30.1 + if [ $? == 1 ] + then + t_Log "IP address assignment on eth0.10 failed" + ret_val=1 + else + t_Log "IP address successfully assigned on eth1.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" - ret_val=1 -else - t_Log "local ping on VLAN IF worked" -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" + ret_val=1 + else + t_Log "local ping on VLAN IF worked" + fi -# delete VLAN-IF 10 on eth0 -vconfig rem eth0.10 -ip addr list | grep -q eth0.10 -if [ $? == 0 ] - then - t_Log "Removing VLAN IF failed" - ret_val=1 + # delete VLAN-IF 10 on eth0 + vconfig rem eth0.10 + ip addr list | grep -q eth0.10 + if [ $? == 0 ] + then + t_Log "Removing VLAN IF failed" + ret_val=1 + else + t_Log "Removing of VLAN IF worked" + fi else - t_Log "Removing of VLAN IF worked" + t_Log 'This is only supported on C5 and C6, skipping' fi t_CheckExitStatus $ret_val