05dbc8
From 1241f2005d08673c28a595c5a6cd61350b95a929 Mon Sep 17 00:00:00 2001
e5f6b8
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
e5f6b8
Date: Tue, 2 Jan 2018 18:13:07 +0100
e5f6b8
Subject: [PATCH] Fix pkcs11 variants atf tests
e5f6b8
e5f6b8
Add dns-pkcs11 tests Makefile to configure
e5f6b8
e5f6b8
Add pkcs11 Kyuafile, fix dh_test to pass in pkcs11 mode
e5f6b8
---
05dbc8
 configure.ac                   | 1 +
05dbc8
 lib/Kyuafile                   | 2 ++
05dbc8
 lib/dns-pkcs11/tests/dh_test.c | 3 ++-
05dbc8
 3 files changed, 5 insertions(+), 1 deletion(-)
e5f6b8
1e4169
diff --git a/configure.ac b/configure.ac
05dbc8
index d80ae31..0fb9328 100644
1e4169
--- a/configure.ac
1e4169
+++ b/configure.ac
05dbc8
@@ -3090,6 +3090,7 @@ AC_CONFIG_FILES([
e5f6b8
 	lib/dns-pkcs11/include/Makefile
e5f6b8
 	lib/dns-pkcs11/include/dns/Makefile
e5f6b8
 	lib/dns-pkcs11/include/dst/Makefile
e5f6b8
+	lib/dns-pkcs11/tests/Makefile
e5f6b8
 	lib/irs/Makefile
e5f6b8
 	lib/irs/include/Makefile
e5f6b8
 	lib/irs/include/irs/Makefile
e5f6b8
diff --git a/lib/Kyuafile b/lib/Kyuafile
05dbc8
index 39ce986..037e5ef 100644
e5f6b8
--- a/lib/Kyuafile
e5f6b8
+++ b/lib/Kyuafile
1e4169
@@ -2,8 +2,10 @@ syntax(2)
e5f6b8
 test_suite('bind9')
e5f6b8
 
e5f6b8
 include('dns/Kyuafile')
e5f6b8
+include('dns-pkcs11/Kyuafile')
e5f6b8
 include('irs/Kyuafile')
e5f6b8
 include('isc/Kyuafile')
1e4169
 include('isccc/Kyuafile')
e5f6b8
 include('isccfg/Kyuafile')
df81e8
 include('ns/Kyuafile')
05dbc8
+include('ns-pkcs11/Kyuafile')
e5f6b8
diff --git a/lib/dns-pkcs11/tests/dh_test.c b/lib/dns-pkcs11/tests/dh_test.c
05dbc8
index 934e8fd..658d1af 100644
e5f6b8
--- a/lib/dns-pkcs11/tests/dh_test.c
e5f6b8
+++ b/lib/dns-pkcs11/tests/dh_test.c
05dbc8
@@ -87,7 +87,8 @@ dh_computesecret(void **state) {
1e4169
 	result = dst_key_computesecret(key, key, &buf;;
1e4169
 	assert_int_equal(result, DST_R_NOTPRIVATEKEY);
1e4169
 	result = key->func->computesecret(key, key, &buf;;
1e4169
-	assert_int_equal(result, DST_R_COMPUTESECRETFAILURE);
e5f6b8
+	/* PKCS11 variant gives different result, accept both */
1e4169
+	assert_true(result == DST_R_COMPUTESECRETFAILURE || result == DST_R_INVALIDPRIVATEKEY);
e5f6b8
 
e5f6b8
 	dst_key_free(&key);
1e4169
 }
e5f6b8
-- 
1e4169
2.20.1
e5f6b8