[vlc-commits] commit: test/modules/stream_filter/httplive: script for traffic shaping ( Jean-Paul Saman )
git at videolan.org
git at videolan.org
Fri Nov 26 16:55:13 CET 2010
vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Tue Nov 23 15:23:22 2010 +0100| [0c12dfe51fa65832b181e242673215753dbe629a] | committer: Jean-Paul Saman
test/modules/stream_filter/httplive: script for traffic shaping
Test script for traffic shaping with tc (iproute).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0c12dfe51fa65832b181e242673215753dbe629a
---
.../stream_filter/httplive/traffic-shaping.sh | 40 ++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/test/modules/stream_filter/httplive/traffic-shaping.sh b/test/modules/stream_filter/httplive/traffic-shaping.sh
new file mode 100755
index 0000000..cf67c89
--- /dev/null
+++ b/test/modules/stream_filter/httplive/traffic-shaping.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Copyright (C) 2010 VideoLAN
+# License: GPLv2
+#----------------------------------------------------------------------------
+# Traffic shaping for HTTP Live Streaming client tests.
+#----------------------------------------------------------------------------
+# Requires: iproute2
+#----------------------------------------------------------------------------
+#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
+#
+TC=tc
+INTF="eth0"
+RATE="500kbit"
+BURST="20kbit"
+PEAK="520kbit"
+MTU="1500"
+
+set +e
+
+# Shaping
+function traffic_shaping() {
+ ${TC} qdisc add \
+ dev ${INTF} \
+ root \
+ tbf \
+ rate ${RATE} \
+ burst ${BURST} \
+ latency 70ms \
+ peakrate ${PEAK} \
+ mtu ${MTU}
+ RESULT=$?
+}
+
+# tc qdisc add dev eth2 root tbf rate 50kbit burst 2kbit latency 70ms peakrate 52kbit mtu 1500
+
+traffic_shaping
+if ! test "${RESULT}" = "0"; then
+ exit 1
+fi
+exit 0
More information about the vlc-commits
mailing list