tests: Add few 'ip link' related tests
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@gandi.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@gmail.com>
This commit is contained in:
parent
f42a457470
commit
4cec9db0b4
|
|
@ -31,12 +31,13 @@ listtests:
|
||||||
alltests: $(TESTS)
|
alltests: $(TESTS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@echo "Removing $(RESULTS_DIR) dir ..."
|
||||||
@rm -rf $(RESULTS_DIR)
|
@rm -rf $(RESULTS_DIR)
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
|
echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
|
||||||
|
|
||||||
$(TESTS):
|
$(TESTS): clean
|
||||||
@mkdir -p $(RESULTS_DIR)
|
@mkdir -p $(RESULTS_DIR)
|
||||||
|
|
||||||
@for d in $(TESTS_DIR); do \
|
@for d in $(TESTS_DIR); do \
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,9 @@ ts_ip()
|
||||||
TMP_OUT=`mktemp /tmp/tc_testsuite.XXXXXX` || exit
|
TMP_OUT=`mktemp /tmp/tc_testsuite.XXXXXX` || exit
|
||||||
|
|
||||||
$IP $@ 2> $TMP_ERR > $TMP_OUT
|
$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 "${SCRIPT}: ${DESC} failed:"
|
||||||
ts_err "command: $IP $@"
|
ts_err "command: $IP $@"
|
||||||
ts_err "stderr output:"
|
ts_err "stderr output:"
|
||||||
|
|
@ -91,3 +92,8 @@ ts_qdisc_available()
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rand_dev()
|
||||||
|
{
|
||||||
|
echo "dev-$(tr -dc "[:alpha:]" < /dev/urandom | head -c 6)"
|
||||||
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -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
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue