aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/bandwidth.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/network/bandwidth.exp')
-rwxr-xr-xtest/network/bandwidth.exp65
1 files changed, 65 insertions, 0 deletions
diff --git a/test/network/bandwidth.exp b/test/network/bandwidth.exp
new file mode 100755
index 000000000..8a2e46e04
--- /dev/null
+++ b/test/network/bandwidth.exp
@@ -0,0 +1,65 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=test --net=br0\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17spawn $env(SHELL)
18send -- "firejail --bandwidth=test status\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "qdisc * 0: dev eth0"
22}
23sleep 1
24
25send -- "firejail --bandwidth=test set br0 50 10\r"
26expect {
27 timeout {puts "TESTING ERROR 2\n";exit}
28 "Configuring interface eth0"
29}
30expect {
31 timeout {puts "TESTING ERROR 3\n";exit}
32 "configuring tc ingress"
33}
34expect {
35 timeout {puts "TESTING ERROR 4\n";exit}
36 "configuring tc egress"
37}
38
39send -- "firejail --bandwidth=test status\r"
40expect {
41 timeout {puts "TESTING ERROR 5\n";exit}
42 "dev eth0"
43}
44expect {
45 timeout {puts "TESTING ERROR 6\n";exit}
46 "rate 80Kbit burst 10Kb"
47}
48sleep 1
49
50send -- "firejail --bandwidth=test clear br0\r"
51expect {
52 timeout {puts "TESTING ERROR 7\n";exit}
53 "Removing bandwith limits"
54}
55sleep 1
56
57send -- "firejail --bandwidth=test status; echo done\r"
58expect {
59 timeout {puts "TESTING ERROR 8\n";exit}
60 "rate 80Kbit burst 10Kb" {puts "TESTING ERROR 9\n";exit}
61 "done"
62}
63after 100
64
65puts "\nall done\n"