Commit dfd2522 1 parent 4e76d97 commit dfd2522 Copy full SHA for dfd2522
File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -28,25 +28,27 @@ function wait_for_network_namespace {
28
28
COUNTER=0
29
29
while [ $COUNTER -lt 40 ]; do
30
30
if nsenter $( nsenter_flags $1 ) true ; then
31
- break
31
+ return 0
32
32
else
33
33
sleep 0.5
34
34
fi
35
35
let COUNTER=COUNTER+1
36
36
done
37
+ exit 1
37
38
}
38
39
39
40
function wait_for_network_device {
40
41
# Wait that the device appears.
41
42
COUNTER=0
42
43
while [ $COUNTER -lt 40 ]; do
43
44
if nsenter $( nsenter_flags $1 ) ip addr show $2 ; then
44
- break
45
+ return 0
45
46
else
46
47
sleep 0.5
47
48
fi
48
49
let COUNTER=COUNTER+1
49
50
done
51
+ exit 1
50
52
}
51
53
52
54
function wait_process_exits {
@@ -55,47 +57,51 @@ function wait_process_exits {
55
57
if kill -0 $1 ; then
56
58
sleep 0.5
57
59
else
58
- break
60
+ return 0
59
61
fi
60
62
let COUNTER=COUNTER+1
61
63
done
64
+ exit 1
62
65
}
63
66
64
67
function wait_for_ping_connectivity {
65
68
COUNTER=0
66
69
while [ $COUNTER -lt 40 ]; do
67
70
if nsenter $( nsenter_flags $1 ) ping -c 1 -w 1 $2 ; then
68
- break
71
+ return 0
69
72
else
70
73
sleep 0.5
71
74
fi
72
75
let COUNTER=COUNTER+1
73
76
done
77
+ exit 1
74
78
}
75
79
76
80
function wait_for_connectivity {
77
81
COUNTER=0
78
82
while [ $COUNTER -lt 40 ]; do
79
83
if echo " wait_for_connectivity" | nsenter $( nsenter_flags $1 ) ncat -v $2 $3 ; then
80
- break
84
+ return 0
81
85
else
82
86
sleep 0.5
83
87
fi
84
88
let COUNTER=COUNTER+1
85
89
done
90
+ exit 1
86
91
}
87
92
88
93
function wait_for_file_content {
89
94
# Wait for a file to get the specified content.
90
95
COUNTER=0
91
96
while [ $COUNTER -lt 20 ]; do
92
97
if grep $1 $2 ; then
93
- break
98
+ return 0
94
99
else
95
100
sleep 0.5
96
101
fi
97
102
let COUNTER=COUNTER+1
98
103
done
104
+ exit 1
99
105
}
100
106
101
107
function expose_tcp() {
You can’t perform that action at this time.
0 commit comments