|
@@ -51,20 +51,24 @@ proc login {} {
|
51
|
51
|
if { [exp_pid] == 0 } { destroy }
|
52
|
52
|
set timeout 15
|
53
|
53
|
expect "Console: " { termconfig } timeout destroy
|
54
|
|
- expect {
|
55
|
|
- "$::VZ5::HOSTNAME login:" {}
|
56
|
|
- "FAIL" {
|
57
|
|
- expect "\r"
|
58
|
|
- expect "\r" {
|
59
|
|
- sleep 2;
|
60
|
|
- expect "login:" {
|
61
|
|
- send "root\r";
|
62
|
|
- vm_stty;
|
63
|
|
- debug_interact;
|
|
54
|
+ if {[catch {
|
|
55
|
+ expect {
|
|
56
|
+ "$::VZ5::HOSTNAME login:" {}
|
|
57
|
+ "FAIL" {
|
|
58
|
+ expect "\r"
|
|
59
|
+ expect "\r" {
|
|
60
|
+ sleep 2;
|
|
61
|
+ expect "login:" {
|
|
62
|
+ send "root\r";
|
|
63
|
+ vm_stty;
|
|
64
|
+ debug_interact;
|
|
65
|
+ } timeout destroy
|
64
|
66
|
} timeout destroy
|
65
|
|
- } timeout destroy
|
|
67
|
+ }
|
|
68
|
+ timeout destroy
|
66
|
69
|
}
|
67
|
|
- timeout destroy
|
|
70
|
+ } err]} {
|
|
71
|
+ destroy
|
68
|
72
|
}
|
69
|
73
|
set timeout 5
|
70
|
74
|
if {[catch {send "root\r"} err]} {
|
|
@@ -132,15 +136,20 @@ proc test_ssh {} {
|
132
|
136
|
|
133
|
137
|
}
|
134
|
138
|
|
135
|
|
-# Check for vz5 network address configuration
|
136
|
|
-proc test_vz5_netconfig {} {
|
137
|
|
- set timeout 3
|
138
|
|
- expect {
|
139
|
|
- "[prompt]" { send "ip a\r" }
|
140
|
|
- "2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP>" {} timeout abort
|
141
|
|
- "inet 192.168.242." {} timeout abort
|
142
|
|
- "inet6 2001:41d0:203:10ae:1312::" {} timeout abort
|
143
|
|
- }
|
|
139
|
+# Check that given ifname has given IP (prefix, 10.0.2. will match 10.0.2.42)
|
|
140
|
+proc test_netconfig_ipv4 {ifname ip_prefix} {
|
|
141
|
+ set timeout 2
|
|
142
|
+ expect "[prompt]" { send "ip addr show $ifname\r" } timeout abort
|
|
143
|
+ expect ": $ifname: <BROADCAST,MULTICAST,UP,LOWER_UP>" {} timeout abort
|
|
144
|
+ expect "inet $ip_prefix" {} timeout abort
|
|
145
|
+}
|
|
146
|
+
|
|
147
|
+# Check that given ifname has given Ip (prefix, fe80:: will match fe80::1312)
|
|
148
|
+proc test_netconfig_ipv6 {ifname ip6_prefix} {
|
|
149
|
+ set timeout 5
|
|
150
|
+ expect "[prompt]" { send "ip a show $ifname\r" } timeout abort
|
|
151
|
+ expect ": $ifname: <BROADCAST,MULTICAST,UP,LOWER_UP>" {} timeout abort
|
|
152
|
+ expect "inet6 $ip6_prefix" {} timeout abort
|
144
|
153
|
}
|
145
|
154
|
|
146
|
155
|
# Testing that apt runs
|