netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/1] selftests:mptcp: fix failure due to whitespace damage
@ 2020-03-30 14:23 Matthieu Baerts
  2020-03-30 14:23 ` [PATCH net-next 1/1] " Matthieu Baerts
  2020-03-30 17:27 ` [PATCH net-next 0/1] " David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Matthieu Baerts @ 2020-03-30 14:23 UTC (permalink / raw)
  To: netdev, David S . Miller
  Cc: mptcp, Mat Martineau, Paolo Abeni, Florian Westphal, Matthieu Baerts

David: it seems that some trailing whitespaces were removed by one of
your scripts when applying eedbc685321b (selftests: add PM netlink
functional tests).

This causes a self test failure because the expected result in the
script has been modified.

We do think that it is best not having trailing whitespaces in the code
and that's why we are proposing here a new version without them. The
documentation also ask us not to leave unexepected trailing whitespace
at the end of lines.

But we simply want to ask you this question: Is it normal that these
trailing whitespaces are automatically removed? We understand if it is
and it would make sense somehow but just in case it is not normal, we
prefer to raise the question and avoid other people hitting the same
issue we had :)

Matthieu Baerts (1):
  selftests:mptcp: fix failure due to whitespace damage

 tools/testing/selftests/net/mptcp/pm_netlink.sh | 12 ++++++------
 tools/testing/selftests/net/mptcp/pm_nl_ctl.c   |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/1] selftests:mptcp: fix failure due to whitespace damage
  2020-03-30 14:23 [PATCH net-next 0/1] selftests:mptcp: fix failure due to whitespace damage Matthieu Baerts
@ 2020-03-30 14:23 ` Matthieu Baerts
  2020-03-30 17:27   ` David Miller
  2020-03-30 17:27 ` [PATCH net-next 0/1] " David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Matthieu Baerts @ 2020-03-30 14:23 UTC (permalink / raw)
  To: netdev, David S . Miller
  Cc: mptcp, Mat Martineau, Paolo Abeni, Florian Westphal, Matthieu Baerts

'pm_nl_ctl' was adding a trailing whitespace after having printed the
IP. But at the end, the IP element is currently always the last one.

The bash script launching 'pm_nl_ctl' had trailing whitespaces in the
expected result on purpose. But these whitespaces have been removed when
the patch has been applied upstream. To avoid trailing whitespaces in
the bash code, 'pm_nl_ctl' and expected results have now been adapted.

The MPTCP PM selftest can now pass again.

Fixes: eedbc685321b (selftests: add PM netlink functional tests)
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 tools/testing/selftests/net/mptcp/pm_netlink.sh | 12 ++++++------
 tools/testing/selftests/net/mptcp/pm_nl_ctl.c   |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh
index 8c7bd722476e..9172746b6cf0 100755
--- a/tools/testing/selftests/net/mptcp/pm_netlink.sh
+++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh
@@ -75,29 +75,29 @@ subflows 0" "defaults limits"
 ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.1
 ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.2 flags subflow dev lo
 ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.3 flags signal,backup
-check "ip netns exec $ns1 ./pm_nl_ctl get 1" "id 1 flags  10.0.1.1 " "simple add/get addr"
+check "ip netns exec $ns1 ./pm_nl_ctl get 1" "id 1 flags  10.0.1.1" "simple add/get addr"
 
 check "ip netns exec $ns1 ./pm_nl_ctl dump" \
 "id 1 flags  10.0.1.1
 id 2 flags subflow dev lo 10.0.1.2
-id 3 flags signal,backup 10.0.1.3 " "dump addrs"
+id 3 flags signal,backup 10.0.1.3" "dump addrs"
 
 ip netns exec $ns1 ./pm_nl_ctl del 2
 check "ip netns exec $ns1 ./pm_nl_ctl get 2" "" "simple del addr"
 check "ip netns exec $ns1 ./pm_nl_ctl dump" \
 "id 1 flags  10.0.1.1
-id 3 flags signal,backup 10.0.1.3 " "dump addrs after del"
+id 3 flags signal,backup 10.0.1.3" "dump addrs after del"
 
 ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.3
 check "ip netns exec $ns1 ./pm_nl_ctl get 4" "" "duplicate addr"
 
 ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.4 id 10 flags signal
-check "ip netns exec $ns1 ./pm_nl_ctl get 4" "id 4 flags signal 10.0.1.4 " "id addr increment"
+check "ip netns exec $ns1 ./pm_nl_ctl get 4" "id 4 flags signal 10.0.1.4" "id addr increment"
 
 for i in `seq 5 9`; do
 	ip netns exec $ns1 ./pm_nl_ctl add 10.0.1.$i flags signal >/dev/null 2>&1
 done
-check "ip netns exec $ns1 ./pm_nl_ctl get 9" "id 9 flags signal 10.0.1.9 " "hard addr limit"
+check "ip netns exec $ns1 ./pm_nl_ctl get 9" "id 9 flags signal 10.0.1.9" "hard addr limit"
 check "ip netns exec $ns1 ./pm_nl_ctl get 10" "" "above hard addr limit"
 
 for i in `seq 9 256`; do
@@ -110,7 +110,7 @@ id 4 flags signal 10.0.1.4
 id 5 flags signal 10.0.1.5
 id 6 flags signal 10.0.1.6
 id 7 flags signal 10.0.1.7
-id 8 flags signal 10.0.1.8 " "id limit"
+id 8 flags signal 10.0.1.8" "id limit"
 
 ip netns exec $ns1 ./pm_nl_ctl flush
 check "ip netns exec $ns1 ./pm_nl_ctl dump" "" "flush addrs"
diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
index de9209305026..b24a2f17d415 100644
--- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
+++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
@@ -335,14 +335,14 @@ static void print_addr(struct rtattr *attrs, int len)
 				error(1, errno, "wrong IP (v4) for family %d",
 				      family);
 			inet_ntop(AF_INET, RTA_DATA(attrs), str, sizeof(str));
-			printf("%s ", str);
+			printf("%s", str);
 		}
 		if (attrs->rta_type == MPTCP_PM_ADDR_ATTR_ADDR6) {
 			if (family != AF_INET6)
 				error(1, errno, "wrong IP (v6) for family %d",
 				      family);
 			inet_ntop(AF_INET6, RTA_DATA(attrs), str, sizeof(str));
-			printf("%s ", str);
+			printf("%s", str);
 		}
 		if (attrs->rta_type == MPTCP_PM_ADDR_ATTR_ID) {
 			memcpy(&id, RTA_DATA(attrs), 1);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/1] selftests:mptcp: fix failure due to whitespace damage
  2020-03-30 14:23 [PATCH net-next 0/1] selftests:mptcp: fix failure due to whitespace damage Matthieu Baerts
  2020-03-30 14:23 ` [PATCH net-next 1/1] " Matthieu Baerts
@ 2020-03-30 17:27 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2020-03-30 17:27 UTC (permalink / raw)
  To: matthieu.baerts; +Cc: netdev, mptcp, mathew.j.martineau, pabeni, fw

From: Matthieu Baerts <matthieu.baerts@tessares.net>
Date: Mon, 30 Mar 2020 16:23:53 +0200

> But we simply want to ask you this question: Is it normal that these
> trailing whitespaces are automatically removed? We understand if it is
> and it would make sense somehow but just in case it is not normal, we
> prefer to raise the question and avoid other people hitting the same
> issue we had :)

I removed them because "git am" complains when I apply your patches so
I removed them to make git happy.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 1/1] selftests:mptcp: fix failure due to whitespace damage
  2020-03-30 14:23 ` [PATCH net-next 1/1] " Matthieu Baerts
@ 2020-03-30 17:27   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-03-30 17:27 UTC (permalink / raw)
  To: matthieu.baerts; +Cc: netdev, mptcp, mathew.j.martineau, pabeni, fw

From: Matthieu Baerts <matthieu.baerts@tessares.net>
Date: Mon, 30 Mar 2020 16:23:54 +0200

> 'pm_nl_ctl' was adding a trailing whitespace after having printed the
> IP. But at the end, the IP element is currently always the last one.
> 
> The bash script launching 'pm_nl_ctl' had trailing whitespaces in the
> expected result on purpose. But these whitespaces have been removed when
> the patch has been applied upstream. To avoid trailing whitespaces in
> the bash code, 'pm_nl_ctl' and expected results have now been adapted.
> 
> The MPTCP PM selftest can now pass again.
> 
> Fixes: eedbc685321b (selftests: add PM netlink functional tests)
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-30 17:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30 14:23 [PATCH net-next 0/1] selftests:mptcp: fix failure due to whitespace damage Matthieu Baerts
2020-03-30 14:23 ` [PATCH net-next 1/1] " Matthieu Baerts
2020-03-30 17:27   ` David Miller
2020-03-30 17:27 ` [PATCH net-next 0/1] " David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).