Skip to contentSkip to conversation

testsuite/smokey: Fixing a registry leak of the posix_select test

PATCH Applied Florian Bezdeka 2 participants 2 messages Aug 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 testsuite/smokey: Fixing a registry leak of the posix_select test

According to POSIX message queues have kernel persistence, which means they are not cleaned up until the next reboot.

The test has a mq_unlink() as "precondition", so it will clean up failed test runs silently but /proc/xenomai/registry/usage will still report a "leak" once the test has completed.

---
 testsuite/smokey/posix-select/posix-select.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
testsuite/smokey/posix-select/posix-select.c +3 -1
index e9bf938b3..1484fa639 100644
@@ -140,6 +140,8 @@ static int run_posix_select(struct smokey_test *t, int argc, char *const argv[])
 	ret = test_status;
 out:
 	pthread_join(tcb, NULL);
-	
+
+	mq_unlink("/select_test_mq");
+
 	return ret;
 }
Signature · 1 line
2.30.2
Applied
#1 lore raw
Quoted 18 lines · Florian Bezdeka

According to POSIX message queues have kernel persistence, which means they are not cleaned up until the next reboot.

The test has a mq_unlink() as "precondition", so it will clean up failed test runs silently but /proc/xenomai/registry/usage will still report a "leak" once the test has completed.

---
 testsuite/smokey/posix-select/posix-select.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
testsuite/smokey/posix-select/posix-select.c +0 -0
index e9bf938b3..1484fa639 100644

testsuite/smokey/posix-select/posix-select.c static int run_posix_select(struct smokey_test *t, int argc, char *const argv[]) · line 147

Quoted 9 lines
testsuite/smokey/posix-select/posix-select.c +3 -1
@@ -140,6 +140,8 @@ static int run_posix_select(struct smokey_test *t, int argc, char *const argv[])
 	ret = test_status;
 out:
 	pthread_join(tcb, NULL);
-	
+
+	mq_unlink("/select_test_mq");
+
 	return ret;
 }

Thanks, applied.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux