diff options
author | Daiki Ueno <dueno@redhat.com> | 2018-04-10 09:47:24 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2018-04-10 17:57:11 +0200 |
commit | e4b86e449a83428592e45db28834be950e837d74 (patch) | |
tree | c73c740a83ae0f1c6b1e4df3a044ab23b11161ad | |
parent | 5d97643884879d4967d21cb29c9917271a4b65db (diff) |
test: Add installcheck script to test trust module
Currently it only checks that "disable-in: p11-kit-proxy" properly
prevents the trust module being loaded by the proxy module.
-rw-r--r-- | trust/Makefile.am | 4 | ||||
-rw-r--r-- | trust/test-trust.sh | 21 |
2 files changed, 24 insertions, 1 deletions
diff --git a/trust/Makefile.am b/trust/Makefile.am index dfc64eb..cb9de25 100644 --- a/trust/Makefile.am +++ b/trust/Makefile.am @@ -303,15 +303,17 @@ frob_token_SOURCES = trust/frob-token.c frob_token_LDADD = $(trust_LIBS) frob_token_CFLAGS = $(trust_CFLAGS) -noinst_SCRIPTS += trust/test-extract.sh +noinst_SCRIPTS += trust/test-extract.sh trust/test-trust.sh if !OS_WIN32 installcheck-local: builddir="$(abs_top_builddir)/trust" $(SHELL) $(srcdir)/trust/test-extract.sh + builddir="$(abs_top_builddir)/trust" $(SHELL) $(srcdir)/trust/test-trust.sh endif EXTRA_DIST += \ trust/input \ trust/fixtures \ trust/test-extract.sh \ + trust/test-trust.sh \ $(NULL) diff --git a/trust/test-trust.sh b/trust/test-trust.sh new file mode 100644 index 0000000..03f2988 --- /dev/null +++ b/trust/test-trust.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +. "${builddir=.}/test-init.sh" + +test_disable_in_proxy() +{ + : ${PKCS11_TOOL=pkcs11-tool} + if ! (type ${PKCS11_TOOL}) > /dev/null 2>&1; then + skip "pkcs11-tool not found" + fi + : ${PKG_CONFIG=pkg-config} + if ! (type ${PKG_CONFIG}) > /dev/null 2>&1; then + skip "pkg-config not found" + fi + proxy_module=$(${PKG_CONFIG} --variable=proxy_module p11-kit-1) + if ${PKCS11_TOOL} --module="$proxy_module" -T | grep '^ *token model *: *p11-kit-trust' > /dev/null 2>&1; then + assert_fail "p11-kit-trust is not disabled in proxy module" + fi +} + +run test_disable_in_proxy |