@@ -8,11 +8,14 @@
cleanup()
{
- sysctl -q -w net.core.busy_read=$busy_read_old
- sysctl -q -w net.core.busy_poll=$busy_poll_old
-
- tst_rhost_run -c "sysctl -q -w net.core.busy_read=$rbusy_read_old"
- tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
+ [ -n "$busy_read_old" ] && \
+ sysctl -q -w net.core.busy_read=$busy_read_old
+ [ -n "$busy_poll_old" ] && \
+ sysctl -q -w net.core.busy_poll=$busy_poll_old
+ [ -n "$rbusy_read_old" ] && \
+ tst_rhost_run -c "sysctl -q -w net.core.busy_read=$rbusy_read_old"
+ [ -n "$rbusy_poll_old" ] && \
+ tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
}
set_busy_poll()
@@ -8,8 +8,10 @@
cleanup()
{
- sysctl -q -w net.core.busy_poll=$busy_poll_old
- tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
+ [ -n "$busy_poll_old" ] && \
+ sysctl -q -w net.core.busy_poll=$busy_poll_old
+ [ -n "$rbusy_poll_old" ] && \
+ tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
}
set_busy_poll()
@@ -10,8 +10,10 @@ TST_TEST_DATA="udp udp_lite"
cleanup()
{
- sysctl -q -w net.core.busy_poll=$busy_poll_old
- tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
+ [ -n "$busy_poll_old" ] && \
+ sysctl -q -w net.core.busy_poll=$busy_poll_old
+ [ -n "$rbusy_poll_old" ] && \
+ tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
}
set_busy_poll()
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com> --- testcases/network/busy_poll/busy_poll01.sh | 13 ++++++++----- testcases/network/busy_poll/busy_poll02.sh | 6 ++++-- testcases/network/busy_poll/busy_poll03.sh | 6 ++++-- 3 files changed, 16 insertions(+), 9 deletions(-)