Changeset 9a4d250 in mod_gnutls for test/Makefile.am


Ignore:
Timestamp:
Oct 18, 2015, 10:42:58 AM (4 years ago)
Author:
Thomas Klute <thomas2.klute@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, upstream
Children:
fc8e463
Parents:
f9f184f
Message:

Avoid external make calls for test environment setup

All targets needed to set up the test suite environment are now
directly handled by the makefile created through automake, avoiding
any external make calls. The rules for X.509 and PGP certificate
management are included from the old test makefile through automake.

Note that those included rules use syntax that automake warns is GNU
make specific and might not work with other make implementations. This
is not a regression, just increased visibility, so automake
portability warnings are ignored.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/Makefile.am

    rf9f184f r9a4d250  
    3131TESTS = $(dist_check_SCRIPTS)
    3232
     33# Identities in the miniature CA, server, and client environment for
     34# the test suite
     35identities = server authority client imposter rogueca
     36# Append strings after ":=" to each identity to generate a list of
     37# necessary files
     38pgp_tokens = $(identities:=/secring.gpg) $(identities:=/cert.pgp) \
     39        $(identities:=/secret.pgp)
     40x509_keys = $(identities:=/secret.key)
     41x509_certs = $(identities:=/x509.pem)
     42x509_tokens = $(x509_certs) $(x509_keys)
     43tokens = $(x509_tokens) $(pgp_tokens)
     44
     45include $(srcdir)/TestMakefile
     46
    3347# Test cases trying to create keys and certificates in parallel causes
    3448# race conditions. Ensure that all keys and certificates are generated
     
    4155# running at any time, so test cases actually have to wait for each
    4256# other - just not in any particular order.
    43 check_DATA = setup.done server/crl.pem
     57check_DATA = $(tokens) server/crl.pem
    4458
    4559MOSTLYCLEANFILES = cache/* logs/* outputs/* server/crl.pem
     
    5064        imposter.template server.template
    5165
     66# Delete X.509 private keys on full clean. Note that unless you need
     67# to generate fresh keys, the "mostlyclean" target should be
     68# sufficient (see below).
     69CLEANFILES = $(x509_keys)
     70
    5271# Delete X.509 certificates and generated templates on "mostlyclean"
    5372# target. Certificates can be rebuilt without generating new key
     
    5574# (e.g. host names) without wasting entropy on new keys (which would
    5675# happen after "clean").
    57 MOSTLYCLEANFILES += */x509.pem $(generated_templates)
     76MOSTLYCLEANFILES += */x509.pem $(generated_templates) *.uid
     77
    5878
    5979# Delete PGP keyrings on "mostlyclean" target. They are created from
     
    6181# one day, so regenerating them is both fast and frequently
    6282# necessary.
    63 MOSTLYCLEANFILES += */*.pgp */*.gpg */*.gpg~ */gpg.conf
     83MOSTLYCLEANFILES += */*.pgp */*.gpg */*.gpg~ */gpg.conf authority/lock
     84# GnuPG random pool, no need to regenerate on every build
     85CLEANFILES += authority/random_seed
    6486
    65 clean-local:
    66         $(MAKE) -f $(srcdir)/TestMakefile $(AM_MAKEFLAGS) clean
     87# Delete lock files for test servers on "mostlyclean" target.
     88MOSTLYCLEANFILES += *.lock
     89
     90# rule to build MSVA trust database
     91if USE_MSVA
     92msva_home = msva.gnupghome
     93check_DATA += $(msva_home)/trustdb.gpg client.uid
     94MOSTLYCLEANFILES += $(msva_home)/trustdb.gpg
     95$(msva_home)/trustdb.gpg: authority/minimal.pgp client/cert.pgp
     96        mkdir -p -m 0700 $(dir $@)
     97        GNUPGHOME=$(dir $@) gpg --import < $<
     98        printf "%s:6:\n" "$$(GNUPGHOME=authority gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)" | GNUPGHOME=$(dir $@) gpg --import-ownertrust
     99        GNUPGHOME=$(dir $@) gpg --import < client/cert.pgp
     100        printf "keyserver does-not-exist.example\n" > $(msva_home)/gpg.conf
     101endif
    67102
    68103# SoftHSM files
    69104check_DATA += server/softhsm.db
    70 MOSTLYCLEANFILES += tests/24_pkcs11_cert/softhsm.conf
     105MOSTLYCLEANFILES += tests/24_pkcs11_cert/softhsm.conf server/softhsm.db
    71106
    72 # This rule can be used for any TestMakefile target not included in
    73 # setup.done. The dependency on setup.done is used to avoid race
    74 # conditions between multiple calls to TestMakefile for key and
    75 # certificate generation. It is ignored for setup.done itself.
    76 .PHONY: setup.done
    77 server/crl.pem server/softhsm.db setup.done: setup.done
    78         TEST_HOST="$(TEST_HOST)" TEST_IP="$(TEST_IP)" srcdir=$(srcdir) \
    79         $(MAKE) -f $(srcdir)/TestMakefile $(AM_MAKEFLAGS) $@
    80107
     108check_DATA += make-test-dirs
     109extra_dirs = logs cache outputs
     110make-test-dirs:
     111        mkdir -p $(extra_dirs)
     112.PHONY: make-test-dirs
     113
     114clean-local:
     115        -rmdir $(identities) || true
     116        -rmdir $(extra_dirs) || true
     117if USE_MSVA
     118        -rmdir $(msva_home) || true
     119endif
     120
     121# Apache configuration and data files
    81122apache_data = base_apache.conf cgi_module.conf data/* mime.types proxy_mods.conf
    82123
Note: See TracChangeset for help on using the changeset viewer.