<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/lib/tests/uuid_kunit.c, branch v7.2-rc2</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc2</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.2-rc2'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-05-29T04:24:58+00:00</updated>
<entry>
<title>lib/uuid_kunit: add tests for the four random UUID/GUID generators</title>
<updated>2026-05-29T04:24:58+00:00</updated>
<author>
<name>Stepan Ionichev</name>
<email>sozdayvek@gmail.com</email>
</author>
<published>2026-05-16T12:09:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2e73ea35a5dbe7e258b7fd396bcb100fa154f029'/>
<id>urn:sha1:2e73ea35a5dbe7e258b7fd396bcb100fa154f029</id>
<content type='text'>
uuid_kunit currently exercises only guid_parse() and uuid_parse() (plus
their invalid-input paths).  The four random generators exported from
lib/uuid.c -- generate_random_uuid(), generate_random_guid(), uuid_gen()
and guid_gen() -- have no direct kunit coverage.

Random output cannot be compared against a fixed expected value, but RFC
4122 section 4.4 specifies two invariants that any version-4 random
UUID/GUID must satisfy:

  - version 4 in the high nibble of the version byte
    (byte 6 in the wire uuid_t layout, byte 7 in the byte-swapped
    guid_t layout);
  - variant DCE 1.1 (binary 10x) in the high bits of byte 8.

Add four test cases that invoke each generator several times and verify
these bit patterns hold.  The same checks catch a regression in either the
mask/OR sequence in the generators or the layout constants.  Run the loop
a handful of times to cover the small but non-zero chance that an unmasked
random byte happens to satisfy the version/variant pattern by accident on
a single call.

Link: https://lore.kernel.org/20260516120915.40544-1-sozdayvek@gmail.com
Signed-off-by: Stepan Ionichev &lt;sozdayvek@gmail.com&gt;
Acked-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: Brendan Higgins &lt;brendan.higgins@linux.dev&gt;
Cc: David Gow &lt;david@davidgow.net&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/tests: convert test_uuid module to KUnit</title>
<updated>2026-01-21T03:44:18+00:00</updated>
<author>
<name>Ryota Sakamoto</name>
<email>sakamo.ryota@gmail.com</email>
</author>
<published>2025-12-15T13:43:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6dcd539f062d89127cb3a84a7da373a9bd28ba7b'/>
<id>urn:sha1:6dcd539f062d89127cb3a84a7da373a9bd28ba7b</id>
<content type='text'>
Move lib/test_uuid.c to lib/tests/uuid_kunit.c and convert it to use KUnit.

This change switches the ad-hoc test code to standard KUnit test cases. 
The test data remains the same, but the verification logic is updated to
use KUNIT_EXPECT_* macros.

Also remove CONFIG_TEST_UUID from arch/*/configs/* because it is no longer
used.  The new CONFIG_UUID_KUNIT_TEST will be automatically enabled by
CONFIG_KUNIT_ALL_TESTS.

[lukas.bulwahn@redhat.com: MAINTAINERS: adjust file entry in UUID HELPERS]
  Link: https://lkml.kernel.org/r/20251217053907.2778515-1-lukas.bulwahn@redhat.com
Link: https://lkml.kernel.org/r/20251215134322.12949-1-sakamo.ryota@gmail.com
Signed-off-by: Ryota Sakamoto &lt;sakamo.ryota@gmail.com&gt;
Signed-off-by: Lukas Bulwahn &lt;lukas.bulwahn@redhat.com&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Cc: Andriy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: Brendan Higgins &lt;brendan.higgins@linux.dev&gt;
Cc: Lukas Bulwahn &lt;lukas.bulwahn@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
</content>
</entry>
</feed>
