[LTP] [PATCH] testcases/lib: introduce sysctl wrapper

Nikita Yushchenko nikita.yushchenko@virtuozzo.com
Tue Feb 22 17:09:15 CET 2022


>> Linux sysctl utility does not propagate errors returned from proc writes
>> to it's exit code:
>>
>>> sysctl -q -w net.ipv4.tcp_congestion_control=dctcp
>> sysctl: setting key "net.ipv4.tcp_congestion_control": Operation not permitted
>>> echo $?
>> 0
> 
> I wonder why we use sysctl in the first place, all that it does in our
> case is write to /proc/sys/net/.... file. I guess that it may be easier
> if we just echo the value into the corresponding files instead.

LTP sometimes uses sysctl under 'tst_net_run' wrapper

Using shell redirection under wrapper is quite tricky if possible at all.

Nikita



More information about the ltp mailing list