aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/bandwidth.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-05-03 08:41:24 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-05-03 08:41:24 -0400
commit57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc (patch)
tree60f90718665a1a812b552f589bc4d85616232df1 /test/network/bandwidth.exp
parentMerge branch 'master' of https://github.com/netblue30/firejail (diff)
downloadfirejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.tar.gz
firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.tar.zst
firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.zip
networking features testing
Diffstat (limited to 'test/network/bandwidth.exp')
-rwxr-xr-xtest/network/bandwidth.exp62
1 files changed, 62 insertions, 0 deletions
diff --git a/test/network/bandwidth.exp b/test/network/bandwidth.exp
new file mode 100755
index 000000000..33b351296
--- /dev/null
+++ b/test/network/bandwidth.exp
@@ -0,0 +1,62 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --name=test --net=br0\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 2
13
14spawn $env(SHELL)
15send -- "firejail --bandwidth=test status\r"
16expect {
17 timeout {puts "TESTING ERROR 1\n";exit}
18 "qdisc noqueue 0: dev eth0"
19}
20sleep 1
21
22send -- "firejail --bandwidth=test set br0 50 10\r"
23expect {
24 timeout {puts "TESTING ERROR 2\n";exit}
25 "Configuring interface eth0"
26}
27expect {
28 timeout {puts "TESTING ERROR 3\n";exit}
29 "configuring tc ingress"
30}
31expect {
32 timeout {puts "TESTING ERROR 4\n";exit}
33 "configuring tc egress"
34}
35
36send -- "firejail --bandwidth=test status\r"
37expect {
38 timeout {puts "TESTING ERROR 5\n";exit}
39 "dev eth0"
40}
41expect {
42 timeout {puts "TESTING ERROR 6\n";exit}
43 "rate 80Kbit burst 10Kb"
44}
45sleep 1
46
47send -- "firejail --bandwidth=test clear br0\r"
48expect {
49 timeout {puts "TESTING ERROR 7\n";exit}
50 "Removing bandwith limits"
51}
52sleep 1
53
54send -- "firejail --bandwidth=test status; pwd\r"
55expect {
56 timeout {puts "TESTING ERROR 8\n";exit}
57 "rate 80Kbit burst 10Kb" {puts "TESTING ERROR 9\n";exit}
58 "home" {puts "ok\n"}
59}
60sleep 1
61
62puts "\nall done\n"