]> git.baikalelectronics.ru Git - kernel.git/commitdiff
selftests: mptcp: clean tmp files in simult_flows
authorMatthieu Baerts <matthieu.baerts@tessares.net>
Wed, 1 Sep 2021 17:15:37 +0000 (10:15 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 1 Sep 2021 17:55:49 +0000 (10:55 -0700)
'$cin' and '$sin' variables are local to a function: they are then not
available from the cleanup trap.

Instead, we need to use '$large' and '$small' that are not local and
defined just before setting the trap.

Without this patch, running this script in a loop might cause a:

  write: No space left on device

issue.

Fixes: 1a418cb8e888 ("mptcp: simult flow self-tests")
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/simult_flows.sh

index fd63ebfe9a2b72112c73e65d2f7349956aadbb60..910d8126af8f29d2eac7fae645e91abeff0ffd06 100755 (executable)
@@ -22,8 +22,8 @@ usage() {
 
 cleanup()
 {
-       rm -f "$cin" "$cout"
-       rm -f "$sin" "$sout"
+       rm -f "$cout" "$sout"
+       rm -f "$large" "$small"
        rm -f "$capout"
 
        local netns