blob: f47fd0eee0a002fc0448e3853c3f8a3da6758da4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
#!/usr/bin/expect -f
set timeout 10
spawn $env(SHELL)
match_max 100000
# check br0
send -- "/sbin/ifconfig;pwd\r"
expect {
timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit}
"br0"
}
expect {
timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit}
"10.10.20.1"
}
expect {
timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit}
"home"
}
# check br1
send -- "/sbin/ifconfig;pwd\r"
expect {
timeout {puts "TESTING ERROR 1\n";exit}
"br1"
}
expect {
timeout {puts "TESTING ERROR 1\n";exit}
"10.10.30.1"
}
expect {
timeout {puts "TESTING ERROR 1\n";exit}
"home"
}
# check br2
send -- "/sbin/ifconfig;pwd\r"
expect {
timeout {puts "TESTING ERROR 2\n";exit}
"br2"
}
expect {
timeout {puts "TESTING ERROR 2\n";exit}
"10.10.40.1"
}
expect {
timeout {puts "TESTING ERROR 2\n";exit}
"home"
}
# check br3
send -- "/sbin/ifconfig;pwd\r"
expect {
timeout {puts "TESTING ERROR 3\n";exit}
"br3"
}
expect {
timeout {puts "TESTING ERROR 3\n";exit}
"10.10.50.1"
}
expect {
timeout {puts "TESTING ERROR 3\n";exit}
"home"
}
# start a sandbox and check MALLOC_PERTURB
send -- "firejail\r"
expect {
timeout {puts "TESTING ERROR 4\n";exit}
"Child process initialized"
}
sleep 1
set timeout 2
send -- "env | grep MALLOC;pwd\r"
expect {
timeout {puts "\nTESTING: MALLOC_PERTURB_ disabled\n"}
"MALLOC_PERTURB_" {puts "\nTESTING: MALLOC_PERTURB_ enabled\n"}
}
expect {
timeout {puts "TESTING ERROR 5\n";exit}
"home" {puts "regular user\n"}
"root" {puts "root user\n"}
}
|