On Mon, 25 Feb 2019 13:33:30 +0100
Sabrina Dubroca <s...@queasysnail.net> wrote:

> 2019-02-25, 12:13:46 +0100, Paolo Abeni wrote:
> > +   if ! timeout 1 ${ns_a} ip link del dev veth_A-R1; then  
> 
> That doesn't work. "ip link del" is stuck in a way that timeout can't
> terminate it, so this is still going to hang. Did you actually test
> this? :/

Indeed, upon actual testing, this hangs and the error is not reported.

> > +           err "  can't delete veth device in a timely
> > manner, PMTU dst likely leaked"
> > +           return 1
> > +   fi
> > +   return 0
> > +}  

You can use a subshell here, something like:

        ${ns_a} ip link del dev veth_A-R1 &
        iplink_pid=$!
        sleep 1
        if [ "$(cat /proc/${iplink_pid}/cmdline 2>/dev/null | tr -d '\0')" = 
"iplinkdeldevveth_A-R1" ]; then
                err "  can't delete veth device in a timely manner, PMTU dst 
likely leaked"
                return 1
        fi
}

and now that I tried to run as a single test and couldn't find it, I
think it would also be worth it to rename the tests to something more
sensible.

Right now you have test_pmtu_ipv6_exception_cleanup() calling
test_cleanup_...(), I think it's confusing. Just call the test
test_cleanup_ipv6_exception(), it doesn't have so much to do with PMTU
anyway.

-- 
Stefano

Reply via email to