summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4446057)
Add wrappers around ip netns exec and lnetctl commands to generate
some additional test output. This makes it easier to see what each
test case is doing from the test script output, and aids in debugging
any problems.
Test-parameters: trivial
Test-parameters: testlist=sanity-lnet
Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: I95b18cb3a090527548a8f9e65845eb4a18dea6d6
Reviewed-on: https://review.whamcloud.com/36242
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
+do_lnetctl() {
+ echo "$LNETCTL $@"
+ $LNETCTL "$@"
+}
+
-RUN_NS="ip netns exec $TESTNS"
FAKE_IF="test1pg"
FAKE_IP="10.1.2.3"
FAKE_IF="test1pg"
FAKE_IP="10.1.2.3"
+do_ns() {
+ echo "ip netns exec $TESTNS $@"
+ ip netns exec $TESTNS "$@"
+}
setup_netns() {
cleanup_netns
setup_netns() {
cleanup_netns
ip netns add $TESTNS
ip link add 'test1pl' type veth peer name $FAKE_IF netns $TESTNS
ip link set 'test1pl' up
ip netns add $TESTNS
ip link add 'test1pl' type veth peer name $FAKE_IF netns $TESTNS
ip link set 'test1pl' up
- $RUN_NS ip addr add "${FAKE_IP}/31" dev $FAKE_IF
- $RUN_NS ip link set $FAKE_IF up
+ do_ns ip addr add "${FAKE_IP}/31" dev $FAKE_IF
+ do_ns ip link set $FAKE_IF up
- $LNETCTL lnet configure
+ do_lnetctl lnet configure
}
run_test 1 "configure lnet with lnetctl"
}
run_test 1 "configure lnet with lnetctl"
test_2() {
cleanup_lnet || exit 1
load_lnet "networks=\"\""
test_2() {
cleanup_lnet || exit 1
load_lnet "networks=\"\""
- $RUN_NS $LNETCTL lnet configure --all || exit 1
+ do_ns $LNETCTL lnet configure --all || exit 1
$LNETCTL net show --net tcp | grep -q "nid: ${FAKE_IP}@tcp$"
}
run_test 2 "load lnet w/o module option, configure in a non-default namespace"
$LNETCTL net show --net tcp | grep -q "nid: ${FAKE_IP}@tcp$"
}
run_test 2 "load lnet w/o module option, configure in a non-default namespace"
test_3() {
cleanup_lnet || exit 1
load_lnet "networks=tcp($FAKE_IF)"
test_3() {
cleanup_lnet || exit 1
load_lnet "networks=tcp($FAKE_IF)"
- $RUN_NS $LNETCTL lnet configure --all || exit 1
+ do_ns $LNETCTL lnet configure --all || exit 1
$LNETCTL net show --net tcp | grep -q "nid: ${FAKE_IP}@tcp$"
}
run_test 3 "load lnet using networks module options in a non-default namespace"
$LNETCTL net show --net tcp | grep -q "nid: ${FAKE_IP}@tcp$"
}
run_test 3 "load lnet using networks module options in a non-default namespace"
test_4() {
cleanup_lnet || exit 1
load_lnet "networks=\"\" ip2nets=\"tcp0($FAKE_IF) ${FAKE_IP}\""
test_4() {
cleanup_lnet || exit 1
load_lnet "networks=\"\" ip2nets=\"tcp0($FAKE_IF) ${FAKE_IP}\""
- $RUN_NS $LNETCTL lnet configure --all || exit 1
+ do_ns $LNETCTL lnet configure --all || exit 1
$LNETCTL net show | grep -q "nid: ${FAKE_IP}@tcp$"
}
run_test 4 "load lnet using ip2nets in a non-default namespace"
$LNETCTL net show | grep -q "nid: ${FAKE_IP}@tcp$"
}
run_test 4 "load lnet using ip2nets in a non-default namespace"
test_5() {
cleanup_lnet || exit 1
load_lnet
test_5() {
cleanup_lnet || exit 1
load_lnet
- $LNETCTL lnet configure || exit 1
- $RUN_NS $LNETCTL net add --net tcp0 --if $FAKE_IF
+ do_lnetctl lnet configure || exit 1
+ do_ns $LNETCTL net add --net tcp0 --if $FAKE_IF
}
run_test 5 "add a network using an interface in the non-default namespace"
}
run_test 5 "add a network using an interface in the non-default namespace"