aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/net_bandwidth.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/network/net_bandwidth.exp')
-rwxr-xr-xtest/network/net_bandwidth.exp51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/network/net_bandwidth.exp b/test/network/net_bandwidth.exp
new file mode 100755
index 000000000..0ec3b59ef
--- /dev/null
+++ b/test/network/net_bandwidth.exp
@@ -0,0 +1,51 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 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 1\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17spawn $env(SHELL)
18send -- "firejail --bandwidth=test set br0 10 20\r"
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "Download speed 80kbps"
22}
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 "Upload speed 160kbps"
26}
27expect {
28 timeout {puts "TESTING ERROR 4\n";exit}
29 "configuring tc ingress"
30}
31expect {
32 timeout {puts "TESTING ERROR 5\n";exit}
33 "configuring tc egress"
34}
35after 500
36
37send -- "firejail --bandwidth=test status\r"
38expect {
39 timeout {puts "TESTING ERROR 6\n";exit}
40 "rate 160Kbit burst 10Kb"
41}
42after 500
43
44send -- "firejail --bandwidth=test clear br0\r"
45expect {
46 timeout {puts "TESTING ERROR 7\n";exit}
47 "Removing bandwidth limits"
48}
49sleep 1
50
51puts "\nall done\n"