create_test_...with_mapping(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ create_test_...with_mapping(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” this is the little corner of the kernel docs about create_test_user_ns_with_mapping, and honestly? it's giving "tiny helper, huge main character energy" πŸ’… let's get into it 🫢


🌸 NAME 🌸

create_test_user_ns_with_mapping β€” makes you a mock user namespace with a UID mapping, no cap πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct user_namespace * create_test_user_ns_with_mapping (struct kunit
*test , struct user_namespace *parent_ns , kuid_t mapped_kuid );

like, that's the whole vibe. three args, one pointer back. slay ✨


πŸ’– ARGUMENTS πŸ’–

  • test β€” the KUnit test context, aka where the test framework keeps its stuff 🧚
  • parent_ns β€” the parent namespace (typically init_user_ns, iykyk) πŸ‘‘
  • mapped_kuid β€” the kuid that uid 0 in this namespace maps to over in the parent 🌈

πŸ”₯ DESCRIPTION πŸ”₯

It creates a minimal user namespace structure for testing, where uid 0 in the namespace maps to a specific kuid in the parent namespace. that's the whole job, and it does it flawlessly, periodt πŸ’… literally minimal, literally on purpose.


⭐ RETURN ⭐

Returns a pointer to the allocated namespace β€” or NULL on failure 😭 so like, check it, bestie, don't just vibe forward blindly πŸ™ˆ


πŸŽ€ SEE ALSO πŸŽ€

Kernel file ./security/commoncap_test.c β€” the source of truth, go look πŸ¦‹


πŸ’€ reminder: these are the sibling tests, so if you're deep in ./security and commoncap_test.c, you're exactly where you're supposed to be πŸ’œ

mwah, that's the page πŸ’– brought to you from ./security, dated October 2026, and yeah the manual name is Kernel API Manual β€” now go write that test, bestie, you've got this πŸŒΈπŸŽ€βœ¨

πŸ“¦ where this page comes from