Changeset 89f863f in mod_gnutls for test/Makefile.am


Ignore:
Timestamp:
Oct 19, 2015, 9:07:40 PM (5 years ago)
Author:
Daniel Kahn Gillmor <dkg@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, upstream
Children:
02c8e54, 24c6c16
Parents:
4addf74 (diff), 71cac80 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Imported Upstream version 0.7.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/Makefile.am

    r4addf74 r89f863f  
    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)/test_ca.mk
     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
    45 MOSTLYCLEANFILES = setup.done cache/* logs/* outputs/* server/crl.pem
     59MOSTLYCLEANFILES = cache/* logs/* outputs/* server/crl.pem
    4660
    4761cert_templates = authority.template.in client.template.in \
     
    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 server/crl.pem server/softhsm.db setup.done: setup.done
    77         TEST_HOST="$(TEST_HOST)" TEST_IP="$(TEST_IP)" srcdir=$(srcdir) \
    78         $(MAKE) -f $(srcdir)/TestMakefile $(AM_MAKEFLAGS) $@
    79107
     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
    80122apache_data = base_apache.conf cgi_module.conf data/* mime.types proxy_mods.conf
    81123
    82124EXTRA_DIST = $(apache_data) $(cert_templates) *.uid.in proxy_backend.bash \
    83         runtests server-crl.template server-softhsm.conf softhsm.bash \
    84         TestMakefile
     125        runtests server-crl.template server-softhsm.conf softhsm.bash
    85126
     127# Lockfile for the main Apache process
     128test_lockfile = ./test.lock
    86129# Maximum wait time in seconds for flock to aquire instance lock files
    87130lock_wait = 30
    88131
     132# port for the main Apache server
     133TEST_PORT ?= 9932
     134# port for MSVA in test cases that use it
     135MSVA_PORT ?= 9933
     136# maximum time to wait for MSVA startup
     137TEST_MSVA_MAX_WAIT ?= 10
     138# wait loop time for MSVA startup
     139TEST_MSVA_WAIT ?= 0.4
     140# seconds for the HTTP request to be sent and responded to
     141TEST_QUERY_DELAY ?= 30
     142
    89143AM_TESTS_ENVIRONMENT = export APACHE2=$(APACHE2); \
    90144        export AP_LIBEXECDIR=$(AP_LIBEXECDIR); \
    91         export TEST_LOCK_WAIT=$(lock_wait); \
     145        export TEST_LOCK="$(test_lockfile)"; \
     146        export TEST_LOCK_WAIT="$(lock_wait)"; \
    92147        export TEST_HOST="$(TEST_HOST)"; \
    93148        export TEST_IP="$(TEST_IP)"; \
     149        export TEST_PORT="$(TEST_PORT)"; \
     150        export MSVA_PORT="$(MSVA_PORT)"; \
     151        export TEST_MSVA_MAX_WAIT="$(TEST_MSVA_MAX_WAIT)"; \
     152        export TEST_MSVA_WAIT="$(TEST_MSVA_WAIT)"; \
     153        export TEST_QUERY_DELAY="$(TEST_QUERY_DELAY)"; \
    94154        export BACKEND_HOST="$(TEST_HOST)"; \
    95155        export BACKEND_IP="$(TEST_IP)";
     156
     157# Echo AM_TESTS_ENVIRONMENT. This can be useful for debugging, e.g. if
     158# you want to manually run an Apache instance with Valgrind using the
     159# same configuration as a test case.
     160show-test-env: export TEST_ENV=$(AM_TESTS_ENVIRONMENT)
     161show-test-env:
     162        @echo "$${TEST_ENV}"
Note: See TracChangeset for help on using the changeset viewer.