Skip to content

Commit fe90151

Browse files
committed
SUNRPC: Let Kunit tests run with some enctypes compiled out
Allow the new GSS Kerberos encryption type test suites to run outside of the kunit infrastructure. Replace the assertion that fires when lookup_enctype() so that the case is skipped instead of failing outright. Reported-by: Geert Uytterhoeven <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 4b471a8 commit fe90151

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

net/sunrpc/auth_gss/gss_krb5_test.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ static void kdf_case(struct kunit *test)
4949

5050
/* Arrange */
5151
gk5e = gss_krb5_lookup_enctype(param->enctype);
52-
KUNIT_ASSERT_NOT_NULL(test, gk5e);
52+
if (!gk5e)
53+
kunit_skip(test, "Encryption type is not available");
5354

5455
derivedkey.data = kunit_kzalloc(test, param->expected_result->len,
5556
GFP_KERNEL);
@@ -83,7 +84,8 @@ static void checksum_case(struct kunit *test)
8384

8485
/* Arrange */
8586
gk5e = gss_krb5_lookup_enctype(param->enctype);
86-
KUNIT_ASSERT_NOT_NULL(test, gk5e);
87+
if (!gk5e)
88+
kunit_skip(test, "Encryption type is not available");
8789

8890
Kc.len = gk5e->Kc_length;
8991
Kc.data = kunit_kzalloc(test, Kc.len, GFP_KERNEL);
@@ -725,7 +727,8 @@ static void rfc3962_encrypt_case(struct kunit *test)
725727

726728
/* Arrange */
727729
gk5e = gss_krb5_lookup_enctype(param->enctype);
728-
KUNIT_ASSERT_NOT_NULL(test, gk5e);
730+
if (!gk5e)
731+
kunit_skip(test, "Encryption type is not available");
729732

730733
cbc_tfm = crypto_alloc_sync_skcipher(gk5e->aux_cipher, 0, 0);
731734
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);
@@ -1319,7 +1322,8 @@ static void rfc6803_encrypt_case(struct kunit *test)
13191322

13201323
/* Arrange */
13211324
gk5e = gss_krb5_lookup_enctype(param->enctype);
1322-
KUNIT_ASSERT_NOT_NULL(test, gk5e);
1325+
if (!gk5e)
1326+
kunit_skip(test, "Encryption type is not available");
13231327

13241328
usage.data[3] = param->constant;
13251329

@@ -1810,7 +1814,8 @@ static void rfc8009_encrypt_case(struct kunit *test)
18101814

18111815
/* Arrange */
18121816
gk5e = gss_krb5_lookup_enctype(param->enctype);
1813-
KUNIT_ASSERT_NOT_NULL(test, gk5e);
1817+
if (!gk5e)
1818+
kunit_skip(test, "Encryption type is not available");
18141819

18151820
*(__be32 *)usage.data = cpu_to_be32(2);
18161821

@@ -1975,7 +1980,8 @@ static void encrypt_selftest_case(struct kunit *test)
19751980

19761981
/* Arrange */
19771982
gk5e = gss_krb5_lookup_enctype(param->enctype);
1978-
KUNIT_ASSERT_NOT_NULL(test, gk5e);
1983+
if (!gk5e)
1984+
kunit_skip(test, "Encryption type is not available");
19791985

19801986
cbc_tfm = crypto_alloc_sync_skcipher(gk5e->aux_cipher, 0, 0);
19811987
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);

0 commit comments

Comments
 (0)