[CRIU] [PATCH] zdtm/bridge: wait when the tentative flas is disappeared

Dmitry Safonov 0x7f454c46 at gmail.com
Mon Apr 30 19:44:21 MSK 2018


2018-04-30 17:37 GMT+01:00 Andrei Vagin <avagin at virtuozzo.com>:
> On Mon, Apr 30, 2018 at 12:30:40PM +0100, Dmitry Safonov wrote:
>> > diff --git a/test/zdtm/static/bridge.c b/test/zdtm/static/bridge.c
>> > index 983c262af..0c26c0b0f 100644
>> > --- a/test/zdtm/static/bridge.c
>> > +++ b/test/zdtm/static/bridge.c
>> > @@ -84,6 +84,10 @@ int main(int argc, char **argv)
>> >          * (I got this race with zdtm.py, but not with zdtm.sh; not quite sure
>> >          * what the environment difference is/was.)
>> >          */
>> > +       while (1) {
>> > +               if (system("ip addr list dev " BRIDGE_NAME " | grep tentative"))
>> > +                       break;
>> > +       }
>>
>> `grep -v tentative`, I guess.
>
> No. We are waiting when tentative is disappeared. Travis failed because
> criu has a bug.

Oh, yeah, it's me stupid - system() will return non-zero when grep fails,
makes sense.  For a second unconsciously I thought it will return the number
of characters printed, lol.

> Who wants to fix it?:)
>
> [root at fc24 criu]# python2 ./test/zdtm.py run  -t zdtm/static/bridge
> --iter 0 -f ns
> === Run 1/1 ================ zdtm/static/bridge
>
> ========================= Run zdtm/static/bridge in ns
> Start test
> Test is SUID
> ./bridge --pidfile=bridge.pid --outfile=bridge.out
> Send the 15 signal to  85
> Wait for zdtm/static/bridge(85) to die for 0.100000
> Removing dump/zdtm/static/bridge/85
> ========================= Test zdtm/static/bridge PASS
>
>>
>> As travis failed anyway, maybe it makes sense for v2 to add nanosleep() here?
>> Just not to busyloop the system pointlessly with fork()s and all that.
>> Maybe it doesn't make sense, not sure.
>> But say the dad is slow by some reason - this version will punch the
>> test system.
>> A perfect solution would be to read netlink messages for intf.. But
>> that's a zdtm
>> test, not sure if it's worth to bother so much.

-- 
             Dmitry


More information about the CRIU mailing list