Skip to content

Commit

Permalink
selftests: mptcp: add missing oflag=append
Browse files Browse the repository at this point in the history
In mptcp_connect.sh we are missing something like "oflag=append"
because this will write "${rem}" bytes at the beginning of the file
where there is already some random bytes. It should write that at
the end.

This patch adds this missing 'oflag=append' flag for 'dd' command in
make_file().

Suggested-by: Matthieu Baerts <matttbe@kernel.org>
Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20231128-send-net-next-2023107-v4-12-8d6b94150f6b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Geliang Tang authored and Jakub Kicinski committed Nov 30, 2023
1 parent 61c131f commit 119931c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/net/mptcp/mptcp_connect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ make_file()
rem=$((SIZE - (ksize * 1024)))

dd if=/dev/urandom of="$name" bs=1024 count=$ksize 2> /dev/null
dd if=/dev/urandom conv=notrunc of="$name" bs=1 count=$rem 2> /dev/null
dd if=/dev/urandom conv=notrunc of="$name" oflag=append bs=1 count=$rem 2> /dev/null
echo -e "\nMPTCP_TEST_FILE_END_MARKER" >> "$name"

echo "Created $name (size $(du -b "$name")) containing data sent by $who"
Expand Down

0 comments on commit 119931c

Please sign in to comment.