* [PATCH net-next v2] NFC: nci: Extend virtual NCI deinit test
@ 2022-11-17 16:21 Dmitry Vyukov
2022-11-21 11:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Vyukov @ 2022-11-17 16:21 UTC (permalink / raw)
To: pabeni, bongsu.jeon, krzysztof.kozlowski, netdev
Cc: syzkaller, Dmitry Vyukov, Jakub Kicinski
Extend the test to check the scenario when NCI core tries to send data
to already closed device to ensure that nothing bad happens.
Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Bongsu Jeon <bongsu.jeon@samsung.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org
---
Changes in v2:
- use C multi-line comment style instead of C++ style
---
tools/testing/selftests/nci/nci_dev.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/testing/selftests/nci/nci_dev.c b/tools/testing/selftests/nci/nci_dev.c
index 162c41e9bcae8..1562aa7d60b0f 100644
--- a/tools/testing/selftests/nci/nci_dev.c
+++ b/tools/testing/selftests/nci/nci_dev.c
@@ -888,6 +888,17 @@ TEST_F(NCI, deinit)
&msg);
ASSERT_EQ(rc, 0);
EXPECT_EQ(get_dev_enable_state(&msg), 0);
+
+ /* Test that operations that normally send packets to the driver
+ * don't cause issues when the device is already closed.
+ * Note: the send of NFC_CMD_DEV_UP itself still succeeds it's just
+ * that the device won't actually be up.
+ */
+ close(self->virtual_nci_fd);
+ self->virtual_nci_fd = -1;
+ rc = send_cmd_with_idx(self->sd, self->fid, self->pid,
+ NFC_CMD_DEV_UP, self->dev_idex);
+ EXPECT_EQ(rc, 0);
}
TEST_HARNESS_MAIN
base-commit: f12ed9c04804eec4f1819097a0fd0b4800adac2f
prerequisite-patch-id: 214c5357c652cee65ee803d0f45f4b15cfcc9861
--
2.38.1.431.g37b22c650d-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next v2] NFC: nci: Extend virtual NCI deinit test
2022-11-17 16:21 [PATCH net-next v2] NFC: nci: Extend virtual NCI deinit test Dmitry Vyukov
@ 2022-11-21 11:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-21 11:00 UTC (permalink / raw)
To: Dmitry Vyukov
Cc: pabeni, bongsu.jeon, krzysztof.kozlowski, netdev, syzkaller, kuba
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Thu, 17 Nov 2022 17:21:01 +0100 you wrote:
> Extend the test to check the scenario when NCI core tries to send data
> to already closed device to ensure that nothing bad happens.
>
> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
> Cc: Bongsu Jeon <bongsu.jeon@samsung.com>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: netdev@vger.kernel.org
>
> [...]
Here is the summary with links:
- [net-next,v2] NFC: nci: Extend virtual NCI deinit test
https://git.kernel.org/netdev/net-next/c/d9e8da558580
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-21 11:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17 16:21 [PATCH net-next v2] NFC: nci: Extend virtual NCI deinit test Dmitry Vyukov
2022-11-21 11:00 ` patchwork-bot+netdevbpf
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).