Skip to content

testing/ostest: multiuser coverage for supplementary groups and setresuid - #3714

Merged
acassis merged 2 commits into
apache:masterfrom
Abhishekmishra2808:feature/supp-groups-and-sudo
Aug 14, 2026
Merged

testing/ostest: multiuser coverage for supplementary groups and setresuid#3714
acassis merged 2 commits into
apache:masterfrom
Abhishekmishra2808:feature/supp-groups-and-sudo

Conversation

@Abhishekmishra2808

@Abhishekmishra2808 Abhishekmishra2808 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Expand testing/ostest/multiuser.c for the POSIX credential APIs added in the kernel PR
  • Add tests for supplementary groups, setresuid/setresgid ordering, getresuid/setreuid, and saved set-UID/GID child semantics
  • Added nsh# for root and nsh$ for user (when login enabled); otherwise, nsh>
  • Depends on the companion nuttx PR sched: supplementary groups and setresuid/setresgid nuttx#19767

Impact

This change only extends testing/ostest/multiuser.c to exercise the new kernel credential APIs. It adds coverage for supplementary groups, setresuid/setresgid drop ordering, getresuid/setreuid, and saved set-UID/GID behavior in a child task. Builds without CONFIG_SCHED_USER_IDENTITY are unchanged.

Testing

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena     3effff8  3effff8
ordblks         6        6
mxordblk  3eaaa90  3eaaa90
uordblks    45958    45958
fordblks  3eba6a0  3eba6a0

user_main: scheduler lock test
sched_lock: Starting lowpri_thread at 97
sched_lock: Set lowpri_thread priority to 97
sched_lock: Starting highpri_thread at 98
sched_lock: Set highpri_thread priority to 98
sched_lock: Waiting...
sched_lock: PASSED No pre-emption occurred while scheduler was locked.
sched_lock: Starting lowpri_thread at 97
sched_lock: Set lowpri_thread priority to 97
sched_lock: Starting highpri_thread at 98
sched_lock: Set highpri_thread priority to 98
sched_lock: Waiting...
sched_lock: PASSED No pre-emption occurred while scheduler was locked.
sched_lock: Finished

End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena     3effff8  3effff8
ordblks         6        6
mxordblk  3eaaa90  3eaaa90
uordblks    45958    45958
fordblks  3eba6a0  3eba6a0

Final memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena     3effff8  3effff8
ordblks         2        6
mxordblk  3eaaa90  3eaaa90
uordblks    45320    45958
fordblks  3ebacd8  3eba6a0
user_main: Exiting
ostest_main: Exiting with status 0
abhishek@Lethallaptop:~/nuttx$ 

@xiaoxiang781216

Copy link
Copy Markdown
Contributor

@Abhishekmishra2808 please fix ci warning and pr title/description

@Abhishekmishra2808
Abhishekmishra2808 force-pushed the feature/supp-groups-and-sudo branch from 6c7b378 to 4cf5292 Compare August 12, 2026 07:05
@Abhishekmishra2808 Abhishekmishra2808 changed the title nshlib: hard/soft credential drop and sudo via PR_NSHCRED_AUTHSETEID testing/ostest: multiuser coverage for supplementary groups and setresuid Aug 12, 2026
Comment thread nshlib/nsh_session.c Outdated
@Abhishekmishra2808
Abhishekmishra2808 force-pushed the feature/supp-groups-and-sudo branch 2 times, most recently from fbe1485 to b07c609 Compare August 12, 2026 18:52
@linguini1

Copy link
Copy Markdown
Contributor

Please add a log of your additional OSTest suite passing.

Add supplementary-group, setresuid/setresgid ordering, and saved
set-UID/GID child tests for the POSIX credential APIs.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
When NSH_PROMPT_STRING_ROOT/USER are empty, keep NSH_PROMPT_STRING at
boot (for example, "nsh> ") so CI/NTFC boot detection still works.
After login, su, or telnet login, replace the last '>' with '#' (euid 0)
or '$' (non-zero euid) and ensure a trailing space.  Refresh readline
after console/telnet login when line editing is enabled.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
@Abhishekmishra2808
Abhishekmishra2808 force-pushed the feature/supp-groups-and-sudo branch from b07c609 to c67b8bc Compare August 13, 2026 21:00
@Abhishekmishra2808

Copy link
Copy Markdown
Contributor Author

@linguini1 PTAL at the updated testing logs

@acassis
acassis merged commit 0faa02f into apache:master Aug 14, 2026
26 of 53 checks passed
@raiden00pl

raiden00pl commented Aug 14, 2026

Copy link
Copy Markdown
Member

@acassis why this was merged ? CI is now broken ...

@linguini1

Copy link
Copy Markdown
Contributor

The test logs don't even show the multi user test, they show a scheduler lock test. @Abhishekmishra2808

@acassis

acassis commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

@acassis why this was merged ? CI is now broken ...

The issue was not related to this PR

@raiden00pl

Copy link
Copy Markdown
Member

@acassis are you sure? What about this commit: c67b8bc

@acassis

acassis commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

@raiden00pl yes, I only saw the issue with toybox defconfig, but that was because it was not normalized

@raiden00pl

Copy link
Copy Markdown
Member

c67b8bc has broken NTFC and it is visible in CI for this PR: https://github.com/apache/nuttx-apps/actions/runs/31743634370/job/94593362401

@raiden00pl

Copy link
Copy Markdown
Member

@acassis this is probably the reason #3690 (comment) CI for apps is broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants