File tree Expand file tree Collapse file tree 3 files changed +19
-21
lines changed Expand file tree Collapse file tree 3 files changed +19
-21
lines changed Original file line number Diff line number Diff line change @@ -15,5 +15,6 @@ before_install:
15
15
- pip install m2crypto salsa20 pep8 pyflakes nose coverage
16
16
- sudo tests/socksify/install.sh
17
17
- sudo tests/libsodium/install.sh
18
+ - sudo tests/setup_tc.sh
18
19
script :
19
20
- ./.jenkins.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ DEV=lo
4
+ PORT=8388
5
+ DELAY=100ms
6
+
7
+ type tc 2> /dev/null && (
8
+ tc qdisc add dev $DEV root handle 1: htb
9
+ tc class add dev $DEV parent 1: classid 1:1 htb rate 2mbps
10
+ tc class add dev $DEV parent 1:1 classid 1:6 htb rate 2mbps ceil 1mbps prio 0
11
+ tc filter add dev $DEV parent 1:0 prio 0 protocol ip handle 6 fw flowid 1:6
12
+
13
+ tc filter add dev $DEV parent 1:0 protocol ip u32 match ip dport $PORT 0xffff flowid 1:6
14
+ tc filter add dev $DEV parent 1:0 protocol ip u32 match ip sport $PORT 0xffff flowid 1:6
15
+
16
+ tc qdisc show dev lo
17
+ )
18
+
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- DEV=lo
4
- PORT=8388
5
- DELAY=100ms
6
-
7
3
PYTHON=" coverage run -p -a"
8
4
URL=http://127.0.0.1/file
9
5
10
6
mkdir -p tmp
11
7
12
- type tc 2> /dev/null && (
13
- tc qdisc add dev $DEV root handle 1: htb
14
- tc class add dev $DEV parent 1: classid 1:1 htb rate 2mbps
15
- tc class add dev $DEV parent 1:1 classid 1:6 htb rate 2mbps ceil 1mbps prio 0
16
- tc filter add dev $DEV parent 1:0 prio 0 protocol ip handle 6 fw flowid 1:6
17
-
18
- tc filter add dev $DEV parent 1:0 protocol ip u32 match ip dport $PORT 0xffff flowid 1:6
19
- tc filter add dev $DEV parent 1:0 protocol ip u32 match ip sport $PORT 0xffff flowid 1:6
20
-
21
- # iptables -D OUTPUT -t mangle -p tcp --sport 8388 -j MARK --set-mark 6
22
- # iptables -A OUTPUT -t mangle -p tcp --sport 8388 -j MARK --set-mark 6
23
-
24
- tc qdisc show dev lo
25
- )
26
-
27
8
$PYTHON shadowsocks/local.py -c tests/aes.json &
28
9
LOCAL=$!
29
10
@@ -38,8 +19,6 @@ time curl -o tmp/result --socks5-hostname 127.0.0.1:1081 $URL
38
19
kill -s SIGINT $LOCAL
39
20
kill -s SIGINT $SERVER
40
21
41
- type tc 2> /dev/null && tc qdisc del dev lo root
42
-
43
22
sleep 2
44
23
45
24
diff tmp/expected tmp/result || exit 1
You can’t perform that action at this time.
0 commit comments