[LTP] [PATCH v4 23/31] testcases: sysfs: Add sys_net04

Petr Vorel pvorel@suse.cz
Thu Sep 3 19:03:17 CEST 2026


Hi Cyril,

> +++ b/testcases/kernel/sysfs/class/net/sys_net04.c
...

> +	TST_RETRY_FUNC(read_operstate(&s1, "down"), TST_RETVAL_EQ0);
> +	check_state(&s1, 0, "down", "tun detached");
> +	check_state_delta(&s0, &s1, 0, 1, "detach transition");
nit: I was thinking if this part would deserve it's own function as it was used
at least also in sys_net03.c, but that's really minor detail.

All sysctl networking tests have really impressive coverage.

Kind regards,
Petr

> +
> +	tun_fd = open_tun(IFNAME_TUN, IFF_TUN | IFF_NO_PI);
> +	TST_RETRY_FUNC(read_operstate(&s2, "up"), TST_RETVAL_EQ0);
> +	check_state(&s2, 1, "up", "tun reattached");
> +	check_state_delta(&s1, &s2, 1, 0, "reattach transition");


More information about the ltp mailing list