diff options
author | Stef Walter <stefw@gnome.org> | 2014-03-04 16:12:16 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2014-03-05 13:02:15 +0100 |
commit | 50e0feec5d80263ba2c65d005290a3e9837905f4 (patch) | |
tree | b014be9d7a182affbd4440a5c7ac59fb79f0bbde | |
parent | beea17679b71bdcb5363bc5844f1ed826d4424be (diff) |
Makefile.am: Move tests into same directories as tested code
This allows for a cleaner build tree, and will provide benefits
when moving to a single Makefile.
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | daemon/control/Makefile.am | 52 | ||||
-rw-r--r-- | daemon/control/frob-control-change.c (renamed from daemon/control/tests/frob-control-change.c) | 0 | ||||
-rw-r--r-- | daemon/control/frob-control-init.c (renamed from daemon/control/tests/frob-control-init.c) | 0 | ||||
-rw-r--r-- | daemon/control/frob-control-quit.c (renamed from daemon/control/tests/frob-control-quit.c) | 0 | ||||
-rw-r--r-- | daemon/control/frob-control-unlock.c (renamed from daemon/control/tests/frob-control-unlock.c) | 0 | ||||
-rw-r--r-- | daemon/control/tests/.gitignore | 4 | ||||
-rw-r--r-- | daemon/control/tests/Makefile.am | 55 | ||||
-rw-r--r-- | daemon/dbus/Makefile.am | 40 | ||||
-rw-r--r-- | daemon/dbus/fixtures/test.keyring (renamed from daemon/dbus/tests/files/test.keyring) | bin | 180 -> 180 bytes | |||
-rw-r--r-- | daemon/dbus/test-secret-items.c (renamed from daemon/dbus/tests/test-secret-items.c) | 0 | ||||
-rw-r--r-- | daemon/dbus/test-secret-lock.c (renamed from daemon/dbus/tests/test-secret-lock.c) | 0 | ||||
-rw-r--r-- | daemon/dbus/test-secret-search.c (renamed from daemon/dbus/tests/test-secret-search.c) | 0 | ||||
-rw-r--r-- | daemon/dbus/test-secret-signals.c (renamed from daemon/dbus/tests/test-secret-signals.c) | 0 | ||||
-rw-r--r-- | daemon/dbus/test-secret-util.c (renamed from daemon/dbus/tests/test-secret-util.c) | 0 | ||||
-rw-r--r-- | daemon/dbus/test-service.c (renamed from daemon/dbus/tests/test-service.c) | 2 | ||||
-rw-r--r-- | daemon/dbus/test-service.h (renamed from daemon/dbus/tests/test-service.h) | 0 | ||||
-rw-r--r-- | daemon/dbus/tests/Makefile.am | 44 | ||||
-rw-r--r-- | egg/Makefile.am | 58 | ||||
-rw-r--r-- | egg/fixtures/dh-params.pem (renamed from egg/tests/files/dh-params.pem) | 0 | ||||
-rw-r--r-- | egg/fixtures/echo-script.sh (renamed from egg/tests/files/echo-script.sh) | 0 | ||||
-rw-r--r-- | egg/fixtures/pem-rsa-enc.key (renamed from egg/tests/files/pem-rsa-enc.key) | 0 | ||||
-rw-r--r-- | egg/fixtures/test-certificate-1.der (renamed from egg/tests/files/test-certificate-1.der) | bin | 813 -> 813 bytes | |||
-rw-r--r-- | egg/fixtures/test-personalname-invalid.der (renamed from egg/tests/files/test-personalname-invalid.der) | 0 | ||||
-rw-r--r-- | egg/fixtures/test-pkcs12-1.der (renamed from egg/tests/files/test-pkcs12-1.der) | bin | 2824 -> 2824 bytes | |||
-rwxr-xr-x | egg/fixtures/test-pkcs7-1.der (renamed from egg/tests/files/test-pkcs7-1.der) | bin | 1002 -> 1002 bytes | |||
-rwxr-xr-x | egg/fixtures/test-pkcs7-2.der (renamed from egg/tests/files/test-pkcs7-2.der) | bin | 1002 -> 1002 bytes | |||
-rw-r--r-- | egg/fixtures/test-pkcs8-1.der (renamed from egg/tests/files/test-pkcs8-1.der) | bin | 335 -> 335 bytes | |||
-rw-r--r-- | egg/fixtures/test-rsakey-1.der (renamed from egg/tests/files/test-rsakey-1.der) | bin | 609 -> 609 bytes | |||
-rw-r--r-- | egg/test-armor.c (renamed from egg/tests/test-armor.c) | 0 | ||||
-rw-r--r-- | egg/test-asn1.c (renamed from egg/tests/test-asn1.c) | 2 | ||||
-rw-r--r-- | egg/test-asn1x.c (renamed from egg/tests/test-asn1x.c) | 14 | ||||
-rw-r--r-- | egg/test-cleanup.c (renamed from egg/tests/test-cleanup.c) | 0 | ||||
-rw-r--r-- | egg/test-dh.c (renamed from egg/tests/test-dh.c) | 0 | ||||
-rw-r--r-- | egg/test-dn.c (renamed from egg/tests/test-dn.c) | 2 | ||||
-rw-r--r-- | egg/test-hex.c (renamed from egg/tests/test-hex.c) | 0 | ||||
-rw-r--r-- | egg/test-hkdf.c (renamed from egg/tests/test-hkdf.c) | 0 | ||||
-rw-r--r-- | egg/test-oid.c (renamed from egg/tests/test-oid.c) | 0 | ||||
-rw-r--r-- | egg/test-openssl.c (renamed from egg/tests/test-openssl.c) | 2 | ||||
-rw-r--r-- | egg/test-padding.c (renamed from egg/tests/test-padding.c) | 0 | ||||
-rw-r--r-- | egg/test-secmem.c (renamed from egg/tests/test-secmem.c) | 0 | ||||
-rw-r--r-- | egg/test-spawn.c (renamed from egg/tests/test-spawn.c) | 10 | ||||
-rw-r--r-- | egg/test-symkey.c (renamed from egg/tests/test-symkey.c) | 0 | ||||
-rw-r--r-- | egg/test.asn (renamed from egg/tests/test.asn) | 0 | ||||
-rw-r--r-- | egg/test.asn.h (renamed from egg/tests/test.asn.h) | 0 | ||||
-rw-r--r-- | egg/tests/.gitignore | 1 | ||||
-rw-r--r-- | egg/tests/Makefile.am | 54 | ||||
-rw-r--r-- | pkcs11/gkm/Makefile.am | 73 | ||||
-rw-r--r-- | pkcs11/gkm/asn1-def-test.h | 17 | ||||
-rw-r--r-- | pkcs11/gkm/fixtures/ca-certificates.crt (renamed from pkcs11/gkm/tests/files/ca-certificates.crt) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/fixtures/der-key-PBE-MD5-DES.p8 (renamed from pkcs11/gkm/tests/files/der-key-PBE-MD5-DES.p8) | bin | 677 -> 677 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/der-key-PBE-SHA1-3DES.p8 (renamed from pkcs11/gkm/tests/files/der-key-PBE-SHA1-3DES.p8) | bin | 678 -> 678 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/der-key-PBE-SHA1-DES.p8 (renamed from pkcs11/gkm/tests/files/der-key-PBE-SHA1-DES.p8) | bin | 677 -> 677 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/der-key-PBE-SHA1-RC2-40.p8 (renamed from pkcs11/gkm/tests/files/der-key-PBE-SHA1-RC2-40.p8) | bin | 678 -> 678 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/der-key-PBE-SHA1-RC4-128.p8 (renamed from pkcs11/gkm/tests/files/der-key-PBE-SHA1-RC4-128.p8) | bin | 673 -> 673 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/der-key-dsa.p8 (renamed from pkcs11/gkm/tests/files/der-key-dsa.p8) | bin | 335 -> 335 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/der-key-encrypted-pkcs5.p8 (renamed from pkcs11/gkm/tests/files/der-key-encrypted-pkcs5.p8) | bin | 677 -> 677 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/der-key-v2-des.p8 (renamed from pkcs11/gkm/tests/files/der-key-v2-des.p8) | bin | 711 -> 711 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/der-key-v2-des3.p8 (renamed from pkcs11/gkm/tests/files/der-key-v2-des3.p8) | bin | 714 -> 714 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/der-key.p8 (renamed from pkcs11/gkm/tests/files/der-key.p8) | bin | 635 -> 635 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/pem-rsa-enc.key (renamed from pkcs11/gkm/tests/files/pem-rsa-enc.key) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/fixtures/test-certificate-1.der (renamed from pkcs11/gkm/tests/files/test-certificate-1.der) | bin | 813 -> 813 bytes | |||
-rw-r--r-- | pkcs11/gkm/fixtures/test-certificate-2.der (renamed from pkcs11/gkm/tests/files/test-certificate-2.der) | bin | 1346 -> 1346 bytes | |||
-rw-r--r-- | pkcs11/gkm/mock-locked-object.c (renamed from pkcs11/gkm/tests/mock-locked-object.c) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/mock-locked-object.h (renamed from pkcs11/gkm/tests/mock-locked-object.h) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/mock-module.c (renamed from pkcs11/gkm/tests/mock-module.c) | 2 | ||||
-rw-r--r-- | pkcs11/gkm/mock-module.h (renamed from pkcs11/gkm/tests/mock-module.h) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test-attributes.c (renamed from pkcs11/gkm/tests/test-attributes.c) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test-certificate.c (renamed from pkcs11/gkm/tests/test-certificate.c) | 2 | ||||
-rw-r--r-- | pkcs11/gkm/test-credential.c (renamed from pkcs11/gkm/tests/test-credential.c) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test-data-asn1.c (renamed from pkcs11/gkm/tests/test-data-asn1.c) | 2 | ||||
-rw-r--r-- | pkcs11/gkm/test-data-der.c (renamed from pkcs11/gkm/tests/test-data-der.c) | 12 | ||||
-rw-r--r-- | pkcs11/gkm/test-file-tracker.c (renamed from pkcs11/gkm/tests/test-file-tracker.c) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test-memory-store.c (renamed from pkcs11/gkm/tests/test-memory-store.c) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test-object.c (renamed from pkcs11/gkm/tests/test-object.c) | 2 | ||||
-rw-r--r-- | pkcs11/gkm/test-secret.c (renamed from pkcs11/gkm/tests/test-secret.c) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test-sexp.c (renamed from pkcs11/gkm/tests/test-sexp.c) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test-store.c (renamed from pkcs11/gkm/tests/test-store.c) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test-timer.c (renamed from pkcs11/gkm/tests/test-timer.c) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test-transaction.c (renamed from pkcs11/gkm/tests/test-transaction.c) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test.asn (renamed from pkcs11/gkm/tests/test.asn) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/test.asn.h (renamed from pkcs11/gkm/tests/test.asn.h) | 0 | ||||
-rw-r--r-- | pkcs11/gkm/tests/.gitignore | 2 | ||||
-rw-r--r-- | pkcs11/gkm/tests/Makefile.am | 79 | ||||
-rw-r--r-- | pkcs11/gnome2-store/Makefile.am | 59 | ||||
-rw-r--r-- | pkcs11/gnome2-store/check-gnome2-module.c (renamed from pkcs11/gnome2-store/tests/check-gnome2-module.c) | 0 | ||||
-rw-r--r-- | pkcs11/gnome2-store/fixtures/.gitempty (renamed from pkcs11/gnome2-store/tests/files/.gitempty) | 0 | ||||
-rw-r--r-- | pkcs11/gnome2-store/fixtures/Thawte_Personal_Premium_CA.cer (renamed from pkcs11/gnome2-store/tests/files/Thawte_Personal_Premium_CA.cer) | bin | 813 -> 813 bytes | |||
-rw-r--r-- | pkcs11/gnome2-store/fixtures/data-file-private.store (renamed from pkcs11/gnome2-store/tests/files/data-file-private.store) | bin | 494 -> 494 bytes | |||
-rw-r--r-- | pkcs11/gnome2-store/fixtures/data-file-public.store (renamed from pkcs11/gnome2-store/tests/files/data-file-public.store) | bin | 216 -> 216 bytes | |||
-rw-r--r-- | pkcs11/gnome2-store/fixtures/der-key-v2-des3.p8 (renamed from pkcs11/gnome2-store/tests/files/der-key-v2-des3.p8) | bin | 714 -> 714 bytes | |||
-rw-r--r-- | pkcs11/gnome2-store/fixtures/personal.p12 (renamed from pkcs11/gnome2-store/tests/files/personal.p12) | bin | 3396 -> 3396 bytes | |||
-rw-r--r-- | pkcs11/gnome2-store/fixtures/test-certificate.cer (renamed from pkcs11/gnome2-store/tests/files/test-certificate.cer) | bin | 1857 -> 1857 bytes | |||
-rw-r--r-- | pkcs11/gnome2-store/fixtures/user.keystore (renamed from pkcs11/gnome2-store/tests/files/user.keystore) | bin | 226 -> 226 bytes | |||
-rw-r--r-- | pkcs11/gnome2-store/frob-gnome2-file.c (renamed from pkcs11/gnome2-store/tests/frob-gnome2-file.c) | 0 | ||||
-rw-r--r-- | pkcs11/gnome2-store/mock-gnome2-module.c (renamed from pkcs11/gnome2-store/tests/mock-gnome2-module.c) | 0 | ||||
-rw-r--r-- | pkcs11/gnome2-store/mock-gnome2-module.h (renamed from pkcs11/gnome2-store/tests/mock-gnome2-module.h) | 0 | ||||
-rw-r--r-- | pkcs11/gnome2-store/p11-tests.conf.in (renamed from pkcs11/gnome2-store/tests/p11-tests.conf.in) | 0 | ||||
-rw-r--r-- | pkcs11/gnome2-store/test-gnome2-file.c (renamed from pkcs11/gnome2-store/tests/test-gnome2-file.c) | 4 | ||||
-rw-r--r-- | pkcs11/gnome2-store/test-gnome2-private-key.c (renamed from pkcs11/gnome2-store/tests/test-gnome2-private-key.c) | 2 | ||||
-rw-r--r-- | pkcs11/gnome2-store/test-gnome2-storage.c (renamed from pkcs11/gnome2-store/tests/test-gnome2-storage.c) | 6 | ||||
-rw-r--r-- | pkcs11/gnome2-store/test-import.c (renamed from pkcs11/gnome2-store/tests/test-import.c) | 2 | ||||
-rw-r--r-- | pkcs11/gnome2-store/tests/.gitignore | 1 | ||||
-rw-r--r-- | pkcs11/gnome2-store/tests/Makefile.am | 66 | ||||
-rw-r--r-- | pkcs11/secret-store/Makefile.am | 42 | ||||
-rw-r--r-- | pkcs11/secret-store/dump-keyring0-format.c (renamed from pkcs11/secret-store/tests/dump-keyring0-format.c) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/fixtures/created-on-rhel.keyring (renamed from pkcs11/secret-store/tests/files/created-on-rhel.keyring) | bin | 105 -> 105 bytes | |||
-rw-r--r-- | pkcs11/secret-store/fixtures/created-on-solaris-opencsw.keyring (renamed from pkcs11/secret-store/tests/files/created-on-solaris-opencsw.keyring) | bin | 105 -> 105 bytes | |||
-rw-r--r-- | pkcs11/secret-store/fixtures/encrypted-with-schema.keyring (renamed from pkcs11/secret-store/tests/files/encrypted-with-schema.keyring) | bin | 404 -> 404 bytes | |||
-rw-r--r-- | pkcs11/secret-store/fixtures/encrypted.keyring (renamed from pkcs11/secret-store/tests/files/encrypted.keyring) | bin | 733 -> 733 bytes | |||
-rw-r--r-- | pkcs11/secret-store/fixtures/plain-bad-number.keyring (renamed from pkcs11/secret-store/tests/files/plain-bad-number.keyring) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/fixtures/plain-with-schema.keyring (renamed from pkcs11/secret-store/tests/files/plain-with-schema.keyring) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/fixtures/plain.keyring (renamed from pkcs11/secret-store/tests/files/plain.keyring) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/fixtures/schema1.keyring (renamed from pkcs11/secret-store/tests/files/schema1.keyring) | bin | 769 -> 769 bytes | |||
-rw-r--r-- | pkcs11/secret-store/fixtures/schema2.keyring (renamed from pkcs11/secret-store/tests/files/schema2.keyring) | bin | 1005 -> 1005 bytes | |||
-rw-r--r-- | pkcs11/secret-store/mock-secret-module.c (renamed from pkcs11/secret-store/tests/mock-secret-module.c) | 4 | ||||
-rw-r--r-- | pkcs11/secret-store/mock-secret-module.h (renamed from pkcs11/secret-store/tests/mock-secret-module.h) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/test-secret-binary.c (renamed from pkcs11/secret-store/tests/test-secret-binary.c) | 16 | ||||
-rw-r--r-- | pkcs11/secret-store/test-secret-collection.c (renamed from pkcs11/secret-store/tests/test-secret-collection.c) | 12 | ||||
-rw-r--r-- | pkcs11/secret-store/test-secret-compat.c (renamed from pkcs11/secret-store/tests/test-secret-compat.c) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/test-secret-data.c (renamed from pkcs11/secret-store/tests/test-secret-data.c) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/test-secret-fields.c (renamed from pkcs11/secret-store/tests/test-secret-fields.c) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/test-secret-item.c (renamed from pkcs11/secret-store/tests/test-secret-item.c) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/test-secret-object.c (renamed from pkcs11/secret-store/tests/test-secret-object.c) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/test-secret-schema.c (renamed from pkcs11/secret-store/tests/test-secret-schema.c) | 2 | ||||
-rw-r--r-- | pkcs11/secret-store/test-secret-search.c (renamed from pkcs11/secret-store/tests/test-secret-search.c) | 0 | ||||
-rw-r--r-- | pkcs11/secret-store/test-secret-textual.c (renamed from pkcs11/secret-store/tests/test-secret-textual.c) | 10 | ||||
-rw-r--r-- | pkcs11/secret-store/tests/Makefile.am | 48 | ||||
-rw-r--r-- | pkcs11/ssh-store/Makefile.am | 52 | ||||
-rw-r--r-- | pkcs11/ssh-store/check-ssh-module.c (renamed from pkcs11/ssh-store/tests/check-ssh-module.c) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/fixtures/id_dsa_encrypted (renamed from pkcs11/ssh-store/tests/files/id_dsa_encrypted) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/fixtures/id_dsa_encrypted.pub (renamed from pkcs11/ssh-store/tests/files/id_dsa_encrypted.pub) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/fixtures/id_dsa_plain (renamed from pkcs11/ssh-store/tests/files/id_dsa_plain) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/fixtures/id_dsa_plain.pub (renamed from pkcs11/ssh-store/tests/files/id_dsa_plain.pub) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/fixtures/id_dsa_test.pub (renamed from pkcs11/ssh-store/tests/files/id_dsa_test.pub) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/fixtures/id_rsa_encrypted (renamed from pkcs11/ssh-store/tests/files/id_rsa_encrypted) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/fixtures/id_rsa_encrypted.pub (renamed from pkcs11/ssh-store/tests/files/id_rsa_encrypted.pub) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/fixtures/id_rsa_plain (renamed from pkcs11/ssh-store/tests/files/id_rsa_plain) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/fixtures/id_rsa_plain.pub (renamed from pkcs11/ssh-store/tests/files/id_rsa_plain.pub) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/fixtures/id_rsa_test.pub (renamed from pkcs11/ssh-store/tests/files/id_rsa_test.pub) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/mock-ssh-module.c (renamed from pkcs11/ssh-store/tests/mock-ssh-module.c) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/mock-ssh-module.h (renamed from pkcs11/ssh-store/tests/mock-ssh-module.h) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/p11-tests.conf.in (renamed from pkcs11/ssh-store/tests/p11-tests.conf.in) | 0 | ||||
-rw-r--r-- | pkcs11/ssh-store/test-private-key.c (renamed from pkcs11/ssh-store/tests/test-private-key.c) | 8 | ||||
-rw-r--r-- | pkcs11/ssh-store/test-ssh-openssh.c (renamed from pkcs11/ssh-store/tests/test-ssh-openssh.c) | 12 | ||||
-rw-r--r-- | pkcs11/ssh-store/tests/Makefile.am | 58 | ||||
-rw-r--r-- | pkcs11/wrap-layer/Makefile.am | 34 | ||||
-rw-r--r-- | pkcs11/wrap-layer/mock-secret-store.c (renamed from pkcs11/wrap-layer/tests/mock-secret-store.c) | 0 | ||||
-rw-r--r-- | pkcs11/wrap-layer/test-create-credential.c (renamed from pkcs11/wrap-layer/tests/test-create-credential.c) | 0 | ||||
-rw-r--r-- | pkcs11/wrap-layer/test-init-pin.c (renamed from pkcs11/wrap-layer/tests/test-init-pin.c) | 0 | ||||
-rw-r--r-- | pkcs11/wrap-layer/test-login-auto.c (renamed from pkcs11/wrap-layer/tests/test-login-auto.c) | 0 | ||||
-rw-r--r-- | pkcs11/wrap-layer/test-login-hints.c (renamed from pkcs11/wrap-layer/tests/test-login-hints.c) | 0 | ||||
-rw-r--r-- | pkcs11/wrap-layer/test-login-keyring.c (renamed from pkcs11/wrap-layer/tests/test-login-keyring.c) | 0 | ||||
-rw-r--r-- | pkcs11/wrap-layer/test-login-specific.c (renamed from pkcs11/wrap-layer/tests/test-login-specific.c) | 0 | ||||
-rw-r--r-- | pkcs11/wrap-layer/test-login-user.c (renamed from pkcs11/wrap-layer/tests/test-login-user.c) | 0 | ||||
-rw-r--r-- | pkcs11/wrap-layer/test-set-pin.c (renamed from pkcs11/wrap-layer/tests/test-set-pin.c) | 0 | ||||
-rw-r--r-- | pkcs11/wrap-layer/tests/Makefile.am | 42 | ||||
-rw-r--r-- | pkcs11/xdg-store/Makefile.am | 53 | ||||
-rw-r--r-- | pkcs11/xdg-store/check-xdg-module.c (renamed from pkcs11/xdg-store/tests/check-xdg-module.c) | 0 | ||||
-rw-r--r-- | pkcs11/xdg-store/dump-trust-file.c (renamed from pkcs11/xdg-store/tests/dump-trust-file.c) | 0 | ||||
-rw-r--r-- | pkcs11/xdg-store/fixtures/test-certificate-1.cer (renamed from pkcs11/xdg-store/tests/files/test-certificate-1.cer) | bin | 813 -> 813 bytes | |||
-rw-r--r-- | pkcs11/xdg-store/fixtures/test-certificate-2.cer (renamed from pkcs11/xdg-store/tests/files/test-certificate-2.cer) | bin | 813 -> 813 bytes | |||
-rw-r--r-- | pkcs11/xdg-store/fixtures/test-refer-1.trust (renamed from pkcs11/xdg-store/tests/files/test-refer-1.trust) | bin | 241 -> 241 bytes | |||
-rw-r--r-- | pkcs11/xdg-store/frob-trust-file.c (renamed from pkcs11/xdg-store/tests/frob-trust-file.c) | 0 | ||||
-rw-r--r-- | pkcs11/xdg-store/mock-xdg-module.c (renamed from pkcs11/xdg-store/tests/mock-xdg-module.c) | 6 | ||||
-rw-r--r-- | pkcs11/xdg-store/mock-xdg-module.h (renamed from pkcs11/xdg-store/tests/mock-xdg-module.h) | 0 | ||||
-rw-r--r-- | pkcs11/xdg-store/p11-tests.conf (renamed from pkcs11/xdg-store/tests/p11-tests.conf) | 0 | ||||
-rw-r--r-- | pkcs11/xdg-store/test-xdg-module.c (renamed from pkcs11/xdg-store/tests/test-xdg-module.c) | 2 | ||||
-rw-r--r-- | pkcs11/xdg-store/test-xdg-trust.c (renamed from pkcs11/xdg-store/tests/test-xdg-trust.c) | 2 | ||||
-rw-r--r-- | pkcs11/xdg-store/tests/Makefile.am | 54 |
170 files changed, 531 insertions, 606 deletions
diff --git a/configure.ac b/configure.ac index 2b7bf262..1022cd47 100644 --- a/configure.ac +++ b/configure.ac @@ -663,31 +663,22 @@ AC_OUTPUT([ Makefile daemon/Makefile daemon/control/Makefile -daemon/control/tests/Makefile daemon/dbus/Makefile -daemon/dbus/tests/Makefile daemon/gpg-agent/Makefile daemon/login/Makefile daemon/ssh-agent/Makefile docs/Makefile egg/Makefile -egg/tests/Makefile pam/Makefile pkcs11/Makefile pkcs11/gkm/Makefile -pkcs11/gkm/tests/Makefile pkcs11/gnome2-store/Makefile -pkcs11/gnome2-store/tests/Makefile pkcs11/rpc-layer/Makefile pkcs11/rpc-layer/gnome-keyring.module pkcs11/secret-store/Makefile -pkcs11/secret-store/tests/Makefile pkcs11/ssh-store/Makefile -pkcs11/ssh-store/tests/Makefile pkcs11/wrap-layer/Makefile -pkcs11/wrap-layer/tests/Makefile pkcs11/xdg-store/Makefile -pkcs11/xdg-store/tests/Makefile po/Makefile.in schema/Makefile testing/Makefile diff --git a/daemon/control/Makefile.am b/daemon/control/Makefile.am index 2b53d7ba..4df8cfd2 100644 --- a/daemon/control/Makefile.am +++ b/daemon/control/Makefile.am @@ -1,6 +1,4 @@ -SUBDIRS = . tests - INCLUDES= \ -DPREFIX=\""$(prefix)"\" \ -DBINDIR=\""$(bindir)"\" \ @@ -11,6 +9,11 @@ INCLUDES= \ -I$(top_builddir) \ $(GLIB_CFLAGS) +LIBS = \ + $(GLIB_LIBS) \ + $(GTHREAD_LIBS) \ + $(P11_TESTS_LIBS) + # ------------------------------------------------------------------ # DAEMON CODE @@ -24,3 +27,48 @@ libgkd_control_la_SOURCES = \ libgkd_control_client_la_SOURCES = \ gkd-control-client.c gkd-control.h + +# ------------------------------------------------------------------- +# TESTS + +noinst_PROGRAMS= \ + frob-control-change \ + frob-control-init \ + frob-control-unlock \ + frob-control-quit + +frob_control_change_SOURCES = \ + frob-control-change.c + +frob_control_change_LDADD = \ + $(top_builddir)/daemon/control/libgkd-control-client.la \ + $(top_builddir)/egg/libegg-buffer.la \ + $(top_builddir)/egg/libegg-creds.la \ + $(top_builddir)/egg/libegg-secure.la + +frob_control_init_SOURCES = \ + frob-control-init.c + +frob_control_init_LDADD = \ + $(top_builddir)/daemon/control/libgkd-control-client.la \ + $(top_builddir)/egg/libegg-buffer.la \ + $(top_builddir)/egg/libegg-creds.la \ + $(top_builddir)/egg/libegg-secure.la + +frob_control_quit_SOURCES = \ + frob-control-quit.c + +frob_control_quit_LDADD = \ + $(top_builddir)/daemon/control/libgkd-control-client.la \ + $(top_builddir)/egg/libegg-buffer.la \ + $(top_builddir)/egg/libegg-creds.la \ + $(top_builddir)/egg/libegg-secure.la + +frob_control_unlock_SOURCES = \ + frob-control-unlock.c + +frob_control_unlock_LDADD = \ + $(top_builddir)/daemon/control/libgkd-control-client.la \ + $(top_builddir)/egg/libegg-buffer.la \ + $(top_builddir)/egg/libegg-creds.la \ + $(top_builddir)/egg/libegg-secure.la
\ No newline at end of file diff --git a/daemon/control/tests/frob-control-change.c b/daemon/control/frob-control-change.c index 2fa6b4c8..2fa6b4c8 100644 --- a/daemon/control/tests/frob-control-change.c +++ b/daemon/control/frob-control-change.c diff --git a/daemon/control/tests/frob-control-init.c b/daemon/control/frob-control-init.c index 88149bed..88149bed 100644 --- a/daemon/control/tests/frob-control-init.c +++ b/daemon/control/frob-control-init.c diff --git a/daemon/control/tests/frob-control-quit.c b/daemon/control/frob-control-quit.c index a2ade3a7..a2ade3a7 100644 --- a/daemon/control/tests/frob-control-quit.c +++ b/daemon/control/frob-control-quit.c diff --git a/daemon/control/tests/frob-control-unlock.c b/daemon/control/frob-control-unlock.c index 6a448011..6a448011 100644 --- a/daemon/control/tests/frob-control-unlock.c +++ b/daemon/control/frob-control-unlock.c diff --git a/daemon/control/tests/.gitignore b/daemon/control/tests/.gitignore deleted file mode 100644 index cf0cce4b..00000000 --- a/daemon/control/tests/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/test-control-change -/test-control-init -/test-control-unlock -/test-control-quit diff --git a/daemon/control/tests/Makefile.am b/daemon/control/tests/Makefile.am deleted file mode 100644 index b390a1dd..00000000 --- a/daemon/control/tests/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -INCLUDES= \ - -I$(top_srcdir) \ - -I$(top_builddir) \ - -I$(top_srcdir)/daemon \ - $(GLIB_CFLAGS) - -LIBS = \ - $(GLIB_LIBS) \ - $(GTHREAD_LIBS) \ - $(P11_TESTS_LIBS) - -noinst_PROGRAMS= \ - frob-control-change \ - frob-control-init \ - frob-control-unlock \ - frob-control-quit - -# ------------------------------------------------------------------------------ -# Test unlocking the login keyring - -frob_control_change_SOURCES = \ - frob-control-change.c - -frob_control_change_LDADD = \ - $(top_builddir)/daemon/control/libgkd-control-client.la \ - $(top_builddir)/egg/libegg-buffer.la \ - $(top_builddir)/egg/libegg-creds.la \ - $(top_builddir)/egg/libegg-secure.la - -frob_control_init_SOURCES = \ - frob-control-init.c - -frob_control_init_LDADD = \ - $(top_builddir)/daemon/control/libgkd-control-client.la \ - $(top_builddir)/egg/libegg-buffer.la \ - $(top_builddir)/egg/libegg-creds.la \ - $(top_builddir)/egg/libegg-secure.la - -frob_control_quit_SOURCES = \ - frob-control-quit.c - -frob_control_quit_LDADD = \ - $(top_builddir)/daemon/control/libgkd-control-client.la \ - $(top_builddir)/egg/libegg-buffer.la \ - $(top_builddir)/egg/libegg-creds.la \ - $(top_builddir)/egg/libegg-secure.la - -frob_control_unlock_SOURCES = \ - frob-control-unlock.c - -frob_control_unlock_LDADD = \ - $(top_builddir)/daemon/control/libgkd-control-client.la \ - $(top_builddir)/egg/libegg-buffer.la \ - $(top_builddir)/egg/libegg-creds.la \ - $(top_builddir)/egg/libegg-secure.la
\ No newline at end of file diff --git a/daemon/dbus/Makefile.am b/daemon/dbus/Makefile.am index 20180d30..9cf61750 100644 --- a/daemon/dbus/Makefile.am +++ b/daemon/dbus/Makefile.am @@ -2,12 +2,17 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/daemon \ + -I$(top_srcdir)/daemon/dbus \ -I$(top_builddir) \ $(DAEMON_CFLAGS) \ + $(GCR_BASE_CFLAGS) \ $(GOBJECT_CFLAGS) \ $(GLIB_CFLAGS) \ -DGCK_API_SUBJECT_TO_CHANGE \ - -DGCR_API_SUBJECT_TO_CHANGE + -DGCR_API_SUBJECT_TO_CHANGE \ + -DSRCDIR="\"@abs_srcdir@\"" \ + -DTOP_SRCDIR="\"@abs_top_srcdir@\"" \ + -DTOP_BUILDDIR="\"@abs_top_builddir@\"" noinst_LTLIBRARIES = libgkd-dbus.la @@ -40,5 +45,36 @@ libgkd_dbus_la_LIBADD = \ $(GOBJECT_LIBS) # ------------------------------------------------------------------- +# TESTS -SUBDIRS = . tests +noinst_LTLIBRARIES += \ + libtestservice.la + +libtestservice_la_SOURCES = \ + test-service.c test-service.h + +LDADD = \ + $(builddir)/libtestservice.la \ + $(top_builddir)/daemon/dbus/libgkd-dbus.la \ + $(top_builddir)/egg/libegg-test.la \ + $(GCR_BASE_LIBS) \ + $(GIO_LIBS) \ + $(GLIB_LIBS) + +TEST_PROGS = \ + test-secret-util \ + test-secret-search \ + test-secret-items \ + test-secret-signals \ + test-secret-lock + +check_PROGRAMS = $(TEST_PROGS) + +EXTRA_DIST = fixtures + +test: $(TEST_PROGS) + gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) + +check-local: test + +all-local: $(check_PROGRAMS) diff --git a/daemon/dbus/tests/files/test.keyring b/daemon/dbus/fixtures/test.keyring Binary files differindex f53ed5d9..f53ed5d9 100644 --- a/daemon/dbus/tests/files/test.keyring +++ b/daemon/dbus/fixtures/test.keyring diff --git a/daemon/dbus/tests/test-secret-items.c b/daemon/dbus/test-secret-items.c index 48433171..48433171 100644 --- a/daemon/dbus/tests/test-secret-items.c +++ b/daemon/dbus/test-secret-items.c diff --git a/daemon/dbus/tests/test-secret-lock.c b/daemon/dbus/test-secret-lock.c index 26ff5a67..26ff5a67 100644 --- a/daemon/dbus/tests/test-secret-lock.c +++ b/daemon/dbus/test-secret-lock.c diff --git a/daemon/dbus/tests/test-secret-search.c b/daemon/dbus/test-secret-search.c index 6108a0d2..6108a0d2 100644 --- a/daemon/dbus/tests/test-secret-search.c +++ b/daemon/dbus/test-secret-search.c diff --git a/daemon/dbus/tests/test-secret-signals.c b/daemon/dbus/test-secret-signals.c index 4d3ab434..4d3ab434 100644 --- a/daemon/dbus/tests/test-secret-signals.c +++ b/daemon/dbus/test-secret-signals.c diff --git a/daemon/dbus/tests/test-secret-util.c b/daemon/dbus/test-secret-util.c index 24405075..24405075 100644 --- a/daemon/dbus/tests/test-secret-util.c +++ b/daemon/dbus/test-secret-util.c diff --git a/daemon/dbus/tests/test-service.c b/daemon/dbus/test-service.c index 16adb3e5..8882d5ca 100644 --- a/daemon/dbus/tests/test-service.c +++ b/daemon/dbus/test-service.c @@ -96,7 +96,7 @@ test_service_setup (TestService *test) test, NULL); test->directory = egg_tests_create_scratch_directory ( - SRCDIR "/files/test.keyring", + SRCDIR "/fixtures/test.keyring", NULL); /* The schema directory */ diff --git a/daemon/dbus/tests/test-service.h b/daemon/dbus/test-service.h index 856dde05..856dde05 100644 --- a/daemon/dbus/tests/test-service.h +++ b/daemon/dbus/test-service.h diff --git a/daemon/dbus/tests/Makefile.am b/daemon/dbus/tests/Makefile.am deleted file mode 100644 index d16a7dcc..00000000 --- a/daemon/dbus/tests/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ - -INCLUDES = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/daemon/dbus \ - -DSRCDIR="\"@abs_srcdir@\"" \ - -DTOP_SRCDIR="\"@abs_top_srcdir@\"" \ - -DTOP_BUILDDIR="\"@abs_top_builddir@\"" \ - -DGCR_API_SUBJECT_TO_CHANGE \ - $(DAEMON_CFLAGS) \ - $(GCR_BASE_CFLAGS) \ - $(GIO_CFLAGS) \ - $(GLIB_CFLAGS) - -noinst_LTLIBRARIES = \ - libtestservice.la - -libtestservice_la_SOURCES = \ - test-service.c test-service.h - -LDADD = \ - $(builddir)/libtestservice.la \ - $(top_builddir)/daemon/dbus/libgkd-dbus.la \ - $(top_builddir)/egg/libegg-test.la \ - $(GCR_BASE_LIBS) \ - $(GIO_LIBS) \ - $(GLIB_LIBS) - -TEST_PROGS = \ - test-secret-util \ - test-secret-search \ - test-secret-items \ - test-secret-signals \ - test-secret-lock - -check_PROGRAMS = $(TEST_PROGS) - -EXTRA_DIST = files - -test: $(TEST_PROGS) - gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) - -check-local: test - -all-local: $(check_PROGRAMS) diff --git a/egg/Makefile.am b/egg/Makefile.am index 0e59577b..6b50242d 100644 --- a/egg/Makefile.am +++ b/egg/Makefile.am @@ -12,8 +12,10 @@ noinst_LTLIBRARIES = \ libegg-test.la INCLUDES = \ + -I$(top_builddir) \ -I$(top_srcdir) \ - -I$(top_builddir) + -DSRCDIR="\"@abs_srcdir@\"" \ + $(GLIB_CFLAGS) libegg_la_CFLAGS = \ $(LIBTASN1_CFLAGS) \ @@ -120,11 +122,55 @@ libegg_test_la_CFLAGS = \ libegg_test_la_LIBS = \ $(GLIB_LIBS) -# ------------------------------------------------------------------- - -SUBDIRS = . tests - asn: asn1Parser -o pk.asn.h pk.asn asn1Parser -o pkix.asn.h pkix.asn - sed -i 's|#include.*|/* \0 */|' pk.asn.h pkix.asn.h
\ No newline at end of file + sed -i 's|#include.*|/* \0 */|' pk.asn.h pkix.asn.h + asn1Parser -o test.asn.h test.asn + sed -i 's|#include.*|/* \0 */|' test.asn.h + +# ------------------------------------------------------------------- +# TESTS + +LDADD = \ + $(top_builddir)/egg/libegg.la \ + $(LIBGCRYPT_LIBS) \ + $(GTHREAD_LIBS) \ + $(GLIB_LIBS) + +TEST_PROGS = \ + test-asn1 \ + test-asn1x \ + test-dn \ + test-cleanup \ + test-hex \ + test-hkdf \ + test-oid \ + test-secmem \ + test-padding \ + test-symkey \ + test-armor \ + test-openssl \ + test-dh \ + test-spawn + +test_asn1_SOURCES = \ + test-asn1.c \ + test.asn.h + +test_asn1x_LDADD = \ + $(top_builddir)/egg/libegg-asn1x.la \ + $(LDADD) + +check_PROGRAMS = $(TEST_PROGS) + +test: $(TEST_PROGS) + gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) + +check-local: test + +all-local: $(check_PROGRAMS) + +EXTRA_DIST += \ + test.asn \ + fixtures diff --git a/egg/tests/files/dh-params.pem b/egg/fixtures/dh-params.pem index cc0afd87..cc0afd87 100644 --- a/egg/tests/files/dh-params.pem +++ b/egg/fixtures/dh-params.pem diff --git a/egg/tests/files/echo-script.sh b/egg/fixtures/echo-script.sh index aa0f7a93..aa0f7a93 100644 --- a/egg/tests/files/echo-script.sh +++ b/egg/fixtures/echo-script.sh diff --git a/egg/tests/files/pem-rsa-enc.key b/egg/fixtures/pem-rsa-enc.key index 65439fe6..65439fe6 100644 --- a/egg/tests/files/pem-rsa-enc.key +++ b/egg/fixtures/pem-rsa-enc.key diff --git a/egg/tests/files/test-certificate-1.der b/egg/fixtures/test-certificate-1.der Binary files differindex 1c084370..1c084370 100644 --- a/egg/tests/files/test-certificate-1.der +++ b/egg/fixtures/test-certificate-1.der diff --git a/egg/tests/files/test-personalname-invalid.der b/egg/fixtures/test-personalname-invalid.der index 60d5d8c4..60d5d8c4 100644 --- a/egg/tests/files/test-personalname-invalid.der +++ b/egg/fixtures/test-personalname-invalid.der diff --git a/egg/tests/files/test-pkcs12-1.der b/egg/fixtures/test-pkcs12-1.der Binary files differindex 285d8dd5..285d8dd5 100644 --- a/egg/tests/files/test-pkcs12-1.der +++ b/egg/fixtures/test-pkcs12-1.der diff --git a/egg/tests/files/test-pkcs7-1.der b/egg/fixtures/test-pkcs7-1.der Binary files differindex d45b9e0e..d45b9e0e 100755 --- a/egg/tests/files/test-pkcs7-1.der +++ b/egg/fixtures/test-pkcs7-1.der diff --git a/egg/tests/files/test-pkcs7-2.der b/egg/fixtures/test-pkcs7-2.der Binary files differindex d45b9e0e..d45b9e0e 100755 --- a/egg/tests/files/test-pkcs7-2.der +++ b/egg/fixtures/test-pkcs7-2.der diff --git a/egg/tests/files/test-pkcs8-1.der b/egg/fixtures/test-pkcs8-1.der Binary files differindex 8b61684e..8b61684e 100644 --- a/egg/tests/files/test-pkcs8-1.der +++ b/egg/fixtures/test-pkcs8-1.der diff --git a/egg/tests/files/test-rsakey-1.der b/egg/fixtures/test-rsakey-1.der Binary files differindex 878fda5b..878fda5b 100644 --- a/egg/tests/files/test-rsakey-1.der +++ b/egg/fixtures/test-rsakey-1.der diff --git a/egg/tests/test-armor.c b/egg/test-armor.c index 3e5cc658..3e5cc658 100644 --- a/egg/tests/test-armor.c +++ b/egg/test-armor.c diff --git a/egg/tests/test-asn1.c b/egg/test-asn1.c index a4373557..598d26a3 100644 --- a/egg/tests/test-asn1.c +++ b/egg/test-asn1.c @@ -1747,7 +1747,7 @@ setup (Test *test, gconstpointer unused) { GBytes *bytes; - if (!g_file_get_contents (SRCDIR "/files/test-certificate-1.der", + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-1.der", (gchar**)&test->data, &test->n_data, NULL)) g_assert_not_reached (); diff --git a/egg/tests/test-asn1x.c b/egg/test-asn1x.c index cce6fe8e..879def2a 100644 --- a/egg/tests/test-asn1x.c +++ b/egg/test-asn1x.c @@ -74,11 +74,11 @@ typedef struct { } Fixture; static const Fixture parse_test_fixtures[] = { - { pkix_asn1_tab, SRCDIR "/files/test-certificate-1.der", "Certificate" }, - { pkix_asn1_tab, SRCDIR "/files/test-pkcs8-1.der", "pkcs-8-PrivateKeyInfo" }, - { pk_asn1_tab, SRCDIR "/files/test-rsakey-1.der", "RSAPrivateKey" }, - { pkix_asn1_tab, SRCDIR "/files/test-pkcs7-1.der", "pkcs-7-ContentInfo" }, - { pkix_asn1_tab, SRCDIR "/files/test-pkcs7-2.der", "pkcs-7-ContentInfo" }, + { pkix_asn1_tab, SRCDIR "/fixtures/test-certificate-1.der", "Certificate" }, + { pkix_asn1_tab, SRCDIR "/fixtures/test-pkcs8-1.der", "pkcs-8-PrivateKeyInfo" }, + { pk_asn1_tab, SRCDIR "/fixtures/test-rsakey-1.der", "RSAPrivateKey" }, + { pkix_asn1_tab, SRCDIR "/fixtures/test-pkcs7-1.der", "pkcs-7-ContentInfo" }, + { pkix_asn1_tab, SRCDIR "/fixtures/test-pkcs7-2.der", "pkcs-7-ContentInfo" }, }; static void @@ -191,9 +191,9 @@ main (int argc, char **argv) g_free (name); } - g_test_add ("/asn1x/pkcs12-decode/1", Test, SRCDIR "/files/test-pkcs12-1.der", + g_test_add ("/asn1x/pkcs12-decode/1", Test, SRCDIR "/fixtures/test-pkcs12-1.der", setup, test_pkcs12_decode, teardown); - g_test_add ("/asn1x/pkcs5-personal-name/invalid", Test, SRCDIR "/files/test-personalname-invalid.der", + g_test_add ("/asn1x/pkcs5-personal-name/invalid", Test, SRCDIR "/fixtures/test-personalname-invalid.der", setup, test_personal_name_invalid, teardown); return g_test_run (); diff --git a/egg/tests/test-cleanup.c b/egg/test-cleanup.c index a83c4868..a83c4868 100644 --- a/egg/tests/test-cleanup.c +++ b/egg/test-cleanup.c diff --git a/egg/tests/test-dh.c b/egg/test-dh.c index 10d612e1..10d612e1 100644 --- a/egg/tests/test-dh.c +++ b/egg/test-dh.c diff --git a/egg/tests/test-dn.c b/egg/test-dn.c index d1b6f729..347a5cdf 100644 --- a/egg/tests/test-dn.c +++ b/egg/test-dn.c @@ -46,7 +46,7 @@ setup (Test *test, gconstpointer unused) { GBytes *bytes; - if (!g_file_get_contents (SRCDIR "/files/test-certificate-1.der", + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-1.der", (gchar**)&test->data, &test->n_data, NULL)) g_assert_not_reached (); diff --git a/egg/tests/test-hex.c b/egg/test-hex.c index 773b2008..773b2008 100644 --- a/egg/tests/test-hex.c +++ b/egg/test-hex.c diff --git a/egg/tests/test-hkdf.c b/egg/test-hkdf.c index e5518a63..e5518a63 100644 --- a/egg/tests/test-hkdf.c +++ b/egg/test-hkdf.c diff --git a/egg/tests/test-oid.c b/egg/test-oid.c index 2c013457..2c013457 100644 --- a/egg/tests/test-oid.c +++ b/egg/test-oid.c diff --git a/egg/tests/test-openssl.c b/egg/test-openssl.c index 91622b93..4f511265 100644 --- a/egg/tests/test-openssl.c +++ b/egg/test-openssl.c @@ -53,7 +53,7 @@ setup (Test *test, gconstpointer unused) gchar *contents; gsize length; - if (!g_file_get_contents (SRCDIR "/files/pem-rsa-enc.key", &contents, &length, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/pem-rsa-enc.key", &contents, &length, NULL)) g_assert_not_reached (); test->input = g_bytes_new_take (contents, length); diff --git a/egg/tests/test-padding.c b/egg/test-padding.c index aecdd378..aecdd378 100644 --- a/egg/tests/test-padding.c +++ b/egg/test-padding.c diff --git a/egg/tests/test-secmem.c b/egg/test-secmem.c index 58b0d35f..58b0d35f 100644 --- a/egg/tests/test-secmem.c +++ b/egg/test-secmem.c diff --git a/egg/tests/test-spawn.c b/egg/test-spawn.c index 7c0d1e11..347f9ba4 100644 --- a/egg/tests/test-spawn.c +++ b/egg/test-spawn.c @@ -175,7 +175,7 @@ test_sync (void) data.parent_pid = getpid(); data.index = 80; - ret = egg_spawn_sync_with_callbacks (SRCDIR "/files", + ret = egg_spawn_sync_with_callbacks (SRCDIR "/fixtures", echo_argv, NULL, 0, &pid, &echo_callbacks, &data, &exit_status, &error); @@ -196,7 +196,7 @@ test_sync_error (void) GError *error = NULL; gboolean ret; - ret = egg_spawn_sync_with_callbacks (SRCDIR "/files", + ret = egg_spawn_sync_with_callbacks (SRCDIR "/fixtures", error_argv, NULL, 0, NULL, NULL, NULL, NULL, &error); @@ -219,7 +219,7 @@ test_async (void) data.index = 80; data.is_async = TRUE; - ret = egg_spawn_async_with_callbacks (SRCDIR "/files", + ret = egg_spawn_async_with_callbacks (SRCDIR "/fixtures", echo_argv, NULL, 0, &pid, &echo_callbacks, &data, NULL, &error); @@ -246,7 +246,7 @@ test_async_none (void) data.parent_pid = getpid(); data.is_async = TRUE; - ret = egg_spawn_async_with_callbacks (SRCDIR "/files", + ret = egg_spawn_async_with_callbacks (SRCDIR "/fixtures", echo_argv, NULL, 0, NULL, &null_callbacks, &data, NULL, &error); @@ -267,7 +267,7 @@ test_async_error (void) GError *error = NULL; guint ret; - ret = egg_spawn_async_with_callbacks (SRCDIR "/files", + ret = egg_spawn_async_with_callbacks (SRCDIR "/fixtures", error_argv, NULL, 0, NULL, NULL, NULL, NULL, &error); diff --git a/egg/tests/test-symkey.c b/egg/test-symkey.c index 90211d68..90211d68 100644 --- a/egg/tests/test-symkey.c +++ b/egg/test-symkey.c diff --git a/egg/tests/test.asn b/egg/test.asn index 05676d70..05676d70 100644 --- a/egg/tests/test.asn +++ b/egg/test.asn diff --git a/egg/tests/test.asn.h b/egg/test.asn.h index f2983e9b..f2983e9b 100644 --- a/egg/tests/test.asn.h +++ b/egg/test.asn.h diff --git a/egg/tests/.gitignore b/egg/tests/.gitignore deleted file mode 100644 index 1ddfbd97..00000000 --- a/egg/tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/asn1-def-test.h diff --git a/egg/tests/Makefile.am b/egg/tests/Makefile.am deleted file mode 100644 index a1d45552..00000000 --- a/egg/tests/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -include $(top_srcdir)/Makefile.decl - -INCLUDES = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -DSRCDIR="\"@abs_srcdir@\"" \ - $(GLIB_CFLAGS) - -LDADD = \ - $(top_builddir)/egg/libegg.la \ - $(LIBGCRYPT_LIBS) \ - $(GTHREAD_LIBS) \ - $(GLIB_LIBS) - -TEST_PROGS = \ - test-asn1 \ - test-asn1x \ - test-dn \ - test-cleanup \ - test-hex \ - test-hkdf \ - test-oid \ - test-secmem \ - test-padding \ - test-symkey \ - test-armor \ - test-openssl \ - test-dh \ - test-spawn - -test_asn1_SOURCES = \ - test-asn1.c \ - test.asn.h - -test_asn1x_LDADD = \ - $(top_builddir)/egg/libegg-asn1x.la \ - $(LDADD) - -check_PROGRAMS = $(TEST_PROGS) - -test: $(TEST_PROGS) - gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) - -check-local: test - -all-local: $(check_PROGRAMS) - -EXTRA_DIST = \ - test.asn \ - files - -asn: - asn1Parser -o test.asn.h test.asn - sed -i 's|#include.*|/* \0 */|' test.asn.h diff --git a/pkcs11/gkm/Makefile.am b/pkcs11/gkm/Makefile.am index fe1900e9..45f61b00 100644 --- a/pkcs11/gkm/Makefile.am +++ b/pkcs11/gkm/Makefile.am @@ -1,6 +1,8 @@ INCLUDES = \ -I$(top_builddir) \ -I$(top_srcdir) \ + -I$(top_srcdir)/pkcs11 \ + -DSRCDIR="\"@abs_srcdir@\"" \ $(GOBJECT_CFLAGS) \ $(LIBGCRYPT_CFLAGS) \ $(GLIB_CFLAGS) @@ -87,5 +89,74 @@ EXTRA_DIST = \ gkm-marshal.list # ------------------------------------------------------------------------------- +# TESTS -SUBDIRS = . tests +LDADD = \ + $(top_builddir)/pkcs11/gkm/libgkm.la \ + $(top_builddir)/egg/libegg.la \ + $(GLIB_LIBS) \ + $(GTHREAD_LIBS) \ + $(LIBGCRYPT_LIBS) + +noinst_LIBRARIES = libgkm-mock.a + +libgkm_mock_a_SOURCES = \ + mock-module.c mock-module.h \ + mock-locked-object.c mock-locked-object.h \ + test.asn.h + +TEST_PROGS = \ + test-attributes \ + test-credential \ + test-data-asn1 \ + test-data-der \ + test-file-tracker \ + test-memory-store \ + test-object \ + test-certificate \ + test-secret \ + test-sexp \ + test-store \ + test-timer \ + test-transaction + +test_credential_LDADD = \ + libgkm-mock.a \ + $(LDADD) + +test_memory_store_LDADD = \ + libgkm-mock.a \ + $(LDADD) + +test_object_LDADD = \ + libgkm-mock.a \ + $(LDADD) + +test_certificate_LDADD = \ + libgkm-mock.a \ + $(LDADD) + +test_store_LDADD = \ + libgkm-mock.a \ + $(LDADD) + +test_timer_LDADD = \ + libgkm-mock.a \ + $(LDADD) + +check_PROGRAMS = $(TEST_PROGS) + +test: $(TEST_PROGS) + gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) + +check-local: test + +all-local: $(check_PROGRAMS) + +EXTRA_DIST += \ + test.asn \ + fixtures + +asn: + asn1Parser -o test.asn.h test.asn + sed -i 's|#include.*|/* \0 */|' test.asn.h diff --git a/pkcs11/gkm/asn1-def-test.h b/pkcs11/gkm/asn1-def-test.h new file mode 100644 index 00000000..9991ec7e --- /dev/null +++ b/pkcs11/gkm/asn1-def-test.h @@ -0,0 +1,17 @@ +#if HAVE_CONFIG_H +# include "config.h" +#endif + +#include <libtasn1.h> + +const ASN1_ARRAY_TYPE test_asn1_tab[] = { + { "TEST", 536872976, NULL }, + { NULL, 1073741836, NULL }, + { "TestIntegers", 1610612741, NULL }, + { "mpi", 3, NULL }, + { "TestData", 536870917, NULL }, + { "data", 1073741831, NULL }, + { "boolean", 536903684, NULL }, + { NULL, 131081, NULL }, + { NULL, 0, NULL } +}; diff --git a/pkcs11/gkm/tests/files/ca-certificates.crt b/pkcs11/gkm/fixtures/ca-certificates.crt index 1eb5c99b..1eb5c99b 100644 --- a/pkcs11/gkm/tests/files/ca-certificates.crt +++ b/pkcs11/gkm/fixtures/ca-certificates.crt diff --git a/pkcs11/gkm/tests/files/der-key-PBE-MD5-DES.p8 b/pkcs11/gkm/fixtures/der-key-PBE-MD5-DES.p8 Binary files differindex 71b7d61b..71b7d61b 100644 --- a/pkcs11/gkm/tests/files/der-key-PBE-MD5-DES.p8 +++ b/pkcs11/gkm/fixtures/der-key-PBE-MD5-DES.p8 diff --git a/pkcs11/gkm/tests/files/der-key-PBE-SHA1-3DES.p8 b/pkcs11/gkm/fixtures/der-key-PBE-SHA1-3DES.p8 Binary files differindex 1c37fe10..1c37fe10 100644 --- a/pkcs11/gkm/tests/files/der-key-PBE-SHA1-3DES.p8 +++ b/pkcs11/gkm/fixtures/der-key-PBE-SHA1-3DES.p8 diff --git a/pkcs11/gkm/tests/files/der-key-PBE-SHA1-DES.p8 b/pkcs11/gkm/fixtures/der-key-PBE-SHA1-DES.p8 Binary files differindex 99896139..99896139 100644 --- a/pkcs11/gkm/tests/files/der-key-PBE-SHA1-DES.p8 +++ b/pkcs11/gkm/fixtures/der-key-PBE-SHA1-DES.p8 diff --git a/pkcs11/gkm/tests/files/der-key-PBE-SHA1-RC2-40.p8 b/pkcs11/gkm/fixtures/der-key-PBE-SHA1-RC2-40.p8 Binary files differindex 820926cc..820926cc 100644 --- a/pkcs11/gkm/tests/files/der-key-PBE-SHA1-RC2-40.p8 +++ b/pkcs11/gkm/fixtures/der-key-PBE-SHA1-RC2-40.p8 diff --git a/pkcs11/gkm/tests/files/der-key-PBE-SHA1-RC4-128.p8 b/pkcs11/gkm/fixtures/der-key-PBE-SHA1-RC4-128.p8 Binary files differindex 2888450c..2888450c 100644 --- a/pkcs11/gkm/tests/files/der-key-PBE-SHA1-RC4-128.p8 +++ b/pkcs11/gkm/fixtures/der-key-PBE-SHA1-RC4-128.p8 diff --git a/pkcs11/gkm/tests/files/der-key-dsa.p8 b/pkcs11/gkm/fixtures/der-key-dsa.p8 Binary files differindex 8b61684e..8b61684e 100644 --- a/pkcs11/gkm/tests/files/der-key-dsa.p8 +++ b/pkcs11/gkm/fixtures/der-key-dsa.p8 diff --git a/pkcs11/gkm/tests/files/der-key-encrypted-pkcs5.p8 b/pkcs11/gkm/fixtures/der-key-encrypted-pkcs5.p8 Binary files differindex 68c6b4a5..68c6b4a5 100644 --- a/pkcs11/gkm/tests/files/der-key-encrypted-pkcs5.p8 +++ b/pkcs11/gkm/fixtures/der-key-encrypted-pkcs5.p8 diff --git a/pkcs11/gkm/tests/files/der-key-v2-des.p8 b/pkcs11/gkm/fixtures/der-key-v2-des.p8 Binary files differindex 4cd80348..4cd80348 100644 --- a/pkcs11/gkm/tests/files/der-key-v2-des.p8 +++ b/pkcs11/gkm/fixtures/der-key-v2-des.p8 diff --git a/pkcs11/gkm/tests/files/der-key-v2-des3.p8 b/pkcs11/gkm/fixtures/der-key-v2-des3.p8 Binary files differindex 9e2999c8..9e2999c8 100644 --- a/pkcs11/gkm/tests/files/der-key-v2-des3.p8 +++ b/pkcs11/gkm/fixtures/der-key-v2-des3.p8 diff --git a/pkcs11/gkm/tests/files/der-key.p8 b/pkcs11/gkm/fixtures/der-key.p8 Binary files differindex 16505632..16505632 100644 --- a/pkcs11/gkm/tests/files/der-key.p8 +++ b/pkcs11/gkm/fixtures/der-key.p8 diff --git a/pkcs11/gkm/tests/files/pem-rsa-enc.key b/pkcs11/gkm/fixtures/pem-rsa-enc.key index 65439fe6..65439fe6 100644 --- a/pkcs11/gkm/tests/files/pem-rsa-enc.key +++ b/pkcs11/gkm/fixtures/pem-rsa-enc.key diff --git a/pkcs11/gkm/tests/files/test-certificate-1.der b/pkcs11/gkm/fixtures/test-certificate-1.der Binary files differindex 1c084370..1c084370 100644 --- a/pkcs11/gkm/tests/files/test-certificate-1.der +++ b/pkcs11/gkm/fixtures/test-certificate-1.der diff --git a/pkcs11/gkm/tests/files/test-certificate-2.der b/pkcs11/gkm/fixtures/test-certificate-2.der Binary files differindex c5d0ce1a..c5d0ce1a 100644 --- a/pkcs11/gkm/tests/files/test-certificate-2.der +++ b/pkcs11/gkm/fixtures/test-certificate-2.der diff --git a/pkcs11/gkm/tests/mock-locked-object.c b/pkcs11/gkm/mock-locked-object.c index 951916e9..951916e9 100644 --- a/pkcs11/gkm/tests/mock-locked-object.c +++ b/pkcs11/gkm/mock-locked-object.c diff --git a/pkcs11/gkm/tests/mock-locked-object.h b/pkcs11/gkm/mock-locked-object.h index 26cf83ed..26cf83ed 100644 --- a/pkcs11/gkm/tests/mock-locked-object.h +++ b/pkcs11/gkm/mock-locked-object.h diff --git a/pkcs11/gkm/tests/mock-module.c b/pkcs11/gkm/mock-module.c index 6b98630c..56760262 100644 --- a/pkcs11/gkm/tests/mock-module.c +++ b/pkcs11/gkm/mock-module.c @@ -109,7 +109,7 @@ mock_module_object_new (GkmSession *session) { CKA_CERTIFICATE_TYPE, &type, sizeof (type) }, }; - if (!g_file_get_contents (SRCDIR "/files/test-certificate-1.der", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-1.der", &data, &n_data, NULL)) g_assert_not_reached (); attrs[0].pValue = data; diff --git a/pkcs11/gkm/tests/mock-module.h b/pkcs11/gkm/mock-module.h index d633faac..d633faac 100644 --- a/pkcs11/gkm/tests/mock-module.h +++ b/pkcs11/gkm/mock-module.h diff --git a/pkcs11/gkm/tests/test-attributes.c b/pkcs11/gkm/test-attributes.c index 2d7b9d8c..2d7b9d8c 100644 --- a/pkcs11/gkm/tests/test-attributes.c +++ b/pkcs11/gkm/test-attributes.c diff --git a/pkcs11/gkm/tests/test-certificate.c b/pkcs11/gkm/test-certificate.c index 42f1442c..9356ad2e 100644 --- a/pkcs11/gkm/tests/test-certificate.c +++ b/pkcs11/gkm/test-certificate.c @@ -53,7 +53,7 @@ setup_basic (Test* test, test->module = mock_module_initialize_and_enter (); test->session = mock_module_open_session (TRUE); - if (!g_file_get_contents (SRCDIR "/files/test-certificate-1.der", &data, &length, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-1.der", &data, &length, NULL)) g_assert_not_reached (); test->certificate_data = g_bytes_new_take (data, length); diff --git a/pkcs11/gkm/tests/test-credential.c b/pkcs11/gkm/test-credential.c index 3a7d26a8..3a7d26a8 100644 --- a/pkcs11/gkm/tests/test-credential.c +++ b/pkcs11/gkm/test-credential.c diff --git a/pkcs11/gkm/tests/test-data-asn1.c b/pkcs11/gkm/test-data-asn1.c index 5d613c15..79786524 100644 --- a/pkcs11/gkm/tests/test-data-asn1.c +++ b/pkcs11/gkm/test-data-asn1.c @@ -50,7 +50,7 @@ setup (Test *test, gconstpointer unused) gchar *contents; gsize length; - if (!g_file_get_contents (SRCDIR "/files/test-certificate-1.der", &contents, &length, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-1.der", &contents, &length, NULL)) g_assert_not_reached (); data = g_bytes_new_take (contents, length); diff --git a/pkcs11/gkm/tests/test-data-der.c b/pkcs11/gkm/test-data-der.c index 54c3ce11..592ed9b9 100644 --- a/pkcs11/gkm/tests/test-data-der.c +++ b/pkcs11/gkm/test-data-der.c @@ -119,7 +119,7 @@ setup (Test *test, gconstpointer unused) { GBytes *data; - if (!g_file_get_contents (SRCDIR "/files/test-certificate-1.der", &test->certificate_data, &test->n_certificate_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-1.der", &test->certificate_data, &test->n_certificate_data, NULL)) g_assert_not_reached (); data = g_bytes_new (test->certificate_data, test->n_certificate_data); @@ -127,7 +127,7 @@ setup (Test *test, gconstpointer unused) g_assert (test->certificate != NULL); g_bytes_unref (data); - if (!g_file_get_contents (SRCDIR "/files/test-certificate-2.der", &test->certificate2_data, &test->n_certificate2_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-2.der", &test->certificate2_data, &test->n_certificate2_data, NULL)) g_assert_not_reached (); data = g_bytes_new (test->certificate2_data, test->n_certificate2_data); test->certificate2 = egg_asn1x_create_and_decode (pkix_asn1_tab, "Certificate", data); @@ -342,7 +342,7 @@ test_read_ca_certificates_public_key_info (Test *test, gconstpointer unused) gchar *data; gsize n_data; - if (!g_file_get_contents (SRCDIR "/files/ca-certificates.crt", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/ca-certificates.crt", &data, &n_data, NULL)) g_assert_not_reached (); bytes = g_bytes_new_take (data, n_data); @@ -448,7 +448,7 @@ test_read_all_pkcs8 (Test *test, gconstpointer unused) gsize n_data; gchar *path; - dir = g_dir_open (SRCDIR "/files", 0, NULL); + dir = g_dir_open (SRCDIR "/fixtures", 0, NULL); g_assert (dir); for(;;) { @@ -459,7 +459,7 @@ test_read_all_pkcs8 (Test *test, gconstpointer unused) if (!g_pattern_match_simple ("der-key-*", name)) continue; - path = g_build_filename (SRCDIR "/files", name, NULL); + path = g_build_filename (SRCDIR "/fixtures", name, NULL); if (!g_file_get_contents (path, &data, &n_data, NULL)) g_assert_not_reached (); g_free (path); @@ -485,7 +485,7 @@ test_read_pkcs8_bad_password (Test *test, gconstpointer unused) gchar *data; gsize n_data; - if (!g_file_get_contents (SRCDIR "/files/der-key-encrypted-pkcs5.p8", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/der-key-encrypted-pkcs5.p8", &data, &n_data, NULL)) g_assert_not_reached (); bytes = g_bytes_new_take (data, n_data); diff --git a/pkcs11/gkm/tests/test-file-tracker.c b/pkcs11/gkm/test-file-tracker.c index 4853e6ab..4853e6ab 100644 --- a/pkcs11/gkm/tests/test-file-tracker.c +++ b/pkcs11/gkm/test-file-tracker.c diff --git a/pkcs11/gkm/tests/test-memory-store.c b/pkcs11/gkm/test-memory-store.c index 54566764..54566764 100644 --- a/pkcs11/gkm/tests/test-memory-store.c +++ b/pkcs11/gkm/test-memory-store.c diff --git a/pkcs11/gkm/tests/test-object.c b/pkcs11/gkm/test-object.c index 7ecca5b3..53c2e9be 100644 --- a/pkcs11/gkm/tests/test-object.c +++ b/pkcs11/gkm/test-object.c @@ -47,7 +47,7 @@ setup (Test* test, gconstpointer unused) test->module = mock_module_initialize_and_enter (); test->session = mock_module_open_session (TRUE); - if (!g_file_get_contents (SRCDIR "/files/test-certificate-1.der", &test->certificate_data, &test->n_certificate_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-1.der", &test->certificate_data, &test->n_certificate_data, NULL)) g_assert_not_reached (); } diff --git a/pkcs11/gkm/tests/test-secret.c b/pkcs11/gkm/test-secret.c index cf9e4bdb..cf9e4bdb 100644 --- a/pkcs11/gkm/tests/test-secret.c +++ b/pkcs11/gkm/test-secret.c diff --git a/pkcs11/gkm/tests/test-sexp.c b/pkcs11/gkm/test-sexp.c index 1e1a7463..1e1a7463 100644 --- a/pkcs11/gkm/tests/test-sexp.c +++ b/pkcs11/gkm/test-sexp.c diff --git a/pkcs11/gkm/tests/test-store.c b/pkcs11/gkm/test-store.c index 87314d0c..87314d0c 100644 --- a/pkcs11/gkm/tests/test-store.c +++ b/pkcs11/gkm/test-store.c diff --git a/pkcs11/gkm/tests/test-timer.c b/pkcs11/gkm/test-timer.c index dd924b98..dd924b98 100644 --- a/pkcs11/gkm/tests/test-timer.c +++ b/pkcs11/gkm/test-timer.c diff --git a/pkcs11/gkm/tests/test-transaction.c b/pkcs11/gkm/test-transaction.c index 7c2dd839..7c2dd839 100644 --- a/pkcs11/gkm/tests/test-transaction.c +++ b/pkcs11/gkm/test-transaction.c diff --git a/pkcs11/gkm/tests/test.asn b/pkcs11/gkm/test.asn index d6ca54dd..d6ca54dd 100644 --- a/pkcs11/gkm/tests/test.asn +++ b/pkcs11/gkm/test.asn diff --git a/pkcs11/gkm/tests/test.asn.h b/pkcs11/gkm/test.asn.h index 9a6381e7..9a6381e7 100644 --- a/pkcs11/gkm/tests/test.asn.h +++ b/pkcs11/gkm/test.asn.h diff --git a/pkcs11/gkm/tests/.gitignore b/pkcs11/gkm/tests/.gitignore deleted file mode 100644 index cb91a115..00000000 --- a/pkcs11/gkm/tests/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/asn1-def-test.h -/dump-data-file diff --git a/pkcs11/gkm/tests/Makefile.am b/pkcs11/gkm/tests/Makefile.am deleted file mode 100644 index faf50819..00000000 --- a/pkcs11/gkm/tests/Makefile.am +++ /dev/null @@ -1,79 +0,0 @@ -include $(top_srcdir)/Makefile.decl - -INCLUDES = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/pkcs11 \ - -DSRCDIR="\"@abs_srcdir@\"" \ - $(GLIB_CFLAGS) \ - $(LIBGCRYPT_CFLAGS) - -LDADD = \ - $(top_builddir)/pkcs11/gkm/libgkm.la \ - $(top_builddir)/egg/libegg.la \ - $(GLIB_LIBS) \ - $(GTHREAD_LIBS) \ - $(LIBGCRYPT_LIBS) - -noinst_LIBRARIES = libgkm-mock.a - -libgkm_mock_a_SOURCES = \ - mock-module.c mock-module.h \ - mock-locked-object.c mock-locked-object.h \ - test.asn.h - -TEST_PROGS = \ - test-attributes \ - test-credential \ - test-data-asn1 \ - test-data-der \ - test-file-tracker \ - test-memory-store \ - test-object \ - test-certificate \ - test-secret \ - test-sexp \ - test-store \ - test-timer \ - test-transaction - -test_credential_LDADD = \ - libgkm-mock.a \ - $(LDADD) - -test_memory_store_LDADD = \ - libgkm-mock.a \ - $(LDADD) - -test_object_LDADD = \ - libgkm-mock.a \ - $(LDADD) - -test_certificate_LDADD = \ - libgkm-mock.a \ - $(LDADD) - -test_store_LDADD = \ - libgkm-mock.a \ - $(LDADD) - -test_timer_LDADD = \ - libgkm-mock.a \ - $(LDADD) - -check_PROGRAMS = $(TEST_PROGS) - -test: $(TEST_PROGS) - gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) - -check-local: test - -all-local: $(check_PROGRAMS) - -EXTRA_DIST = \ - test.asn \ - files - -asn: - asn1Parser -o test.asn.h test.asn - sed -i 's|#include.*|/* \0 */|' test.asn.h diff --git a/pkcs11/gnome2-store/Makefile.am b/pkcs11/gnome2-store/Makefile.am index e1f0c2bf..cca0a7f6 100644 --- a/pkcs11/gnome2-store/Makefile.am +++ b/pkcs11/gnome2-store/Makefile.am @@ -1,9 +1,11 @@ +include $(top_srcdir)/Makefile.decl INCLUDES = \ -I$(top_builddir) \ -I$(top_builddir)/pkcs11 \ -I$(top_srcdir) \ -I$(top_srcdir)/pkcs11 \ + -DSRCDIR="\"@abs_srcdir@\"" \ $(GOBJECT_CFLAGS) \ $(LIBGCRYPT_CFLAGS) \ $(GLIB_CFLAGS) @@ -49,4 +51,59 @@ gkm_gnome2_store_standalone_la_LIBADD = \ # ------------------------------------------------------------------------------- -SUBDIRS = . tests +LDADD = \ + $(top_builddir)/pkcs11/gnome2-store/libgkm-gnome2-store.la \ + $(top_builddir)/pkcs11/gkm/libgkm.la \ + $(top_builddir)/egg/libegg.la \ + $(GLIB_LIBS) \ + $(LIBGCRYPT_LIBS) + +if WITH_P11_TESTS +CHECK_PROGS = check-gnome2-module +else +CHECK_PROGS = +endif + +CHECK_FILES = \ + p11-tests.conf + +TEST_PROGS = \ + test-gnome2-file \ + test-gnome2-storage \ + test-gnome2-private-key \ + test-import + +test_gnome2_storage_SOURCES = \ + test-gnome2-storage.c \ + mock-gnome2-module.c mock-gnome2-module.h + +test_gnome2_private_key_SOURCES = \ + test-gnome2-private-key.c \ + mock-gnome2-module.c mock-gnome2-module.h + +test_import_CFLAGS = $(GCR_BASE_CFLAGS) $(GCK_CFLAGS) +test_import_LDADD = $(GCR_BASE_LIBS) $(GCK_LIBS) $(LDADD) + +check_PROGRAMS = $(TEST_PROGS) + +test: $(TEST_PROGS) $(CHECK_PROGS) $(CHECK_FILES) + gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) + @for prog in $(CHECK_PROGS); do SRCDIR='.' ./$$prog || exit 1; done + +check-local: test + +all-local: $(check_PROGRAMS) + +noinst_PROGRAMS = \ + frob-gnome2-file \ + $(CHECK_PROGS) + +check_gnome2_module_CFLAGS = $(P11_TESTS_CFLAGS) +check_gnome2_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) + +EXTRA_DIST = \ + p11-tests.conf.in \ + fixtures + +CLEANFILES = \ + $(CHECK_FILES) diff --git a/pkcs11/gnome2-store/tests/check-gnome2-module.c b/pkcs11/gnome2-store/check-gnome2-module.c index 97e86d3f..97e86d3f 100644 --- a/pkcs11/gnome2-store/tests/check-gnome2-module.c +++ b/pkcs11/gnome2-store/check-gnome2-module.c diff --git a/pkcs11/gnome2-store/tests/files/.gitempty b/pkcs11/gnome2-store/fixtures/.gitempty index e69de29b..e69de29b 100644 --- a/pkcs11/gnome2-store/tests/files/.gitempty +++ b/pkcs11/gnome2-store/fixtures/.gitempty diff --git a/pkcs11/gnome2-store/tests/files/Thawte_Personal_Premium_CA.cer b/pkcs11/gnome2-store/fixtures/Thawte_Personal_Premium_CA.cer Binary files differindex 1c084370..1c084370 100644 --- a/pkcs11/gnome2-store/tests/files/Thawte_Personal_Premium_CA.cer +++ b/pkcs11/gnome2-store/fixtures/Thawte_Personal_Premium_CA.cer diff --git a/pkcs11/gnome2-store/tests/files/data-file-private.store b/pkcs11/gnome2-store/fixtures/data-file-private.store Binary files differindex 4f978a0c..4f978a0c 100644 --- a/pkcs11/gnome2-store/tests/files/data-file-private.store +++ b/pkcs11/gnome2-store/fixtures/data-file-private.store diff --git a/pkcs11/gnome2-store/tests/files/data-file-public.store b/pkcs11/gnome2-store/fixtures/data-file-public.store Binary files differindex 9c19087a..9c19087a 100644 --- a/pkcs11/gnome2-store/tests/files/data-file-public.store +++ b/pkcs11/gnome2-store/fixtures/data-file-public.store diff --git a/pkcs11/gnome2-store/tests/files/der-key-v2-des3.p8 b/pkcs11/gnome2-store/fixtures/der-key-v2-des3.p8 Binary files differindex 9e2999c8..9e2999c8 100644 --- a/pkcs11/gnome2-store/tests/files/der-key-v2-des3.p8 +++ b/pkcs11/gnome2-store/fixtures/der-key-v2-des3.p8 diff --git a/pkcs11/gnome2-store/tests/files/personal.p12 b/pkcs11/gnome2-store/fixtures/personal.p12 Binary files differindex 7ae3d05d..7ae3d05d 100644 --- a/pkcs11/gnome2-store/tests/files/personal.p12 +++ b/pkcs11/gnome2-store/fixtures/personal.p12 diff --git a/pkcs11/gnome2-store/tests/files/test-certificate.cer b/pkcs11/gnome2-store/fixtures/test-certificate.cer Binary files differindex 719b0ff2..719b0ff2 100644 --- a/pkcs11/gnome2-store/tests/files/test-certificate.cer +++ b/pkcs11/gnome2-store/fixtures/test-certificate.cer diff --git a/pkcs11/gnome2-store/tests/files/user.keystore b/pkcs11/gnome2-store/fixtures/user.keystore Binary files differindex d606f237..d606f237 100644 --- a/pkcs11/gnome2-store/tests/files/user.keystore +++ b/pkcs11/gnome2-store/fixtures/user.keystore diff --git a/pkcs11/gnome2-store/tests/frob-gnome2-file.c b/pkcs11/gnome2-store/frob-gnome2-file.c index b76e208e..b76e208e 100644 --- a/pkcs11/gnome2-store/tests/frob-gnome2-file.c +++ b/pkcs11/gnome2-store/frob-gnome2-file.c diff --git a/pkcs11/gnome2-store/tests/mock-gnome2-module.c b/pkcs11/gnome2-store/mock-gnome2-module.c index 09547b05..09547b05 100644 --- a/pkcs11/gnome2-store/tests/mock-gnome2-module.c +++ b/pkcs11/gnome2-store/mock-gnome2-module.c diff --git a/pkcs11/gnome2-store/tests/mock-gnome2-module.h b/pkcs11/gnome2-store/mock-gnome2-module.h index 5b380ae5..5b380ae5 100644 --- a/pkcs11/gnome2-store/tests/mock-gnome2-module.h +++ b/pkcs11/gnome2-store/mock-gnome2-module.h diff --git a/pkcs11/gnome2-store/tests/p11-tests.conf.in b/pkcs11/gnome2-store/p11-tests.conf.in index 4437c5cf..4437c5cf 100644 --- a/pkcs11/gnome2-store/tests/p11-tests.conf.in +++ b/pkcs11/gnome2-store/p11-tests.conf.in diff --git a/pkcs11/gnome2-store/tests/test-gnome2-file.c b/pkcs11/gnome2-store/test-gnome2-file.c index 614a083f..28e9d53c 100644 --- a/pkcs11/gnome2-store/tests/test-gnome2-file.c +++ b/pkcs11/gnome2-store/test-gnome2-file.c @@ -52,8 +52,8 @@ EGG_SECURE_DEFINE_GLIB_GLOBALS (); static void setup (Test *test, gconstpointer unused) { - test->public_filename = g_build_filename (SRCDIR "/files", "data-file-public.store", NULL); - test->private_filename = g_build_filename (SRCDIR "/files", "data-file-private.store", NULL); + test->public_filename = g_build_filename (SRCDIR "/fixtures", "data-file-public.store", NULL); + test->private_filename = g_build_filename (SRCDIR "/fixtures", "data-file-private.store", NULL); test->write_filename = g_build_filename ("/tmp", "unit-test-file.store", NULL); test->data_file = gkm_gnome2_file_new (); diff --git a/pkcs11/gnome2-store/tests/test-gnome2-private-key.c b/pkcs11/gnome2-store/test-gnome2-private-key.c index 7e43ac63..de6d18de 100644 --- a/pkcs11/gnome2-store/tests/test-gnome2-private-key.c +++ b/pkcs11/gnome2-store/test-gnome2-private-key.c @@ -58,7 +58,7 @@ setup_basic (Test* test, test->module = mock_gnome2_module_initialize_and_enter (); test->session = mock_gnome2_module_open_session (TRUE); - if (!g_file_get_contents (SRCDIR "/files/der-key-v2-des3.p8", &data, &length, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/der-key-v2-des3.p8", &data, &length, NULL)) g_assert_not_reached (); test->key_data = g_bytes_new_take (data, length); diff --git a/pkcs11/gnome2-store/tests/test-gnome2-storage.c b/pkcs11/gnome2-store/test-gnome2-storage.c index a89376a4..d0fd4d85 100644 --- a/pkcs11/gnome2-store/tests/test-gnome2-storage.c +++ b/pkcs11/gnome2-store/test-gnome2-storage.c @@ -59,8 +59,8 @@ setup_directory (Test *test, gconstpointer unused) { test->directory = egg_tests_create_scratch_directory ( - SRCDIR "/files/Thawte_Personal_Premium_CA.cer", - SRCDIR "/files/user.keystore", + SRCDIR "/fixtures/Thawte_Personal_Premium_CA.cer", + SRCDIR "/fixtures/user.keystore", NULL); } @@ -102,7 +102,7 @@ setup_module (Test *test, "module", test->module, "manager", manager, NULL); - g_file_get_contents (SRCDIR "/files/test-certificate.cer", &contents, &length, &error); + g_file_get_contents (SRCDIR "/fixtures/test-certificate.cer", &contents, &length, &error); g_assert_no_error (error); bytes = g_bytes_new_take (contents, length); diff --git a/pkcs11/gnome2-store/tests/test-import.c b/pkcs11/gnome2-store/test-import.c index d1c30a44..4547df74 100644 --- a/pkcs11/gnome2-store/tests/test-import.c +++ b/pkcs11/gnome2-store/test-import.c @@ -133,7 +133,7 @@ test_pkcs12_import (Test *test, gsize length; GList *l; - g_file_get_contents (SRCDIR "/files/personal.p12", &contents, &length, &error); + g_file_get_contents (SRCDIR "/fixtures/personal.p12", &contents, &length, &error); g_assert_no_error (error); /* Parse the pkcs12 file */ diff --git a/pkcs11/gnome2-store/tests/.gitignore b/pkcs11/gnome2-store/tests/.gitignore deleted file mode 100644 index 69775635..00000000 --- a/pkcs11/gnome2-store/tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/dump-gnome2-file diff --git a/pkcs11/gnome2-store/tests/Makefile.am b/pkcs11/gnome2-store/tests/Makefile.am deleted file mode 100644 index 64731dd8..00000000 --- a/pkcs11/gnome2-store/tests/Makefile.am +++ /dev/null @@ -1,66 +0,0 @@ -include $(top_srcdir)/Makefile.decl - -INCLUDES = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/pkcs11 \ - -DSRCDIR="\"@abs_srcdir@\"" \ - $(GLIB_CFLAGS) \ - $(LIBGCRYPT_CFLAGS) - -LDADD = \ - $(top_builddir)/pkcs11/gnome2-store/libgkm-gnome2-store.la \ - $(top_builddir)/pkcs11/gkm/libgkm.la \ - $(top_builddir)/egg/libegg.la \ - $(GLIB_LIBS) \ - $(LIBGCRYPT_LIBS) - -if WITH_P11_TESTS -CHECK_PROGS = check-gnome2-module -else -CHECK_PROGS = -endif - -CHECK_FILES = \ - p11-tests.conf - -TEST_PROGS = \ - test-gnome2-file \ - test-gnome2-storage \ - test-gnome2-private-key \ - test-import - -test_gnome2_storage_SOURCES = \ - test-gnome2-storage.c \ - mock-gnome2-module.c mock-gnome2-module.h - -test_gnome2_private_key_SOURCES = \ - test-gnome2-private-key.c \ - mock-gnome2-module.c mock-gnome2-module.h - -test_import_CFLAGS = $(GCR_BASE_CFLAGS) $(GCK_CFLAGS) -test_import_LDADD = $(GCR_BASE_LIBS) $(GCK_LIBS) $(LDADD) - -check_PROGRAMS = $(TEST_PROGS) - -test: $(TEST_PROGS) $(CHECK_PROGS) $(CHECK_FILES) - gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) - @for prog in $(CHECK_PROGS); do SRCDIR='.' ./$$prog || exit 1; done - -check-local: test - -all-local: $(check_PROGRAMS) - -noinst_PROGRAMS = \ - frob-gnome2-file \ - $(CHECK_PROGS) - -check_gnome2_module_CFLAGS = $(P11_TESTS_CFLAGS) -check_gnome2_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) - -EXTRA_DIST = \ - p11-tests.conf.in \ - files - -CLEANFILES = \ - $(CHECK_FILES) diff --git a/pkcs11/secret-store/Makefile.am b/pkcs11/secret-store/Makefile.am index c0dbbbbe..d7cc8bfd 100644 --- a/pkcs11/secret-store/Makefile.am +++ b/pkcs11/secret-store/Makefile.am @@ -3,6 +3,7 @@ INCLUDES = \ -I$(top_builddir) \ -I$(top_srcdir) \ -I$(top_srcdir)/pkcs11 \ + -DSRCDIR="\"@abs_srcdir@\"" \ $(GOBJECT_CFLAGS) \ $(GLIB_CFLAGS) \ $(GMODULE_CFLAGS) @@ -52,5 +53,44 @@ gkm_secret_store_standalone_la_LIBADD = \ $(LIBGCRYPT_LIBS) # ------------------------------------------------------------------------------- +# TESTS -SUBDIRS = . tests +LDADD = \ + libgkm-mock-secret-module.a \ + $(top_builddir)/pkcs11/secret-store/libgkm-secret-store.la \ + $(top_builddir)/pkcs11/gkm/libgkm.la \ + $(top_builddir)/egg/libegg.la \ + $(GLIB_LIBS) \ + $(LIBGCRYPT_LIBS) + +noinst_LIBRARIES = libgkm-mock-secret-module.a + +libgkm_mock_secret_module_a_SOURCES = \ + mock-secret-module.c mock-secret-module.h + +noinst_PROGRAMS = dump-keyring0-format + +TEST_PROGS = \ + test-secret-compat \ + test-secret-fields \ + test-secret-data \ + test-secret-object \ + test-secret-collection \ + test-secret-item \ + test-secret-schema \ + test-secret-search \ + test-secret-textual \ + test-secret-binary \ + test-secret-schema + +check_PROGRAMS = $(TEST_PROGS) + +test: $(TEST_PROGS) + gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) + +check-local: test + +all-local: $(check_PROGRAMS) + +EXTRA_DIST = \ + fixtures diff --git a/pkcs11/secret-store/tests/dump-keyring0-format.c b/pkcs11/secret-store/dump-keyring0-format.c index a459cd33..a459cd33 100644 --- a/pkcs11/secret-store/tests/dump-keyring0-format.c +++ b/pkcs11/secret-store/dump-keyring0-format.c diff --git a/pkcs11/secret-store/tests/files/created-on-rhel.keyring b/pkcs11/secret-store/fixtures/created-on-rhel.keyring Binary files differindex 9df16d11..9df16d11 100644 --- a/pkcs11/secret-store/tests/files/created-on-rhel.keyring +++ b/pkcs11/secret-store/fixtures/created-on-rhel.keyring diff --git a/pkcs11/secret-store/tests/files/created-on-solaris-opencsw.keyring b/pkcs11/secret-store/fixtures/created-on-solaris-opencsw.keyring Binary files differindex 11dbce6e..11dbce6e 100644 --- a/pkcs11/secret-store/tests/files/created-on-solaris-opencsw.keyring +++ b/pkcs11/secret-store/fixtures/created-on-solaris-opencsw.keyring diff --git a/pkcs11/secret-store/tests/files/encrypted-with-schema.keyring b/pkcs11/secret-store/fixtures/encrypted-with-schema.keyring Binary files differindex 63d1a730..63d1a730 100644 --- a/pkcs11/secret-store/tests/files/encrypted-with-schema.keyring +++ b/pkcs11/secret-store/fixtures/encrypted-with-schema.keyring diff --git a/pkcs11/secret-store/tests/files/encrypted.keyring b/pkcs11/secret-store/fixtures/encrypted.keyring Binary files differindex 742aecc3..742aecc3 100644 --- a/pkcs11/secret-store/tests/files/encrypted.keyring +++ b/pkcs11/secret-store/fixtures/encrypted.keyring diff --git a/pkcs11/secret-store/tests/files/plain-bad-number.keyring b/pkcs11/secret-store/fixtures/plain-bad-number.keyring index e5ff5ac9..e5ff5ac9 100644 --- a/pkcs11/secret-store/tests/files/plain-bad-number.keyring +++ b/pkcs11/secret-store/fixtures/plain-bad-number.keyring diff --git a/pkcs11/secret-store/tests/files/plain-with-schema.keyring b/pkcs11/secret-store/fixtures/plain-with-schema.keyring index b2d51cda..b2d51cda 100644 --- a/pkcs11/secret-store/tests/files/plain-with-schema.keyring +++ b/pkcs11/secret-store/fixtures/plain-with-schema.keyring diff --git a/pkcs11/secret-store/tests/files/plain.keyring b/pkcs11/secret-store/fixtures/plain.keyring index c048aa10..c048aa10 100644 --- a/pkcs11/secret-store/tests/files/plain.keyring +++ b/pkcs11/secret-store/fixtures/plain.keyring diff --git a/pkcs11/secret-store/tests/files/schema1.keyring b/pkcs11/secret-store/fixtures/schema1.keyring Binary files differindex 579a8614..579a8614 100644 --- a/pkcs11/secret-store/tests/files/schema1.keyring +++ b/pkcs11/secret-store/fixtures/schema1.keyring diff --git a/pkcs11/secret-store/tests/files/schema2.keyring b/pkcs11/secret-store/fixtures/schema2.keyring Binary files differindex 8c0fcbc4..8c0fcbc4 100644 --- a/pkcs11/secret-store/tests/files/schema2.keyring +++ b/pkcs11/secret-store/fixtures/schema2.keyring diff --git a/pkcs11/secret-store/tests/mock-secret-module.c b/pkcs11/secret-store/mock-secret-module.c index afcda04d..bf6bc96b 100644 --- a/pkcs11/secret-store/tests/mock-secret-module.c +++ b/pkcs11/secret-store/mock-secret-module.c @@ -59,8 +59,8 @@ test_secret_module_initialize_and_enter (void) CK_RV rv; directory = egg_tests_create_scratch_directory ( - SRCDIR "/files/encrypted.keyring", - SRCDIR "/files/plain.keyring", + SRCDIR "/fixtures/encrypted.keyring", + SRCDIR "/fixtures/plain.keyring", NULL); /* Setup test directory to work in */ diff --git a/pkcs11/secret-store/tests/mock-secret-module.h b/pkcs11/secret-store/mock-secret-module.h index d577d394..d577d394 100644 --- a/pkcs11/secret-store/tests/mock-secret-module.h +++ b/pkcs11/secret-store/mock-secret-module.h diff --git a/pkcs11/secret-store/tests/test-secret-binary.c b/pkcs11/secret-store/test-secret-binary.c index 0302469e..2900cb45 100644 --- a/pkcs11/secret-store/tests/test-secret-binary.c +++ b/pkcs11/secret-store/test-secret-binary.c @@ -99,7 +99,7 @@ test_read_encrypted (Test *test, gconstpointer unused) { GkmDataResult res; - res = check_read_keyring_file (test, SRCDIR "/files/encrypted.keyring"); + res = check_read_keyring_file (test, SRCDIR "/fixtures/encrypted.keyring"); g_assert (res == GKM_DATA_SUCCESS); test_secret_collection_validate (test->collection, test->sdata); @@ -110,7 +110,7 @@ test_read_wrong_format (Test *test, gconstpointer unused) { GkmDataResult res; - res = check_read_keyring_file (test, SRCDIR "/files/plain.keyring"); + res = check_read_keyring_file (test, SRCDIR "/fixtures/plain.keyring"); g_assert (res == GKM_DATA_UNRECOGNIZED); } @@ -124,7 +124,7 @@ test_read_wrong_master (Test *test, gconstpointer unused) gkm_secret_data_set_master (test->sdata, master); g_object_unref (master); - res = check_read_keyring_file (test, SRCDIR "/files/encrypted.keyring"); + res = check_read_keyring_file (test, SRCDIR "/fixtures/encrypted.keyring"); g_assert (res == GKM_DATA_LOCKED); } @@ -135,7 +135,7 @@ test_read_sdata_but_no_master (Test *test, gconstpointer unused) gkm_secret_data_set_master (test->sdata, NULL); - res = check_read_keyring_file (test, SRCDIR "/files/encrypted.keyring"); + res = check_read_keyring_file (test, SRCDIR "/fixtures/encrypted.keyring"); g_assert (res == GKM_DATA_LOCKED); } @@ -166,7 +166,7 @@ test_remove_unavailable (Test *test, gconstpointer unused) gchar *data; gsize n_data; - if (!g_file_get_contents (SRCDIR "/files/encrypted.keyring", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/encrypted.keyring", &data, &n_data, NULL)) g_assert_not_reached (); res = gkm_secret_binary_read (test->collection, test->sdata, data, n_data); g_assert (res == GKM_DATA_SUCCESS); @@ -206,7 +206,7 @@ test_read_created_on_solaris_opencsw (Test *test, gconstpointer unused) gkm_secret_data_set_master (test->sdata, master); g_object_unref (master); - res = check_read_keyring_file (test, SRCDIR "/files/created-on-solaris-opencsw.keyring"); + res = check_read_keyring_file (test, SRCDIR "/fixtures/created-on-solaris-opencsw.keyring"); g_assert_cmpint (res, ==, GKM_DATA_SUCCESS); } @@ -220,7 +220,7 @@ test_read_created_on_rhel (Test *test, gconstpointer unused) gkm_secret_data_set_master (test->sdata, master); g_object_unref (master); - res = check_read_keyring_file (test, SRCDIR "/files/created-on-rhel.keyring"); + res = check_read_keyring_file (test, SRCDIR "/fixtures/created-on-rhel.keyring"); g_assert_cmpint (res, ==, GKM_DATA_SUCCESS); } @@ -235,7 +235,7 @@ test_read_with_schema (Test *test, master = gkm_secret_new_from_password ("test"); gkm_secret_data_set_master (test->sdata, master); g_object_unref (master); - res = check_read_keyring_file (test, SRCDIR "/files/encrypted-with-schema.keyring"); + res = check_read_keyring_file (test, SRCDIR "/fixtures/encrypted-with-schema.keyring"); g_assert_cmpint (res, ==, GKM_DATA_SUCCESS); item = gkm_secret_collection_get_item (test->collection, "1"); diff --git a/pkcs11/secret-store/tests/test-secret-collection.c b/pkcs11/secret-store/test-secret-collection.c index 7d6d6702..f9e03940 100644 --- a/pkcs11/secret-store/tests/test-secret-collection.c +++ b/pkcs11/secret-store/test-secret-collection.c @@ -171,7 +171,7 @@ test_load_unlock_plain (Test *test, gconstpointer unused) GkmDataResult res; CK_RV rv; - gkm_secret_collection_set_filename (test->collection, SRCDIR "/files/plain.keyring"); + gkm_secret_collection_set_filename (test->collection, SRCDIR "/fixtures/plain.keyring"); /* Load the data in the file */ res = gkm_secret_collection_load (test->collection); @@ -197,7 +197,7 @@ test_load_unlock_encrypted (Test *test, gconstpointer unused) GkmDataResult res; CK_RV rv; - gkm_secret_collection_set_filename (test->collection, SRCDIR "/files/encrypted.keyring"); + gkm_secret_collection_set_filename (test->collection, SRCDIR "/fixtures/encrypted.keyring"); /* Load the data in the file */ res = gkm_secret_collection_load (test->collection); @@ -223,7 +223,7 @@ test_load_unlock_bad_password (Test *test, gconstpointer unused) GkmDataResult res; CK_RV rv; - gkm_secret_collection_set_filename (test->collection, SRCDIR "/files/encrypted.keyring"); + gkm_secret_collection_set_filename (test->collection, SRCDIR "/fixtures/encrypted.keyring"); /* Load the data in the file */ res = gkm_secret_collection_load (test->collection); @@ -242,7 +242,7 @@ test_unlock_without_load (Test *test, gconstpointer unused) GkmSecretData *sdata; CK_RV rv; - gkm_secret_collection_set_filename (test->collection, SRCDIR "/files/encrypted.keyring"); + gkm_secret_collection_set_filename (test->collection, SRCDIR "/fixtures/encrypted.keyring"); /* Unlock the keyring, which should load it */ rv = gkm_credential_create (test->module, gkm_session_get_manager (test->session), GKM_OBJECT (test->collection), @@ -264,7 +264,7 @@ test_twice_unlock (Test *test, gconstpointer unused) GkmSecretData *sdata; CK_RV rv; - gkm_secret_collection_set_filename (test->collection, SRCDIR "/files/encrypted.keyring"); + gkm_secret_collection_set_filename (test->collection, SRCDIR "/fixtures/encrypted.keyring"); /* Unlock the keyring, which should load */ rv = gkm_credential_create (test->module, gkm_session_get_manager (test->session), GKM_OBJECT (test->collection), @@ -293,7 +293,7 @@ test_twice_unlock_bad_password (Test *test, gconstpointer unused) GkmSecretData *sdata; CK_RV rv; - gkm_secret_collection_set_filename (test->collection, SRCDIR "/files/encrypted.keyring"); + gkm_secret_collection_set_filename (test->collection, SRCDIR "/fixtures/encrypted.keyring"); /* Unlock the keyring, which should load */ rv = gkm_credential_create (test->module, gkm_session_get_manager (test->session), GKM_OBJECT (test->collection), diff --git a/pkcs11/secret-store/tests/test-secret-compat.c b/pkcs11/secret-store/test-secret-compat.c index 2a86ca37..2a86ca37 100644 --- a/pkcs11/secret-store/tests/test-secret-compat.c +++ b/pkcs11/secret-store/test-secret-compat.c diff --git a/pkcs11/secret-store/tests/test-secret-data.c b/pkcs11/secret-store/test-secret-data.c index 62829e0b..62829e0b 100644 --- a/pkcs11/secret-store/tests/test-secret-data.c +++ b/pkcs11/secret-store/test-secret-data.c diff --git a/pkcs11/secret-store/tests/test-secret-fields.c b/pkcs11/secret-store/test-secret-fields.c index 76c520a5..76c520a5 100644 --- a/pkcs11/secret-store/tests/test-secret-fields.c +++ b/pkcs11/secret-store/test-secret-fields.c diff --git a/pkcs11/secret-store/tests/test-secret-item.c b/pkcs11/secret-store/test-secret-item.c index cf5ad88c..cf5ad88c 100644 --- a/pkcs11/secret-store/tests/test-secret-item.c +++ b/pkcs11/secret-store/test-secret-item.c diff --git a/pkcs11/secret-store/tests/test-secret-object.c b/pkcs11/secret-store/test-secret-object.c index 9855c061..9855c061 100644 --- a/pkcs11/secret-store/tests/test-secret-object.c +++ b/pkcs11/secret-store/test-secret-object.c diff --git a/pkcs11/secret-store/tests/test-secret-schema.c b/pkcs11/secret-store/test-secret-schema.c index 123c903f..82fafdd6 100644 --- a/pkcs11/secret-store/tests/test-secret-schema.c +++ b/pkcs11/secret-store/test-secret-schema.c @@ -72,7 +72,7 @@ setup (Test *test, */ gkm_secret_collection_set_filename (test->collection, - SRCDIR "/files/schema1.keyring"); + SRCDIR "/fixtures/schema1.keyring"); /* Load the collection */ res = gkm_secret_collection_load (test->collection); diff --git a/pkcs11/secret-store/tests/test-secret-search.c b/pkcs11/secret-store/test-secret-search.c index 64fb7533..64fb7533 100644 --- a/pkcs11/secret-store/tests/test-secret-search.c +++ b/pkcs11/secret-store/test-secret-search.c diff --git a/pkcs11/secret-store/tests/test-secret-textual.c b/pkcs11/secret-store/test-secret-textual.c index bfd722ae..0752712c 100644 --- a/pkcs11/secret-store/tests/test-secret-textual.c +++ b/pkcs11/secret-store/test-secret-textual.c @@ -81,7 +81,7 @@ test_read (Test *test, gconstpointer unused) gchar *data; gsize n_data; - if (!g_file_get_contents (SRCDIR "/files/plain.keyring", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/plain.keyring", &data, &n_data, NULL)) g_assert_not_reached (); res = gkm_secret_textual_read (test->collection, test->sdata, data, n_data); g_free (data); @@ -98,7 +98,7 @@ test_read_wrong_format (Test *test, gconstpointer unused) gchar *data; gsize n_data; - if (!g_file_get_contents (SRCDIR "/files/encrypted.keyring", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/encrypted.keyring", &data, &n_data, NULL)) g_assert_not_reached (); res = gkm_secret_textual_read (test->collection, test->sdata, data, n_data); @@ -116,7 +116,7 @@ test_read_bad_number (Test *test, gconstpointer unused) gchar *data; gsize n_data; - if (!g_file_get_contents (SRCDIR "/files/plain-bad-number.keyring", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/plain-bad-number.keyring", &data, &n_data, NULL)) g_assert_not_reached (); res = gkm_secret_textual_read (test->collection, test->sdata, data, n_data); g_free (data); @@ -158,7 +158,7 @@ test_remove_unavailable (Test *test, gconstpointer unused) gchar *data; gsize n_data; - if (!g_file_get_contents (SRCDIR "/files/plain.keyring", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/plain.keyring", &data, &n_data, NULL)) g_assert_not_reached (); res = gkm_secret_textual_read (test->collection, test->sdata, data, n_data); g_assert (res == GKM_DATA_SUCCESS); @@ -197,7 +197,7 @@ test_read_with_schema (Test *test, gchar *data; gsize n_data; - if (!g_file_get_contents (SRCDIR "/files/plain-with-schema.keyring", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/plain-with-schema.keyring", &data, &n_data, NULL)) g_assert_not_reached (); res = gkm_secret_textual_read (test->collection, test->sdata, data, n_data); g_assert (res == GKM_DATA_SUCCESS); diff --git a/pkcs11/secret-store/tests/Makefile.am b/pkcs11/secret-store/tests/Makefile.am deleted file mode 100644 index 5a77f0f5..00000000 --- a/pkcs11/secret-store/tests/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ - -INCLUDES = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/pkcs11 \ - -DSRCDIR="\"@abs_srcdir@\"" \ - $(GLIB_CFLAGS) \ - $(LIBGCRYPT_CFLAGS) - -LDADD = \ - libgkm-mock-secret-module.a \ - $(top_builddir)/pkcs11/secret-store/libgkm-secret-store.la \ - $(top_builddir)/pkcs11/gkm/libgkm.la \ - $(top_builddir)/egg/libegg.la \ - $(GLIB_LIBS) \ - $(LIBGCRYPT_LIBS) - -noinst_LIBRARIES = libgkm-mock-secret-module.a - -libgkm_mock_secret_module_a_SOURCES = \ - mock-secret-module.c mock-secret-module.h - -noinst_PROGRAMS = dump-keyring0-format - -TEST_PROGS = \ - test-secret-compat \ - test-secret-fields \ - test-secret-data \ - test-secret-object \ - test-secret-collection \ - test-secret-item \ - test-secret-schema \ - test-secret-search \ - test-secret-textual \ - test-secret-binary \ - test-secret-schema - -check_PROGRAMS = $(TEST_PROGS) - -test: $(TEST_PROGS) - gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) - -check-local: test - -all-local: $(check_PROGRAMS) - -EXTRA_DIST = \ - files diff --git a/pkcs11/ssh-store/Makefile.am b/pkcs11/ssh-store/Makefile.am index d221d490..d9e6aab6 100644 --- a/pkcs11/ssh-store/Makefile.am +++ b/pkcs11/ssh-store/Makefile.am @@ -1,8 +1,10 @@ +include $(top_srcdir)/Makefile.decl INCLUDES = \ -I$(top_builddir) \ -I$(top_srcdir) \ -I$(top_srcdir)/pkcs11 \ + -DSRCDIR="\"@abs_srcdir@\"" \ $(GOBJECT_CFLAGS) \ $(LIBGCRYPT_CFLAGS) \ $(GLIB_CFLAGS) \ @@ -48,5 +50,53 @@ gkm_ssh_store_standalone_la_LIBADD = \ # ------------------------------------------------------------------------------- +# TESTS -SUBDIRS = . tests +LDADD = \ + libgkm-mock-ssh-module.a \ + $(top_builddir)/pkcs11/ssh-store/libgkm-ssh-store.la \ + $(top_builddir)/pkcs11/gkm/libgkm.la \ + $(top_builddir)/egg/libegg.la \ + $(GLIB_LIBS) \ + $(LIBGCRYPT_LIBS) + +if WITH_P11_TESTS +CHECK_PROGS = check-ssh-module +else +CHECK_PROGS = +endif + +CHECK_FILES = \ + p11-tests.conf + +TEST_PROGS = \ + test-ssh-openssh \ + test-private-key + +check_PROGRAMS = $(TEST_PROGS) + +test: $(TEST_PROGS) $(CHECK_PROGS) $(CHECK_FILES) + gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) + @for prog in $(CHECK_PROGS); do SRCDIR='.' ./$$prog || exit 1; done + +check-local: test + +all-local: $(check_PROGRAMS) + +noinst_PROGRAMS = \ + $(CHECK_PROGS) + +check_ssh_module_CFLAGS = $(P11_TESTS_CFLAGS) +check_ssh_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) + +noinst_LIBRARIES = libgkm-mock-ssh-module.a + +libgkm_mock_ssh_module_a_SOURCES = \ + mock-ssh-module.c mock-ssh-module.h + +EXTRA_DIST = \ + p11-tests.conf.in \ + fixtures + +CLEANFILES = \ + $(CHECK_FILES) diff --git a/pkcs11/ssh-store/tests/check-ssh-module.c b/pkcs11/ssh-store/check-ssh-module.c index f0233441..f0233441 100644 --- a/pkcs11/ssh-store/tests/check-ssh-module.c +++ b/pkcs11/ssh-store/check-ssh-module.c diff --git a/pkcs11/ssh-store/tests/files/id_dsa_encrypted b/pkcs11/ssh-store/fixtures/id_dsa_encrypted index c17fb80b..c17fb80b 100644 --- a/pkcs11/ssh-store/tests/files/id_dsa_encrypted +++ b/pkcs11/ssh-store/fixtures/id_dsa_encrypted diff --git a/pkcs11/ssh-store/tests/files/id_dsa_encrypted.pub b/pkcs11/ssh-store/fixtures/id_dsa_encrypted.pub index a64acac6..a64acac6 100644 --- a/pkcs11/ssh-store/tests/files/id_dsa_encrypted.pub +++ b/pkcs11/ssh-store/fixtures/id_dsa_encrypted.pub diff --git a/pkcs11/ssh-store/tests/files/id_dsa_plain b/pkcs11/ssh-store/fixtures/id_dsa_plain index 2687623d..2687623d 100644 --- a/pkcs11/ssh-store/tests/files/id_dsa_plain +++ b/pkcs11/ssh-store/fixtures/id_dsa_plain diff --git a/pkcs11/ssh-store/tests/files/id_dsa_plain.pub b/pkcs11/ssh-store/fixtures/id_dsa_plain.pub index 3b4717d7..3b4717d7 100644 --- a/pkcs11/ssh-store/tests/files/id_dsa_plain.pub +++ b/pkcs11/ssh-store/fixtures/id_dsa_plain.pub diff --git a/pkcs11/ssh-store/tests/files/id_dsa_test.pub b/pkcs11/ssh-store/fixtures/id_dsa_test.pub index 33653b23..33653b23 100644 --- a/pkcs11/ssh-store/tests/files/id_dsa_test.pub +++ b/pkcs11/ssh-store/fixtures/id_dsa_test.pub diff --git a/pkcs11/ssh-store/tests/files/id_rsa_encrypted b/pkcs11/ssh-store/fixtures/id_rsa_encrypted index 2c728602..2c728602 100644 --- a/pkcs11/ssh-store/tests/files/id_rsa_encrypted +++ b/pkcs11/ssh-store/fixtures/id_rsa_encrypted diff --git a/pkcs11/ssh-store/tests/files/id_rsa_encrypted.pub b/pkcs11/ssh-store/fixtures/id_rsa_encrypted.pub index 5883b320..5883b320 100644 --- a/pkcs11/ssh-store/tests/files/id_rsa_encrypted.pub +++ b/pkcs11/ssh-store/fixtures/id_rsa_encrypted.pub diff --git a/pkcs11/ssh-store/tests/files/id_rsa_plain b/pkcs11/ssh-store/fixtures/id_rsa_plain index 2e184e40..2e184e40 100644 --- a/pkcs11/ssh-store/tests/files/id_rsa_plain +++ b/pkcs11/ssh-store/fixtures/id_rsa_plain diff --git a/pkcs11/ssh-store/tests/files/id_rsa_plain.pub b/pkcs11/ssh-store/fixtures/id_rsa_plain.pub index a00a1e9b..a00a1e9b 100644 --- a/pkcs11/ssh-store/tests/files/id_rsa_plain.pub +++ b/pkcs11/ssh-store/fixtures/id_rsa_plain.pub diff --git a/pkcs11/ssh-store/tests/files/id_rsa_test.pub b/pkcs11/ssh-store/fixtures/id_rsa_test.pub index 61870b30..61870b30 100644 --- a/pkcs11/ssh-store/tests/files/id_rsa_test.pub +++ b/pkcs11/ssh-store/fixtures/id_rsa_test.pub diff --git a/pkcs11/ssh-store/tests/mock-ssh-module.c b/pkcs11/ssh-store/mock-ssh-module.c index b14b662b..b14b662b 100644 --- a/pkcs11/ssh-store/tests/mock-ssh-module.c +++ b/pkcs11/ssh-store/mock-ssh-module.c diff --git a/pkcs11/ssh-store/tests/mock-ssh-module.h b/pkcs11/ssh-store/mock-ssh-module.h index d2004e1a..d2004e1a 100644 --- a/pkcs11/ssh-store/tests/mock-ssh-module.h +++ b/pkcs11/ssh-store/mock-ssh-module.h diff --git a/pkcs11/ssh-store/tests/p11-tests.conf.in b/pkcs11/ssh-store/p11-tests.conf.in index df1b8d7c..df1b8d7c 100644 --- a/pkcs11/ssh-store/tests/p11-tests.conf.in +++ b/pkcs11/ssh-store/p11-tests.conf.in diff --git a/pkcs11/ssh-store/tests/test-private-key.c b/pkcs11/ssh-store/test-private-key.c index 04d2bb65..50aa58cc 100644 --- a/pkcs11/ssh-store/tests/test-private-key.c +++ b/pkcs11/ssh-store/test-private-key.c @@ -66,8 +66,8 @@ setup (Test *test, test->key = gkm_ssh_private_key_new (test->module, "my-unique"); g_assert (GKM_IS_SSH_PRIVATE_KEY (test->key)); - ret = gkm_ssh_private_key_parse (test->key, SRCDIR "/files/id_dsa_encrypted.pub", - SRCDIR "/files/id_dsa_encrypted", NULL); + ret = gkm_ssh_private_key_parse (test->key, SRCDIR "/fixtures/id_dsa_encrypted.pub", + SRCDIR "/fixtures/id_dsa_encrypted", NULL); g_assert (ret == TRUE); } @@ -88,8 +88,8 @@ test_parse_plain (Test *test, gconstpointer unused) key = gkm_ssh_private_key_new (test->module, "my-unique"); g_assert (GKM_IS_SSH_PRIVATE_KEY (key)); - ret = gkm_ssh_private_key_parse (key, SRCDIR "/files/id_dsa_plain.pub", - SRCDIR "/files/id_dsa_plain", NULL); + ret = gkm_ssh_private_key_parse (key, SRCDIR "/fixtures/id_dsa_plain.pub", + SRCDIR "/fixtures/id_dsa_plain", NULL); g_assert (ret == TRUE); g_object_unref (key); diff --git a/pkcs11/ssh-store/tests/test-ssh-openssh.c b/pkcs11/ssh-store/test-ssh-openssh.c index ba4b8d96..3be9f73b 100644 --- a/pkcs11/ssh-store/tests/test-ssh-openssh.c +++ b/pkcs11/ssh-store/test-ssh-openssh.c @@ -36,15 +36,15 @@ EGG_SECURE_DEFINE_GLIB_GLOBALS (); static const gchar *PRIVATE_FILES[] = { - SRCDIR "/files/id_rsa_encrypted", - SRCDIR "/files/id_rsa_plain", - SRCDIR "/files/id_dsa_encrypted", - SRCDIR "/files/id_dsa_plain" + SRCDIR "/fixtures/id_rsa_encrypted", + SRCDIR "/fixtures/id_rsa_plain", + SRCDIR "/fixtures/id_dsa_encrypted", + SRCDIR "/fixtures/id_dsa_plain" }; static const gchar *PUBLIC_FILES[] = { - SRCDIR "/files/id_rsa_test.pub", - SRCDIR "/files/id_dsa_test.pub" + SRCDIR "/fixtures/id_rsa_test.pub", + SRCDIR "/fixtures/id_dsa_test.pub" }; #define COMMENT "A public key comment" diff --git a/pkcs11/ssh-store/tests/Makefile.am b/pkcs11/ssh-store/tests/Makefile.am deleted file mode 100644 index 419ce0f2..00000000 --- a/pkcs11/ssh-store/tests/Makefile.am +++ /dev/null @@ -1,58 +0,0 @@ -include $(top_srcdir)/Makefile.decl - -INCLUDES = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/pkcs11 \ - -DSRCDIR="\"@abs_srcdir@\"" \ - $(GLIB_CFLAGS) \ - $(LIBGCRYPT_CFLAGS) - -LDADD = \ - libgkm-mock-ssh-module.a \ - $(top_builddir)/pkcs11/ssh-store/libgkm-ssh-store.la \ - $(top_builddir)/pkcs11/gkm/libgkm.la \ - $(top_builddir)/egg/libegg.la \ - $(GLIB_LIBS) \ - $(LIBGCRYPT_LIBS) - -if WITH_P11_TESTS -CHECK_PROGS = check-ssh-module -else -CHECK_PROGS = -endif - -CHECK_FILES = \ - p11-tests.conf - -TEST_PROGS = \ - test-ssh-openssh \ - test-private-key - -check_PROGRAMS = $(TEST_PROGS) - -test: $(TEST_PROGS) $(CHECK_PROGS) $(CHECK_FILES) - gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) - @for prog in $(CHECK_PROGS); do SRCDIR='.' ./$$prog || exit 1; done - -check-local: test - -all-local: $(check_PROGRAMS) - -noinst_PROGRAMS = \ - $(CHECK_PROGS) - -check_ssh_module_CFLAGS = $(P11_TESTS_CFLAGS) -check_ssh_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) - -noinst_LIBRARIES = libgkm-mock-ssh-module.a - -libgkm_mock_ssh_module_a_SOURCES = \ - mock-ssh-module.c mock-ssh-module.h - -EXTRA_DIST = \ - p11-tests.conf.in \ - files - -CLEANFILES = \ - $(CHECK_FILES) diff --git a/pkcs11/wrap-layer/Makefile.am b/pkcs11/wrap-layer/Makefile.am index e49a9559..97a6707b 100644 --- a/pkcs11/wrap-layer/Makefile.am +++ b/pkcs11/wrap-layer/Makefile.am @@ -6,6 +6,7 @@ INCLUDES = -I. \ -I$(top_srcdir) \ -I$(top_builddir) \ -I$(top_srcdir)/pkcs11 \ + -DSRCDIR="\"@abs_srcdir@\"" \ $(GCR_BASE_CFLAGS) \ -DGCR_API_SUBJECT_TO_CHANGE @@ -29,5 +30,36 @@ libgkm_wrap_layer_la_CFLAGS = \ $(GIO_CFLAGS) # ------------------------------------------------------------------------------ +# TESTS -SUBDIRS = . tests +LDADD = \ + $(top_builddir)/pkcs11/wrap-layer/libgkm-wrap-layer.la \ + libgkm-mock-secret-store.a \ + $(top_builddir)/pkcs11/gkm/libgkm.la \ + $(top_builddir)/egg/libegg.la \ + $(GCR_BASE_LIBS) \ + $(GLIB_LIBS) + +TEST_PROGS = \ + test-create-credential \ + test-init-pin \ + test-login-auto \ + test-login-hints \ + test-login-keyring \ + test-login-specific \ + test-login-user \ + test-set-pin + +check_PROGRAMS = $(TEST_PROGS) + +test: $(TEST_PROGS) $(CHECK_PROGS) + gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) + +check-local: test + +all-local: $(check_PROGRAMS) + +noinst_LIBRARIES = libgkm-mock-secret-store.a + +libgkm_mock_secret_store_a_SOURCES = \ + mock-secret-store.c
\ No newline at end of file diff --git a/pkcs11/wrap-layer/tests/mock-secret-store.c b/pkcs11/wrap-layer/mock-secret-store.c index 97d35b7e..97d35b7e 100644 --- a/pkcs11/wrap-layer/tests/mock-secret-store.c +++ b/pkcs11/wrap-layer/mock-secret-store.c diff --git a/pkcs11/wrap-layer/tests/test-create-credential.c b/pkcs11/wrap-layer/test-create-credential.c index 75ff14e7..75ff14e7 100644 --- a/pkcs11/wrap-layer/tests/test-create-credential.c +++ b/pkcs11/wrap-layer/test-create-credential.c diff --git a/pkcs11/wrap-layer/tests/test-init-pin.c b/pkcs11/wrap-layer/test-init-pin.c index 30055662..30055662 100644 --- a/pkcs11/wrap-layer/tests/test-init-pin.c +++ b/pkcs11/wrap-layer/test-init-pin.c diff --git a/pkcs11/wrap-layer/tests/test-login-auto.c b/pkcs11/wrap-layer/test-login-auto.c index 4b97e2b3..4b97e2b3 100644 --- a/pkcs11/wrap-layer/tests/test-login-auto.c +++ b/pkcs11/wrap-layer/test-login-auto.c diff --git a/pkcs11/wrap-layer/tests/test-login-hints.c b/pkcs11/wrap-layer/test-login-hints.c index 3fc846d2..3fc846d2 100644 --- a/pkcs11/wrap-layer/tests/test-login-hints.c +++ b/pkcs11/wrap-layer/test-login-hints.c diff --git a/pkcs11/wrap-layer/tests/test-login-keyring.c b/pkcs11/wrap-layer/test-login-keyring.c index 4ff20dc8..4ff20dc8 100644 --- a/pkcs11/wrap-layer/tests/test-login-keyring.c +++ b/pkcs11/wrap-layer/test-login-keyring.c diff --git a/pkcs11/wrap-layer/tests/test-login-specific.c b/pkcs11/wrap-layer/test-login-specific.c index cc851255..cc851255 100644 --- a/pkcs11/wrap-layer/tests/test-login-specific.c +++ b/pkcs11/wrap-layer/test-login-specific.c diff --git a/pkcs11/wrap-layer/tests/test-login-user.c b/pkcs11/wrap-layer/test-login-user.c index ff17772a..ff17772a 100644 --- a/pkcs11/wrap-layer/tests/test-login-user.c +++ b/pkcs11/wrap-layer/test-login-user.c diff --git a/pkcs11/wrap-layer/tests/test-set-pin.c b/pkcs11/wrap-layer/test-set-pin.c index f53dc349..f53dc349 100644 --- a/pkcs11/wrap-layer/tests/test-set-pin.c +++ b/pkcs11/wrap-layer/test-set-pin.c diff --git a/pkcs11/wrap-layer/tests/Makefile.am b/pkcs11/wrap-layer/tests/Makefile.am deleted file mode 100644 index fd9e3b1b..00000000 --- a/pkcs11/wrap-layer/tests/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ - -INCLUDES = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/pkcs11 \ - -DSRCDIR="\"@abs_srcdir@\"" \ - -DWITH_TESTABLE \ - -DGCR_API_SUBJECT_TO_CHANGE \ - $(GCR_BASE_CFLAGS) \ - $(GLIB_CFLAGS) - -LDADD = \ - $(top_builddir)/pkcs11/wrap-layer/libgkm-wrap-layer.la \ - libgkm-mock-secret-store.a \ - $(top_builddir)/pkcs11/gkm/libgkm.la \ - $(top_builddir)/egg/libegg.la \ - $(GCR_BASE_LIBS) \ - $(GLIB_LIBS) - -TEST_PROGS = \ - test-create-credential \ - test-init-pin \ - test-login-auto \ - test-login-hints \ - test-login-keyring \ - test-login-specific \ - test-login-user \ - test-set-pin - -check_PROGRAMS = $(TEST_PROGS) - -test: $(TEST_PROGS) $(CHECK_PROGS) - gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) - -check-local: test - -all-local: $(check_PROGRAMS) - -noinst_LIBRARIES = libgkm-mock-secret-store.a - -libgkm_mock_secret_store_a_SOURCES = \ - mock-secret-store.c
\ No newline at end of file diff --git a/pkcs11/xdg-store/Makefile.am b/pkcs11/xdg-store/Makefile.am index e34b8635..680f662a 100644 --- a/pkcs11/xdg-store/Makefile.am +++ b/pkcs11/xdg-store/Makefile.am @@ -4,6 +4,7 @@ INCLUDES = \ -I$(top_builddir) \ -I$(top_srcdir) \ -I$(top_srcdir)/pkcs11 \ + -DSRCDIR="\"@abs_srcdir@\"" \ $(GOBJECT_CFLAGS) \ $(LIBGCRYPT_CFLAGS) \ $(GLIB_CFLAGS) \ @@ -52,11 +53,55 @@ gkm_xdg_store_standalone_la_LIBADD = \ $(GMODULE_LIBS) \ $(LIBGCRYPT_LIBS) +asn: + asn1Parser -o xdg.asn.h xdg.asn + sed -i 's|#include.*|/* \0 */|' xdg.asn.h # ------------------------------------------------------------------------------- +# TESTS -SUBDIRS = . tests +LDADD = \ + libgkm-mock-xdg-module.a \ + $(top_builddir)/pkcs11/xdg-store/libgkm-xdg-store.la \ + $(top_builddir)/pkcs11/gkm/libgkm.la \ + $(top_builddir)/egg/libegg.la \ + $(GLIB_LIBS) \ + $(GTHREAD_LIBS) \ + $(LIBGCRYPT_LIBS) -asn: - asn1Parser -o xdg.asn.h xdg.asn - sed -i 's|#include.*|/* \0 */|' xdg.asn.h +if WITH_P11_TESTS +CHECK_PROGS = check-xdg-module +else +CHECK_PROGS = +endif + +TEST_PROGS = \ + test-xdg-module \ + test-xdg-trust + +check_PROGRAMS = $(TEST_PROGS) + +test: $(TEST_PROGS) $(CHECK_PROGS) + gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) + @for prog in $(CHECK_PROGS); do SRCDIR='.' ./$$prog || exit 1; done + +check-local: test + +all-local: $(check_PROGRAMS) + +EXTRA_DIST += \ + p11-tests.conf \ + fixtures + +noinst_PROGRAMS = \ + frob-trust-file \ + dump-trust-file \ + $(CHECK_PROGS) + +check_xdg_module_CFLAGS = $(P11_TESTS_CFLAGS) +check_xdg_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) + +noinst_LIBRARIES = libgkm-mock-xdg-module.a + +libgkm_mock_xdg_module_a_SOURCES = \ + mock-xdg-module.c mock-xdg-module.h diff --git a/pkcs11/xdg-store/tests/check-xdg-module.c b/pkcs11/xdg-store/check-xdg-module.c index 02050be5..02050be5 100644 --- a/pkcs11/xdg-store/tests/check-xdg-module.c +++ b/pkcs11/xdg-store/check-xdg-module.c diff --git a/pkcs11/xdg-store/tests/dump-trust-file.c b/pkcs11/xdg-store/dump-trust-file.c index 1ac880ba..1ac880ba 100644 --- a/pkcs11/xdg-store/tests/dump-trust-file.c +++ b/pkcs11/xdg-store/dump-trust-file.c diff --git a/pkcs11/xdg-store/tests/files/test-certificate-1.cer b/pkcs11/xdg-store/fixtures/test-certificate-1.cer Binary files differindex 1c084370..1c084370 100644 --- a/pkcs11/xdg-store/tests/files/test-certificate-1.cer +++ b/pkcs11/xdg-store/fixtures/test-certificate-1.cer diff --git a/pkcs11/xdg-store/tests/files/test-certificate-2.cer b/pkcs11/xdg-store/fixtures/test-certificate-2.cer Binary files differindex 1c084370..1c084370 100644 --- a/pkcs11/xdg-store/tests/files/test-certificate-2.cer +++ b/pkcs11/xdg-store/fixtures/test-certificate-2.cer diff --git a/pkcs11/xdg-store/tests/files/test-refer-1.trust b/pkcs11/xdg-store/fixtures/test-refer-1.trust Binary files differindex 8db12b91..8db12b91 100644 --- a/pkcs11/xdg-store/tests/files/test-refer-1.trust +++ b/pkcs11/xdg-store/fixtures/test-refer-1.trust diff --git a/pkcs11/xdg-store/tests/frob-trust-file.c b/pkcs11/xdg-store/frob-trust-file.c index 310e6741..310e6741 100644 --- a/pkcs11/xdg-store/tests/frob-trust-file.c +++ b/pkcs11/xdg-store/frob-trust-file.c diff --git a/pkcs11/xdg-store/tests/mock-xdg-module.c b/pkcs11/xdg-store/mock-xdg-module.c index 4d17d97b..cdc886bb 100644 --- a/pkcs11/xdg-store/tests/mock-xdg-module.c +++ b/pkcs11/xdg-store/mock-xdg-module.c @@ -109,8 +109,8 @@ mock_xdg_module_initialize_and_enter (void) CK_RV rv; directory = egg_tests_create_scratch_directory ( - SRCDIR "/files/test-refer-1.trust", - SRCDIR "/files/test-certificate-1.cer", + SRCDIR "/fixtures/test-refer-1.trust", + SRCDIR "/fixtures/test-certificate-1.cer", NULL); /* Setup test directory to work in */ @@ -119,7 +119,7 @@ mock_xdg_module_initialize_and_enter (void) args.pReserved = string; args.flags = CKF_OS_LOCKING_OK; - /* Copy files from test-data to scratch */ + /* Copy fixtures from test-data to scratch */ mock_xdg_module_empty_file ("invalid-without-ext"); mock_xdg_module_empty_file ("test-file.unknown"); mock_xdg_module_empty_file ("test-invalid.trust"); diff --git a/pkcs11/xdg-store/tests/mock-xdg-module.h b/pkcs11/xdg-store/mock-xdg-module.h index 9dc13714..9dc13714 100644 --- a/pkcs11/xdg-store/tests/mock-xdg-module.h +++ b/pkcs11/xdg-store/mock-xdg-module.h diff --git a/pkcs11/xdg-store/tests/p11-tests.conf b/pkcs11/xdg-store/p11-tests.conf index fda5f0dd..fda5f0dd 100644 --- a/pkcs11/xdg-store/tests/p11-tests.conf +++ b/pkcs11/xdg-store/p11-tests.conf diff --git a/pkcs11/xdg-store/tests/test-xdg-module.c b/pkcs11/xdg-store/test-xdg-module.c index 482d50c2..fb0d72dc 100644 --- a/pkcs11/xdg-store/tests/test-xdg-module.c +++ b/pkcs11/xdg-store/test-xdg-module.c @@ -181,7 +181,7 @@ test_create_and_add_object (Test *test, gconstpointer unused) { CKA_CERTIFICATE_TYPE, &ctype, sizeof (ctype) } }; - if (!g_file_get_contents (SRCDIR "/files/test-certificate-2.cer", &data, &n_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-2.cer", &data, &n_data, NULL)) g_assert_not_reached (); attrs[0].pValue = data; diff --git a/pkcs11/xdg-store/tests/test-xdg-trust.c b/pkcs11/xdg-store/test-xdg-trust.c index f6ee580c..cdddd99b 100644 --- a/pkcs11/xdg-store/tests/test-xdg-trust.c +++ b/pkcs11/xdg-store/test-xdg-trust.c @@ -128,7 +128,7 @@ setup (Test *test, gconstpointer unused) rv = gkm_module_C_Login (test->module, gkm_session_get_handle (test->session), CKU_USER, NULL, 0); g_assert (rv == CKR_OK); - if (!g_file_get_contents (SRCDIR "/files/test-certificate-2.cer", &test->cert_data, &test->n_cert_data, NULL)) + if (!g_file_get_contents (SRCDIR "/fixtures/test-certificate-2.cer", &test->cert_data, &test->n_cert_data, NULL)) g_assert_not_reached (); } diff --git a/pkcs11/xdg-store/tests/Makefile.am b/pkcs11/xdg-store/tests/Makefile.am deleted file mode 100644 index 9f4db482..00000000 --- a/pkcs11/xdg-store/tests/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ - -INCLUDES = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/pkcs11 \ - -DSRCDIR="\"@abs_srcdir@\"" \ - $(GLIB_CFLAGS) \ - $(LIBGCRYPT_CFLAGS) - -LDADD = \ - libgkm-mock-xdg-module.a \ - $(top_builddir)/pkcs11/xdg-store/libgkm-xdg-store.la \ - $(top_builddir)/pkcs11/gkm/libgkm.la \ - $(top_builddir)/egg/libegg.la \ - $(GLIB_LIBS) \ - $(GTHREAD_LIBS) \ - $(LIBGCRYPT_LIBS) - -if WITH_P11_TESTS -CHECK_PROGS = check-xdg-module -else -CHECK_PROGS = -endif - -TEST_PROGS = \ - test-xdg-module \ - test-xdg-trust - -check_PROGRAMS = $(TEST_PROGS) - -test: $(TEST_PROGS) $(CHECK_PROGS) - gtester --verbose -m $(TEST_MODE) --g-fatal-warnings $(TEST_PROGS) - @for prog in $(CHECK_PROGS); do SRCDIR='.' ./$$prog || exit 1; done - -check-local: test - -all-local: $(check_PROGRAMS) - -EXTRA_DIST = \ - p11-tests.conf \ - files - -noinst_PROGRAMS = \ - frob-trust-file \ - dump-trust-file \ - $(CHECK_PROGS) - -check_xdg_module_CFLAGS = $(P11_TESTS_CFLAGS) -check_xdg_module_LDADD = $(P11_TESTS_LIBS) $(LDADD) - -noinst_LIBRARIES = libgkm-mock-xdg-module.a - -libgkm_mock_xdg_module_a_SOURCES = \ - mock-xdg-module.c mock-xdg-module.h |