Skip to contentSkip to conversation

Add shutdown02 test

PATCH Applied Andrea Cervesato 2 participants 2 messages Jun 10, 2024 – Jun 14, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Add shutdown02 test

From: Andrea Cervesato <[email protected]>

This test verifies the following shutdown() errors:

- EBADF sockfd is not a valid file descriptor
- EINVAL An invalid value was specified in how
- ENOTCONN The specified socket is not connected
- ENOTSOCK The file descriptor sockfd does not refer to a socket

---
This testing suite is meant to test shutdown() syscall functionalities. The current LTP version uses shutdown() inside many tests, but none of them is specifically running unit tests for it.

This suite comes with both unit tests for shutdown() flags and error codes.
---
Changes in v3:
- shutdown02: fix file descriptors initialization
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- shutdown01: move test cases inside .test / .tcnt
- shutdown01: usage of SAFE_RECV / SAFE_SEND
- shutdown01: fixed documentation formatting
- shutdown02: fixed documentation formatting
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 runtest/syscalls                                |  1 +
 testcases/kernel/syscalls/shutdown/.gitignore   |  1 +
 testcases/kernel/syscalls/shutdown/shutdown02.c | 76 +++++++++++++++++++++++++
 3 files changed, 78 insertions(+)
runtest/syscalls +1 -0
index dc396415e..44a577db3 100644
@@ -1466,6 +1466,7 @@ shmget05 shmget05
 shmget06 shmget06
 
 shutdown01 shutdown01
+shutdown02 shutdown02
 
 sigaction01 sigaction01
 sigaction02 sigaction02
testcases/kernel/syscalls/shutdown/.gitignore +1 -0
index 2df24d1ab..fd1ed807d 100644
@@ -1 +1,2 @@
 shutdown01
+shutdown02
testcases/kernel/syscalls/shutdown/shutdown02.c new file +76 -0

76 lines not on this page · raw message

---
base-commit: 998df1a5aa5026c5c9b91b0caa3b1188146aa678
change-id: 20240524-shutdown-c8d7580e916a

Best regards,

Signature · 5 lines
Andrea Cervesato <[email protected]>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Applied
#1 lore raw

Hi Andrea,

merged, thanks!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp