]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
New files in testsuite update (damn CVS)
authorshemminger <shemminger>
Thu, 23 Jun 2005 20:31:37 +0000 (20:31 +0000)
committershemminger <shemminger>
Thu, 23 Jun 2005 20:31:37 +0000 (20:31 +0000)
testsuite/iproute2/Makefile [new file with mode: 0644]
testsuite/tests/cbq.t [new file with mode: 0644]
testsuite/tests/cls-testbed.t [new file with mode: 0644]
testsuite/tests/dsmark.t [new file with mode: 0644]

diff --git a/testsuite/iproute2/Makefile b/testsuite/iproute2/Makefile
new file mode 100644 (file)
index 0000000..ba128aa
--- /dev/null
@@ -0,0 +1,33 @@
+SUBDIRS := $(filter-out Makefile,$(wildcard *))
+.PHONY: all configure clean distclean show $(SUBDIRS)
+
+all: configure
+       @for dir in $(SUBDIRS); do \
+               echo "Entering $$dir" && cd $$dir && $(MAKE) && cd ..; \
+       done
+
+link:
+       @if [ ! -L iproute2-this ]; then \
+               ln -s ../.. iproute2-this; \
+       fi
+
+configure: link
+       @for dir in $(SUBDIRS); do \
+               echo "Entering $$dir" && cd $$dir && if [ -f configure ]; then ./configure; fi && cd ..; \
+       done
+
+clean: link
+       @for dir in $(SUBDIRS); do \
+               echo "Entering $$dir" && cd $$dir && $(MAKE) clean && cd ..; \
+       done
+
+distclean: clean
+       @for dir in $(SUBDIRS); do \
+               echo "Entering $$dir" && cd $$dir && $(MAKE) distclean && cd ..; \
+       done
+
+show: link
+       @echo "$(SUBDIRS)"
+
+$(SUBDIRS):
+       cd $@ && $(MAKE)
diff --git a/testsuite/tests/cbq.t b/testsuite/tests/cbq.t
new file mode 100644 (file)
index 0000000..bff814b
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+$TC qdisc del dev $DEV root >/dev/null 2>&1
+$TC qdisc add dev $DEV root handle 10:0 cbq bandwidth 100Mbit avpkt 1400 mpu 64
+$TC class add dev $DEV parent 10:0  classid 10:12   cbq bandwidth 100mbit rate 100mbit allot 1514 prio 3 maxburst 1 avpkt  500 bounded
+$TC qdisc list dev $DEV
+$TC qdisc del dev $DEV root
+$TC qdisc list dev $DEV
+$TC qdisc add dev $DEV root handle 10:0 cbq bandwidth 100Mbit avpkt 1400 mpu 64
+$TC class add dev $DEV parent 10:0  classid 10:12   cbq bandwidth 100mbit rate 100mbit allot 1514 prio 3 maxburst 1 avpkt  500 bounded
+$TC qdisc del dev $DEV root
diff --git a/testsuite/tests/cls-testbed.t b/testsuite/tests/cls-testbed.t
new file mode 100644 (file)
index 0000000..efae2a5
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/bash
+# vim: ft=sh
+
+source lib/generic.sh
+
+QDISCS="cbq htb dsmark"
+
+for q in ${QDISCS}; do
+       ts_log "Preparing classifier testbed with qdisc $q"
+
+       for c in tests/cls/*.t; do
+
+               case "$q" in
+               cbq)
+                       ts_tc "cls-testbed" "cbq root qdisc creation" \
+                               qdisc add dev $DEV root handle 10:0 \
+                               cbq bandwidth 100Mbit avpkt 1400 mpu 64
+                       ts_tc "cls-testbed" "cbq root class creation" \
+                               class add dev $DEV parent 10:0  classid 10:12 \
+                               cbq bandwidth 100mbit rate 100mbit allot 1514 prio 3 \
+                               maxburst 1 avpkt  500 bounded
+                       ;;
+               htb)
+                       ts_qdisc_available "htb"
+                       if [ $? -eq 0 ]; then
+                               ts_log "cls-testbed: HTB is unsupported by $TC, skipping"
+                               continue;
+                       fi
+                       ts_tc "cls-testbed" "htb root qdisc creation" \
+                               qdisc add dev $DEV root handle 10:0 htb
+                       ts_tc "cls-testbed" "htb root class creation" \
+                               class add dev $DEV parent 10:0 classid 10:12 \
+                               htb rate 100Mbit quantum 1514
+                       ;;
+               dsmark)
+                       ts_qdisc_available "dsmark"
+                       if [ $? -eq 0 ]; then
+                               ts_log "cls-testbed: dsmark is unsupported by $TC, skipping"
+                               continue;
+                       fi
+                       ts_tc "cls-testbed" "dsmark root qdisc creation" \
+                               qdisc add dev $DEV root handle 20:0 \
+                               dsmark indices 64 default_index 1 set_tc_index
+                       ts_tc "cls-testbed" "dsmark class creation" \
+                               class change dev $DEV parent 20:0 classid 20:12 \
+                               dsmark mask 0xff value 2
+                       ts_tc "cls-testbed" "prio inner qdisc creation" \
+                               qdisc add dev $DEV parent 20:0 handle 10:0 prio
+                       ;;
+               *)
+                       ts_err "cls-testbed: no testbed configuration found for qdisc $q"
+                       continue
+                       ;;
+               esac
+
+               ts_tc "cls-testbed" "tree listing" qdisc list dev eth0
+               ts_tc "cls-testbed" "tree class listing" class list dev eth0
+               ts_log "cls-testbed: starting classifier test $c"
+               $c 
+
+               case "$q" in
+               *)
+                       ts_tc "cls-testbed" "generic qdisc tree deletion" \
+                               qdisc del dev $DEV root
+                       ;;
+               esac
+       done
+done
diff --git a/testsuite/tests/dsmark.t b/testsuite/tests/dsmark.t
new file mode 100644 (file)
index 0000000..6934165
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+# vim: ft=sh
+
+source lib/generic.sh
+
+ts_qdisc_available "dsmark"
+if [ $? -eq 0 ]; then
+       ts_log "dsmark: Unsupported by $TC, skipping"
+       exit 127
+fi
+
+ts_tc "dsmark" "dsmark root qdisc creation" \
+       qdisc add dev $DEV root handle 10:0 \
+       dsmark indices 64 default_index 1 set_tc_index
+
+ts_tc "dsmark" "dsmark class 1 creation" \
+       class change dev $DEV parent 10:0 classid 10:12 \
+       dsmark mask 0xff value 2
+
+ts_tc "dsmark" "dsmark class 2 creation" \
+       class change dev $DEV parent 10:0 classid 10:13 \
+       dsmark mask 0xfc value 4
+
+ts_tc "dsmark" "dsmark dump qdisc" \
+       qdisc list dev $DEV
+
+ts_tc "dsmark" "dsmark dump class" \
+       class list dev $DEV parent 10:0
+
+ts_tc "dsmark" "generic qdisc tree deletion" \
+       qdisc del dev $DEV root