summaryrefslogtreecommitdiff
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2023-02-27 10:58:34 -0500
committerChuck Lever <chuck.lever@oracle.com>2023-02-27 16:26:48 -0500
commitfe90151c3cc6dbc0836723995f65d371ef4ad514 (patch)
tree5007289b98bd743e70a3ed18773f99d9cfa08d46 /net/sunrpc/auth_gss
parent4b471a8b847b82a3035709dcf87661915c340c8a (diff)
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 <geert@linux-m68k.org> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_test.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_test.c b/net/sunrpc/auth_gss/gss_krb5_test.c
index c287ce15c419..0a7c5280e4e3 100644
--- a/net/sunrpc/auth_gss/gss_krb5_test.c
+++ b/net/sunrpc/auth_gss/gss_krb5_test.c
@@ -49,7 +49,8 @@ static void kdf_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
derivedkey.data = kunit_kzalloc(test, param->expected_result->len,
GFP_KERNEL);
@@ -83,7 +84,8 @@ static void checksum_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
Kc.len = gk5e->Kc_length;
Kc.data = kunit_kzalloc(test, Kc.len, GFP_KERNEL);
@@ -725,7 +727,8 @@ static void rfc3962_encrypt_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
cbc_tfm = crypto_alloc_sync_skcipher(gk5e->aux_cipher, 0, 0);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);
@@ -1319,7 +1322,8 @@ static void rfc6803_encrypt_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
usage.data[3] = param->constant;
@@ -1810,7 +1814,8 @@ static void rfc8009_encrypt_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
*(__be32 *)usage.data = cpu_to_be32(2);
@@ -1975,7 +1980,8 @@ static void encrypt_selftest_case(struct kunit *test)
/* Arrange */
gk5e = gss_krb5_lookup_enctype(param->enctype);
- KUNIT_ASSERT_NOT_NULL(test, gk5e);
+ if (!gk5e)
+ kunit_skip(test, "Encryption type is not available");
cbc_tfm = crypto_alloc_sync_skcipher(gk5e->aux_cipher, 0, 0);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);