]> granicus.if.org Git - p11-kit/commitdiff
test: Make test-module work --without-trust-module
authorDaiki Ueno <dueno@redhat.com>
Fri, 12 Aug 2016 12:27:46 +0000 (14:27 +0200)
committerStef Walter <stefw@redhat.com>
Sun, 4 Sep 2016 13:54:24 +0000 (15:54 +0200)
The test-module program currently depends on TRUST_PATHS, which is
determined by the configure script and normally points to a resource
outside of the build tree.  To make the test system-independent, use
a crafted path for testing.

https://bugs.freedesktop.org/show_bug.cgi?id=89027

trust/test-module.c

index b1ee5fd121879848665df45dcdc288185744cf0a..1729b4178bf463108169c0952b9cb651b2a7db30 100644 (file)
@@ -221,13 +221,14 @@ test_multi_initialize (void)
        rv = C_GetFunctionList (&module);
        assert_num_eq (rv, CKR_OK);
 
+       args.pReserved = "paths='" SYSCONFDIR "/trust/input'";
        rv = module->C_Initialize (&args);
        assert_num_eq (rv, CKR_OK);
 
        count = 8;
        rv = module->C_GetSlotList (CK_TRUE, slots, &count);
        assert_num_eq (rv, CKR_OK);
-       assert_num_cmp (count, >, 0);
+       assert_num_cmp (count, ==, 1);
 
        rv = module->C_OpenSession (slots[0], CKF_SERIAL_SESSION, NULL, NULL, &session);
        assert_num_eq (rv, CKR_OK);