8c8b64
changed test to also run on EL-versions > 6
@@ -1,56 +1,57 @@
|
|
1
1
|
|
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 (
|
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
|
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
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
54
|
+
t_Log "Removing of VLAN IF worked"
|
54
55
|
fi
|
55
56
|
|
56
57
|
t_CheckExitStatus $ret_val
|