[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1421341162-6945-1-git-send-email-vadim4j@gmail.com>
Date: Thu, 15 Jan 2015 18:59:22 +0200
From: Vadim Kochan <vadim4j@...il.com>
To: netdev@...r.kernel.org
Cc: Vadim Kochan <vadim4j@...il.com>
Subject: [PATCH iproute2] tests: Add few 'ip link' related tests
From: Vadim Kochan <vadim4j@...il.com>
Added two tests which checks the following fixed issues:
1) Bug when not possible add new virtual interface via:
$ ip link add dev XXX type
It was fixed a few releases ago.
2) Crash on older kernels when VF rate info does not exist:
$ ip link show
Used dump file from William Dauchy <william@...di.net>:
testsuite/tests/ip/link/dev_wo_vf_rate.nl
So 'ip link show' replaced by 'ip -d monitor file ...' which does
the same thing.
Also added new func in testsuite/lib/generic.sh to gen new random dev name.
Added 'clean' dependency on running all tests.
Signed-off-by: Vadim Kochan <vadim4j@...il.com>
---
testsuite/Makefile | 3 ++-
testsuite/lib/generic.sh | 8 +++++++-
testsuite/tests/ip/link/dev_wo_vf_rate.nl | Bin 0 -> 14076 bytes
testsuite/tests/ip/link/new_link.t | 11 +++++++++++
testsuite/tests/ip/link/show_dev_wo_vf_rate.t | 6 ++++++
5 files changed, 26 insertions(+), 2 deletions(-)
create mode 100644 testsuite/tests/ip/link/dev_wo_vf_rate.nl
create mode 100755 testsuite/tests/ip/link/new_link.t
create mode 100755 testsuite/tests/ip/link/show_dev_wo_vf_rate.t
diff --git a/testsuite/Makefile b/testsuite/Makefile
index 2ba9547..a2c8a2d 100644
--- a/testsuite/Makefile
+++ b/testsuite/Makefile
@@ -31,12 +31,13 @@ listtests:
alltests: $(TESTS)
clean:
+ @echo "Removing $(RESULTS_DIR) dir ..."
@rm -rf $(RESULTS_DIR)
distclean: clean
echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
-$(TESTS):
+$(TESTS): clean
@mkdir -p $(RESULTS_DIR)
@for d in $(TESTS_DIR); do \
diff --git a/testsuite/lib/generic.sh b/testsuite/lib/generic.sh
index 8f76e49..3473cc1 100644
--- a/testsuite/lib/generic.sh
+++ b/testsuite/lib/generic.sh
@@ -62,8 +62,9 @@ ts_ip()
TMP_OUT=`mktemp /tmp/tc_testsuite.XXXXXX` || exit
$IP $@ 2> $TMP_ERR > $TMP_OUT
+ RET=$?
- if [ -s $TMP_ERR ]; then
+ if [ -s $TMP_ERR ] || [ "$RET" != "0" ]; then
ts_err "${SCRIPT}: ${DESC} failed:"
ts_err "command: $IP $@"
ts_err "stderr output:"
@@ -91,3 +92,8 @@ ts_qdisc_available()
return 1;
fi
}
+
+rand_dev()
+{
+ echo "dev-$(tr -dc "[:alpha:]" < /dev/urandom | head -c 6)"
+}
diff --git a/testsuite/tests/ip/link/dev_wo_vf_rate.nl b/testsuite/tests/ip/link/dev_wo_vf_rate.nl
new file mode 100644
index 0000000000000000000000000000000000000000..40fa87ff1b158fb972e064efb38f76b0e9a56697
GIT binary patch
literal 14076
zcmeI2QD_`h6o$|4X4B1fZMT}ns!(GsCQqft8lx5o_Nk#2gn}Z4n3_#@...p2BSi%l
zK`m6<ASk{l3L;Xdtzh4LXw?UwEWQ;H>|<XAeW{rB{P)gj@...$&U9yYCpZUo?##V+
z&N*}MnQzaXnJq-Lk$)l|{C)nwxqpi^KR{HbES=`#u}x?l$YprDm#`&TM>(o55*6q!
zb)4tkkUXi*T+a%)Z-E|A^#$7Mln*Km1sYXlo*q(Vi3aKD;<4q*a)q|j2GuucGkCJq
zDyp+|k0Sdi@...2m0iT|)VKO4ZE=*})4fVJbioD$cFa;AC2zZuy`N6-ST&5X6EATo
z_D|Z(Qu>&6?e@...Avgf!`ULof*!D8j*?c3=uZxngEPAQq%()pN?GQnhhmRa(B~Ye
z(A8pTJ~c$m=QA9IL@)C6>*%|64N6VG20Ecbn#D)dZ_ng7{!(c-0=xKL9c<UZr)`+;
zOIvp4ZN_9&6znPMI2q#Etu(4TaUM8>c>-r(+vLpn!)W(%rl8In<u>%!oLR?bA34VJ
ztQhmlKitHza7C5aH$^e#k$UUm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`0)nM
z9;_Va3E1c>Z}z9W2|Le8=S_7_%A2rrnUsEU@...M-{Ad<yx-r%Zw!`}57le0%+A%9
zs&lx0a0lY|{bktqR>%XRe18dh$aOw@...6@...7x9$}<Rck}x;UXLEH%^$8L=H1oJ
z?~6wGmD=tEudl+4@&B<;T>LrV!yl{-g+KTPWWMs+?8L;AedW&T$F&Wg?nt>4HrA8Q
zozu*nt1D^V6Lvn6(yyD`DH+^Z&)jJouhr}PC3rvcoyj*o+V<UhDR;ugU(&g=%G@cv
PlX55Qd?uw|T-^B&_@nmR
literal 0
HcmV?d00001
diff --git a/testsuite/tests/ip/link/new_link.t b/testsuite/tests/ip/link/new_link.t
new file mode 100755
index 0000000..549ff25
--- /dev/null
+++ b/testsuite/tests/ip/link/new_link.t
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+source lib/generic.sh
+
+ts_log "[Testing add/del virtual links]"
+
+NEW_DEV="$(rand_dev)"
+
+ts_ip "$0" "Add $NEW_DEV dummy interface" link add dev $NEW_DEV type dummy
+ts_ip "$0" "Show $NEW_DEV dummy interface" link show dev $NEW_DEV
+ts_ip "$0" "Del $NEW_DEV dummy interface" link del dev $NEW_DEV
diff --git a/testsuite/tests/ip/link/show_dev_wo_vf_rate.t b/testsuite/tests/ip/link/show_dev_wo_vf_rate.t
new file mode 100755
index 0000000..a600ba6
--- /dev/null
+++ b/testsuite/tests/ip/link/show_dev_wo_vf_rate.t
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+source lib/generic.sh
+
+NL_FILE="tests/ip/link/dev_wo_vf_rate.nl"
+ts_ip "$0" "Show VF devices w/o VF rate info" -d monitor file $NL_FILE
--
2.1.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists