Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: posix: common: split XSI_REALTIME to standalone test #81859

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pancakem
Copy link
Contributor

@Pancakem Pancakem commented Nov 25, 2024

Fixes #83634

posix.common contains testsuites that can be separated into smaller groups of tests.

This change moves XSI_REALTIME tests into a singular testsuite at tests/posix/xsi_realtime app directory.

@zephyrbot zephyrbot added the area: POSIX POSIX API Library label Nov 25, 2024
@zephyrbot zephyrbot requested review from cfriedt and ycsin November 25, 2024 10:30
@cfriedt
Copy link
Member

cfriedt commented Nov 25, 2024

This is a tricky one.

_POSIX_MESSAGE_PASSING is an Option and not an Option Group.

At some point, it would be nice if the standards body made it a proper Option Group.

Maybe it's best to keep it in common for now? What do you think @ycsin ?

@cfriedt
Copy link
Member

cfriedt commented Nov 25, 2024

Aha - found it here.

The Realtime Option Group is denoted by the symbolic constant _XOPEN_REALTIME.
...
If the symbolic constant _XOPEN_REALTIME is defined to have a value other than -1, then the following symbolic constants shall be defined by the implementation to have the value 200809L:

_POSIX_FSYNC
_POSIX_MEMLOCK
_POSIX_MEMLOCK_RANGE
_POSIX_MESSAGE_PASSING
_POSIX_PRIORITY_SCHEDULING
_POSIX_SHARED_MEMORY_OBJECTS
_POSIX_SYNCHRONIZED_IO

Aside from _POSIX_SHARED_MEMORY_OBJECTS implying the existence of shm_open() and shm_unlink() (mmap(), and munmap() are already covered by POSIX_MAPPED_FILES)

Most of these options (including _POSIX_FSYNC), are not owned by a proper POSIX or XSI Option Group.

So I woulud say that we need to define at least one additional Option Group.

Based on existing naming conventions, for the _XOPEN_REALTIME Option, there should be a corresponding XSI_REALTIME Option Group. A few of these XSI Option Groups have a mention in the spec, but no explicit definition in Subprofiling Considerations.

So @Pancakem - can you please

  1. rename message_passing to xsi_realtime in this PR?
  2. colocate the existing shm testsuite into the new xsi_realtime suite

There may be other existing tests that should be moved, but I have to get to some other things atm.

@ycsin - if you have time at some point, can you please create an issue to create the XSI_REALTIME option group? For that issue, we should look at folding Kconfig.sync_io, Kconfig.mqueue, and parts of Kconfig.mem into Kconfig.xsi_realtime?

@ycsin
Copy link
Member

ycsin commented Nov 26, 2024

@ycsin - if you have time at some point, can you please create an issue to create the XSI_REALTIME option group?

#82004

@Pancakem Pancakem force-pushed the separate_posix_message_passing_into_standalone_test branch from ea46918 to a623aa3 Compare November 27, 2024 13:02
@cfriedt
Copy link
Member

cfriedt commented Nov 27, 2024

We should wait to merge this until 82004 is done

@cfriedt
Copy link
Member

cfriedt commented Dec 21, 2024

@Pancakem - #83303 should add the missing option group, and then that will unblock you in this PR.

@Pancakem Pancakem force-pushed the separate_posix_message_passing_into_standalone_test branch from 72b63e5 to c5fa3a2 Compare January 6, 2025 07:44
@@ -6,14 +6,14 @@
*/

#include <fcntl.h>
#include <mqueue.h>
#include <message_passing.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was a bit of a hasty search + replace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the rebased off an older iteration of the work. Fixing it.

pthread_exit(p1);
return NULL;
}

ZTEST(mqueue, test_mqueue)
ZTEST(message_passing, test_message_passing)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the testsuite name should change here, not the test name, here and in other tests

@@ -40,13 +40,11 @@ static void *sender_thread(void *p1)
zassert_false(mq_timedsend(mqd, send_data, MESSAGE_SIZE, 0, &curtime),
"Not able to send message in timer");
usleep(USEC_PER_MSEC);
zassert_false(mq_close(mqd),
"unable to close message queue descriptor.");
zassert_false(mq_close(mqd), "unable to close message queue descriptor.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If CI doesn't complain, I think my preference would be to omit unnecessary formatting changes.

zassert_equal(errno, ENOSYS);

not.sigev_notify = SIGEV_NONE;
not .sigev_notify = SIGEV_NONE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong

@Pancakem Pancakem force-pushed the separate_posix_message_passing_into_standalone_test branch 2 times, most recently from 44311c6 to ea4b831 Compare January 6, 2025 12:17
@cfriedt cfriedt changed the title tests: posix: common: separate posix message passing to standalone test tests: posix: common: split XSI_REALTIME to standalone test Jan 7, 2025
@cfriedt
Copy link
Member

cfriedt commented Jan 7, 2025

@Pancakem - can you please move tests related to the following, into a new xsi_realtime testsuite?

_POSIX_FSYNC
_POSIX_MEMLOCK
_POSIX_MEMLOCK_RANGE
_POSIX_MESSAGE_PASSING
_POSIX_PRIORITY_SCHEDULING
_POSIX_SHARED_MEMORY_OBJECTS
_POSIX_SYNCHRONIZED_IO

@Pancakem
Copy link
Contributor Author

Pancakem commented Jan 7, 2025

@Pancakem - can you please move tests related to the following, into a new xsi_realtime testsuite?

_POSIX_FSYNC
_POSIX_MEMLOCK
_POSIX_MEMLOCK_RANGE
_POSIX_MESSAGE_PASSING
_POSIX_PRIORITY_SCHEDULING
_POSIX_SHARED_MEMORY_OBJECTS
_POSIX_SYNCHRONIZED_IO

Alright on it.

@Pancakem
Copy link
Contributor Author

Pancakem commented Jan 8, 2025

@cfriedt should posix/fs also move into this since fsync and fdatasync are tested in it?

@cfriedt
Copy link
Member

cfriedt commented Jan 8, 2025

@cfriedt should posix/fs also move into this since fsync and fdatasync are tested in it?

@Pancakem - no, just move the fsync and fdatasync tests. We want to organize suites by Option Group, and POSIX_FILE_SYSTEM tests should remain here.

@Pancakem Pancakem marked this pull request as draft January 8, 2025 13:06
posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves mqueue into a singular
testsuite at tests/posix/message_passing app directory.

Signed-off-by: Marvin Ouma <[email protected]>
@Pancakem Pancakem force-pushed the separate_posix_message_passing_into_standalone_test branch from ea4b831 to 438836e Compare January 8, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests: posix: common: split XSI_REALTIME tests to standalone testsuite
4 participants