]> git.sesse.net Git - vlc/blob - test/modules/stream_filter/httplive/traffic-shaping.sh
l10n: Galician update
[vlc] / test / modules / stream_filter / httplive / traffic-shaping.sh
1 #!/bin/sh
2 # Copyright (C) 2010 VideoLAN
3 # License: GPLv2
4 #----------------------------------------------------------------------------
5 # Traffic shaping for HTTP Live Streaming client tests.
6 #----------------------------------------------------------------------------
7 # Requires: iproute2
8 #----------------------------------------------------------------------------
9 #qdisc pfifo_fast 0: root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
10 #
11 TC=tc
12 INTF="eth0"
13 RATE="500kbit"
14 BURST="20kbit"
15 PEAK="520kbit"
16 MTU="1500"
17
18 set +e
19
20 # Shaping
21 function traffic_shaping() {
22     ${TC} qdisc add    \
23           dev ${INTF}  \
24           root         \
25           tbf          \
26           rate ${RATE} \
27           burst ${BURST} \
28           latency 70ms \
29           peakrate ${PEAK} \
30           mtu ${MTU}
31     RESULT=$?
32 }
33
34 # tc qdisc add dev eth2 root tbf rate 50kbit burst 2kbit latency 70ms peakrate 52kbit mtu 1500
35
36 traffic_shaping
37 if ! test "${RESULT}" = "0"; then
38     exit 1
39 fi
40 exit 0