Subject: Re: [PATCH net-next v5 6/6] selftests: net: Test for the IOAM insertion with IPv6

From: David Ahern <[email-masked]>
Date: Wed, 21 Jul 2021 20:52:16 -0600

On 7/20/21 1:43 PM, Justin Iurman wrote:
> +run()
> +{
> +  echo -n "IOAM test... "
> +
> +  ip netns exec ioam-node-alpha ping6 -c 5 -W 1 db02::2 &>/dev/null
> +  if [ $? != 0 ]; then
> +    echo "FAILED"
> +    cleanup &>/dev/null
> +    exit 0
> +  fi
> +
> +  ip netns exec ioam-node-gamma ./ioam6_parser veth0 2 ${IOAM_NAMESPACE} ${IOAM_TRACE_TYPE} 64 ${ALPHA[0]} ${ALPHA[1]} ${ALPHA[2]} ${ALPHA[3]} ${ALPHA[4]} ${ALPHA[5]} ${ALPHA[6]} ${ALPHA[7]} ${ALPHA[8]} "${ALPHA[9]}" 63 ${BETA[0]} ${BETA[1]} ${BETA[2]} ${BETA[3]} ${BETA[4]} ${BETA[5]} ${BETA[6]} ${BETA[7]} ${BETA[8]} &
> +
> +  local spid=$!
> +  sleep 0.1
> +
> +  ip netns exec ioam-node-alpha ping6 -c 5 -W 1 db02::2 &>/dev/null
> +
> +  wait $spid
> +  [ $? = 0 ] && echo "PASSED" || echo "FAILED"
> +}
> +
> +cleanup &>/dev/null
> +setup
> +run
> +cleanup &>/dev/null

Can you add negative tests as well? i.e, things work like they should
when enabled and configured properly, fail when the test should not and
include any invalid combinations of parameters.