diff options
author | Pavel Reichl <preichl@redhat.com> | 2022-12-20 14:13:29 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2023-03-20 16:32:10 +0000 |
commit | c076dff259e99d84d3822b4d2ad7f3f66532f411 (patch) | |
tree | 0f3d5a57ab30cbc3ba39b7cd54091f2547772908 /tests/features/builtin_trusted/runtest.sh | |
parent | 2939c50f7fdd0105e3ddcafab525bfa32c34981c (diff) | |
download | keyutils-master.tar.gz |
Some test results are dependent on the kernel configuration option
CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE.
Check the kernel configuration file for its presence and expect appropriate
test results.
Function has_kernel_config is based on its xfstsests counterpart.
Signed-off-by: Pavel Reichl <preichl@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'tests/features/builtin_trusted/runtest.sh')
-rw-r--r-- | tests/features/builtin_trusted/runtest.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/features/builtin_trusted/runtest.sh b/tests/features/builtin_trusted/runtest.sh index 27910b5..6bd073b 100644 --- a/tests/features/builtin_trusted/runtest.sh +++ b/tests/features/builtin_trusted/runtest.sh @@ -33,7 +33,11 @@ expect_error EACCES create_key --fail user a a $stk expect_error EOPNOTSUPP create_key --fail user a a $blk -expect_error EACCES +if has_kernel_config "CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE"; then + expect_error EOPNOTSUPP +else + expect_error EACCES +fi # Try adding a key to the keyrings marker "TRY ADDING ASYMMETRIC KEYS" @@ -89,7 +93,11 @@ expect_error EACCES create_key --fail -x asymmetric "" "$x509" $stk expect_error ENOKEY create_key --fail -x asymmetric "" "$x509" $blk -expect_error EACCES +if has_kernel_config "CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE"; then + expect_error EOPNOTSUPP +else + expect_error EACCES +fi echo "++++ FINISHED TEST: $result" >>$OUTPUTFILE |