Skip to content

Commit ee3f96b

Browse files
committed
Merge tag 'nfsd-6.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fix from Chuck Lever: - Make new GSS Kerberos Kunit tests work on non-x86 platforms * tag 'nfsd-6.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: SUNRPC: Properly terminate test case arrays SUNRPC: Let Kunit tests run with some enctypes compiled out
2 parents 92304df + fb5b855 commit ee3f96b

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

net/sunrpc/auth_gss/gss_krb5_test.c

Lines changed: 17 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);
@@ -517,6 +519,7 @@ static struct kunit_case rfc3961_test_cases[] = {
517519
.run_case = kdf_case,
518520
.generate_params = rfc3961_kdf_gen_params,
519521
},
522+
{}
520523
};
521524

522525
static struct kunit_suite rfc3961_suite = {
@@ -725,7 +728,8 @@ static void rfc3962_encrypt_case(struct kunit *test)
725728

726729
/* Arrange */
727730
gk5e = gss_krb5_lookup_enctype(param->enctype);
728-
KUNIT_ASSERT_NOT_NULL(test, gk5e);
731+
if (!gk5e)
732+
kunit_skip(test, "Encryption type is not available");
729733

730734
cbc_tfm = crypto_alloc_sync_skcipher(gk5e->aux_cipher, 0, 0);
731735
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);
@@ -777,6 +781,7 @@ static struct kunit_case rfc3962_test_cases[] = {
777781
.run_case = rfc3962_encrypt_case,
778782
.generate_params = rfc3962_encrypt_gen_params,
779783
},
784+
{}
780785
};
781786

782787
static struct kunit_suite rfc3962_suite = {
@@ -1319,7 +1324,8 @@ static void rfc6803_encrypt_case(struct kunit *test)
13191324

13201325
/* Arrange */
13211326
gk5e = gss_krb5_lookup_enctype(param->enctype);
1322-
KUNIT_ASSERT_NOT_NULL(test, gk5e);
1327+
if (!gk5e)
1328+
kunit_skip(test, "Encryption type is not available");
13231329

13241330
usage.data[3] = param->constant;
13251331

@@ -1411,6 +1417,7 @@ static struct kunit_case rfc6803_test_cases[] = {
14111417
.run_case = rfc6803_encrypt_case,
14121418
.generate_params = rfc6803_encrypt_gen_params,
14131419
},
1420+
{}
14141421
};
14151422

14161423
static struct kunit_suite rfc6803_suite = {
@@ -1810,7 +1817,8 @@ static void rfc8009_encrypt_case(struct kunit *test)
18101817

18111818
/* Arrange */
18121819
gk5e = gss_krb5_lookup_enctype(param->enctype);
1813-
KUNIT_ASSERT_NOT_NULL(test, gk5e);
1820+
if (!gk5e)
1821+
kunit_skip(test, "Encryption type is not available");
18141822

18151823
*(__be32 *)usage.data = cpu_to_be32(2);
18161824

@@ -1902,6 +1910,7 @@ static struct kunit_case rfc8009_test_cases[] = {
19021910
.run_case = rfc8009_encrypt_case,
19031911
.generate_params = rfc8009_encrypt_gen_params,
19041912
},
1913+
{}
19051914
};
19061915

19071916
static struct kunit_suite rfc8009_suite = {
@@ -1975,7 +1984,8 @@ static void encrypt_selftest_case(struct kunit *test)
19751984

19761985
/* Arrange */
19771986
gk5e = gss_krb5_lookup_enctype(param->enctype);
1978-
KUNIT_ASSERT_NOT_NULL(test, gk5e);
1987+
if (!gk5e)
1988+
kunit_skip(test, "Encryption type is not available");
19791989

19801990
cbc_tfm = crypto_alloc_sync_skcipher(gk5e->aux_cipher, 0, 0);
19811991
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, cbc_tfm);
@@ -2023,6 +2033,7 @@ static struct kunit_case encryption_test_cases[] = {
20232033
.run_case = encrypt_selftest_case,
20242034
.generate_params = encrypt_selftest_gen_params,
20252035
},
2036+
{}
20262037
};
20272038

20282039
static struct kunit_suite encryption_test_suite = {

0 commit comments

Comments
 (0)