iscsi/test: verify connectivity after interface creation

This was done only to help with determining cause of failure
in tests early on.
Both sides of veth interface are pinged.

While here, moved up the trap just in case any of interface
setup commands fail.

Change-Id: I9990b2320055ff74a6c542eb06b18c0106067728
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/416555
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Tomasz Zawadzki 2018-06-22 08:15:59 -04:00 committed by Jim Harris
parent 79cffd37ca
commit 7a02938bac

View File

@ -19,6 +19,8 @@ function create_veth_interfaces() {
ip netns del $TARGET_NAMESPACE || true
ip link delete $INITIATOR_INTERFACE || true
trap "cleanup_veth_interfaces; exit 1" SIGINT SIGTERM EXIT
# Create veth (Virtual ethernet) interface pair
ip link add $INITIATOR_INTERFACE type veth peer name $TARGET_INTERFACE
ip addr add $INITIATOR_IP/24 dev $INITIATOR_INTERFACE
@ -32,7 +34,9 @@ function create_veth_interfaces() {
$TARGET_NS_CMD ip addr add $TARGET_IP/24 dev $TARGET_INTERFACE
$TARGET_NS_CMD ip link set $TARGET_INTERFACE up
trap "cleanup_veth_interfaces; exit 1" SIGINT SIGTERM EXIT
# Verify connectivity
ping -c 1 $TARGET_IP
ip netns exec $TARGET_NAMESPACE ping -c 1 $INITIATOR_IP
}
function cleanup_veth_interfaces() {