8c8b64 changed test to also run on EL-versions > 6

Authored and Committed by Christoph Galuschka 11 years ago
    changed test to also run on EL-versions > 6
    
        
tests/p_network/networking_vlan_test.sh CHANGED
@@ -1,56 +1,57 @@
1
1
#!/bin/sh
2
2
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
3
3
4
- t_Log "Running $0 - create VLAN IF, assign IP on VLAN IF and tear down VLAN IF using IP command test (C6 only)"
4
+ t_Log "Running $0 - create VLAN IF, assign IP on VLAN IF and tear down VLAN IF using IP command test (not on C5)"
5
5
ret_val=0
6
6
7
- if [ $centos_ver == 6 ]
7
+ if [ $centos_ver -lt 6 ]
8
+ then
9
+ t_Log ' This is a C5 system, skipping test'
10
+ exit 0
11
+ fi
12
+
13
+ t_Log 'This is no C5-system, commencing test'
14
+ # create VLAN-IF 10 on eth0
15
+ ip link add dev eth0.10 link eth0 type vlan id 10
16
+ ip addr list | grep -q eth0.10
17
+ if [ $? == 1 ]
8
18
then
9
- t_Log 'This is a C6-system, commencing test'
10
- # create VLAN-IF 10 on eth0
11
- ip link add dev eth0.10 link eth0 type vlan id 10
12
- ip addr list | grep -q eth0.10
13
- if [ $? == 1 ]
19
+ t_Log "VLAN-IF creation failed"
20
+ ret_val=1
21
+ else
22
+ t_Log "VLAN-IF successfully created"
23
+ fi
14
- then
15
- t_Log "VLAN-IF creation failed"
16
- ret_val=1
17
- else
18
- t_Log "VLAN-IF successfully created"
19
- fi
20
24
21
- #assign IP address on VLAN-IF
22
- ip address add 172.16.30.1/32 dev eth0.10
23
- ip addr list | grep -q 172.16.30.1
24
- if [ $? == 1 ]
25
- then
26
- t_Log "IP address assignment on eth0.10 failed"
27
- ret_val=1
28
- else
29
- t_Log "IP address successfully assigned on eth1.10"
30
- fi
25
+ #assign IP address on VLAN-IF
26
+ ip address add 172.16.30.1/32 dev eth0.10
27
+ ip addr list | grep -q 172.16.30.1
28
+ if [ $? == 1 ]
29
+ then
30
+ t_Log "IP address assignment on eth0.10 failed"
31
+ ret_val=1
32
+ else
33
+ t_Log "IP address successfully assigned on eth1.10"
34
+ fi
31
35
32
- #testing address with ping
33
- ping -c 4 -q 172.16.30.1 | grep -q '4 received'
34
- if [ $? == 1 ]
35
- then
36
- t_Log "pinging on eth0.10 failed"
37
- ret_val=1
38
- else
39
- t_Log "local ping on VLAN IF worked"
40
- fi
36
+ #testing address with ping
37
+ ping -c 4 -q 172.16.30.1 | grep -q '4 received'
38
+ if [ $? == 1 ]
39
+ then
40
+ t_Log "pinging on eth0.10 failed"
41
+ ret_val=1
42
+ else
43
+ t_Log "local ping on VLAN IF worked"
44
+ fi
41
45
42
- # delete VLAN-IF 10 on eth0
43
- ip link delete eth0.10
44
- ip addr list | grep -q eth0.10
45
- if [ $? == 0 ]
46
- then
47
- t_Log "Removing VLAN IF failed"
48
- ret_val=1
46
+ # delete VLAN-IF 10 on eth0
47
+ ip link delete eth0.10
48
+ ip addr list | grep -q eth0.10
49
+ if [ $? == 0 ]
50
+ then
51
+ t_Log "Removing VLAN IF failed"
52
+ ret_val=1
49
- else
50
- t_Log "Removing of VLAN IF worked"
51
- fi
52
53
else
53
- t_Log ' This is a C5 system, skipping test'
54
+ t_Log "Removing of VLAN IF worked"
54
55
fi
55
56
56
57
t_CheckExitStatus $ret_val