Changeset 89f863f in mod_gnutls for test/Makefile.in


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.in

    r4addf74 r89f863f  
    1414
    1515@SET_MAKE@
     16
     17#!/usr/bin/make -f
     18# Authors:
     19# Daniel Kahn Gillmor <dkg@fifthhorseman.net>
     20# Thomas Klute <thomas2.klute@uni-dortmund.de>
     21
     22# General rules to set up a miniature CA & server & client environment
     23# for the test suite
    1624VPATH = @srcdir@
    1725am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
     
    8088target_triplet = @target@
    8189@USE_MSVA_TRUE@am__append_1 = test-15_basic_msva.bash
     90DIST_COMMON = $(srcdir)/test_ca.mk $(srcdir)/Makefile.in \
     91        $(srcdir)/Makefile.am $(am__dist_check_SCRIPTS_DIST) \
     92        $(top_srcdir)/config/test-driver README
     93@USE_MSVA_TRUE@am__append_2 = $(msva_home)/trustdb.gpg client.uid
     94@USE_MSVA_TRUE@am__append_3 = $(msva_home)/trustdb.gpg
    8295subdir = test
    83 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
    84         $(am__dist_check_SCRIPTS_DIST) \
    85         $(top_srcdir)/config/test-driver README
    8696ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    8797am__aclocal_m4_deps = $(top_srcdir)/m4/apache.m4 \
     
    584594TESTS = $(dist_check_SCRIPTS)
    585595
     596# Identities in the miniature CA, server, and client environment for
     597# the test suite
     598identities = server authority client imposter rogueca
     599# Append strings after ":=" to each identity to generate a list of
     600# necessary files
     601pgp_tokens = $(identities:=/secring.gpg) $(identities:=/cert.pgp) \
     602        $(identities:=/secret.pgp)
     603
     604x509_keys = $(identities:=/secret.key)
     605x509_certs = $(identities:=/x509.pem)
     606x509_tokens = $(x509_certs) $(x509_keys)
     607tokens = $(x509_tokens) $(pgp_tokens)
     608
    586609# Test cases trying to create keys and certificates in parallel causes
    587610# race conditions. Ensure that all keys and certificates are generated
     
    596619
    597620# SoftHSM files
    598 check_DATA = setup.done server/crl.pem server/softhsm.db
     621check_DATA = $(tokens) server/crl.pem $(am__append_2) \
     622        server/softhsm.db make-test-dirs
    599623
    600624# Delete X.509 certificates and generated templates on "mostlyclean"
     
    608632# one day, so regenerating them is both fast and frequently
    609633# necessary.
    610 MOSTLYCLEANFILES = setup.done cache/* logs/* outputs/* server/crl.pem \
    611         */x509.pem $(generated_templates) */*.pgp */*.gpg */*.gpg~ \
    612         */gpg.conf tests/24_pkcs11_cert/softhsm.conf
     634
     635# Delete lock files for test servers on "mostlyclean" target.
     636MOSTLYCLEANFILES = cache/* logs/* outputs/* server/crl.pem */x509.pem \
     637        $(generated_templates) *.uid */*.pgp */*.gpg */*.gpg~ \
     638        */gpg.conf authority/lock *.lock $(am__append_3) \
     639        tests/24_pkcs11_cert/softhsm.conf server/softhsm.db
    613640cert_templates = authority.template.in client.template.in \
    614641        imposter.template.in rogueca.template server.template.in
     
    617644        imposter.template server.template
    618645
     646
     647# Delete X.509 private keys on full clean. Note that unless you need
     648# to generate fresh keys, the "mostlyclean" target should be
     649# sufficient (see below).
     650# GnuPG random pool, no need to regenerate on every build
     651CLEANFILES = $(x509_keys) authority/random_seed
     652
     653# rule to build MSVA trust database
     654@USE_MSVA_TRUE@msva_home = msva.gnupghome
     655extra_dirs = logs cache outputs
     656
     657# Apache configuration and data files
    619658apache_data = base_apache.conf cgi_module.conf data/* mime.types proxy_mods.conf
    620659EXTRA_DIST = $(apache_data) $(cert_templates) *.uid.in proxy_backend.bash \
    621         runtests server-crl.template server-softhsm.conf softhsm.bash \
    622         TestMakefile
    623 
    624 
     660        runtests server-crl.template server-softhsm.conf softhsm.bash
     661
     662
     663# Lockfile for the main Apache process
     664test_lockfile = ./test.lock
    625665# Maximum wait time in seconds for flock to aquire instance lock files
    626666lock_wait = 30
    627667AM_TESTS_ENVIRONMENT = export APACHE2=$(APACHE2); \
    628668        export AP_LIBEXECDIR=$(AP_LIBEXECDIR); \
    629         export TEST_LOCK_WAIT=$(lock_wait); \
     669        export TEST_LOCK="$(test_lockfile)"; \
     670        export TEST_LOCK_WAIT="$(lock_wait)"; \
    630671        export TEST_HOST="$(TEST_HOST)"; \
    631672        export TEST_IP="$(TEST_IP)"; \
     673        export TEST_PORT="$(TEST_PORT)"; \
     674        export MSVA_PORT="$(MSVA_PORT)"; \
     675        export TEST_MSVA_MAX_WAIT="$(TEST_MSVA_MAX_WAIT)"; \
     676        export TEST_MSVA_WAIT="$(TEST_MSVA_WAIT)"; \
     677        export TEST_QUERY_DELAY="$(TEST_QUERY_DELAY)"; \
    632678        export BACKEND_HOST="$(TEST_HOST)"; \
    633679        export BACKEND_IP="$(TEST_IP)";
     
    637683.SUFFIXES:
    638684.SUFFIXES: .log .test .test$(EXEEXT) .trs
    639 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
     685$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/test_ca.mk $(am__configure_deps)
    640686        @for dep in $?; do \
    641687          case '$(am__configure_deps)' in \
     
    658704            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
    659705        esac;
     706$(srcdir)/test_ca.mk:
    660707
    661708$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
     
    11921239
    11931240clean-generic:
     1241        -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
    11941242
    11951243distclean-generic:
     
    12831331
    12841332
     1333%.template: $(srcdir)/%.template.in
     1334        sed s/__HOSTNAME__/$(TEST_HOST)/ < $< > $@
     1335
     1336%.uid: $(srcdir)/%.uid.in
     1337        sed s/__HOSTNAME__/$(TEST_HOST)/ < $< > $@
     1338
     1339%/secret.key:
     1340        mkdir -p $(dir $@)
     1341        chmod 0700 $(dir $@)
     1342        certtool --generate-privkey > $@
     1343
     1344%/secring.gpg: %.uid %/secret.key
     1345        rm -f $(dir $@)pubring.gpg $(dir $@)secring.gpg $(dir $@)trustdb.gpg
     1346        PEM2OPENPGP_EXPIRATION=86400 PEM2OPENPGP_USAGE_FLAGS=authenticate,certify,sign pem2openpgp "$$(cat $<)" < $(dir $@)secret.key | GNUPGHOME=$(dir $@) gpg --import
     1347        printf "%s:6:\n" "$$(GNUPGHOME=$(dir $@) gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)" | GNUPGHOME=$(dir $@) gpg --import-ownertrust
     1348
     1349%/gpg.conf: %/secring.gpg
     1350        printf "default-key %s\n" "$$(GNUPGHOME=$(dir $@) gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)" > $@
     1351
     1352%/secret.pgp: %/secring.gpg
     1353        GNUPGHOME=$(dir $@) gpg --armor --batch --no-tty --yes --export-secret-key "$$(GNUPGHOME=$(dir $@) gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)" > $@
     1354
     1355%/minimal.pgp: %/secring.gpg
     1356        GNUPGHOME=$(dir $@) gpg --armor --export "$$(GNUPGHOME=$(dir $@) gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)" > $@
     1357
     1358# Import and signing modify the shared keyring, which leads to race
     1359# conditions with parallel make. Locking avoids this problem.
     1360%/cert.pgp: %/minimal.pgp authority/gpg.conf
     1361        GNUPGHOME=authority flock authority/lock gpg --import $<
     1362        GNUPGHOME=authority flock authority/lock gpg --batch --sign-key --no-tty --yes "$$(GNUPGHOME=$(dir $@) gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)"
     1363        GNUPGHOME=authority gpg --armor --export "$$(GNUPGHOME=$(dir $@) gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)" > $@
     1364
     1365# special cases for the authorities' root certs:
     1366authority/x509.pem: authority.template authority/secret.key
     1367        certtool --generate-self-signed --load-privkey authority/secret.key --template authority.template > $@
     1368rogueca/x509.pem: $(srcdir)/rogueca.template rogueca/secret.key
     1369        certtool --generate-self-signed --load-privkey rogueca/secret.key --template $(srcdir)/rogueca.template > $@
     1370
     1371%/cert-request: %.template %/secret.key
     1372        certtool --generate-request --load-privkey $(dir $@)secret.key --template $< > $@
     1373
     1374%/x509.pem: %.template %/cert-request authority/secret.key authority/x509.pem
     1375        certtool --generate-certificate --load-ca-certificate authority/x509.pem --load-ca-privkey authority/secret.key --load-request $(dir $@)cert-request --template $< > $@
     1376
     1377%/softhsm.db: %/x509.pem %/secret.key
     1378        SOFTHSM_CONF="$(srcdir)/$(*)-softhsm.conf" $(srcdir)/softhsm.bash init $(dir $@)secret.key $(dir $@)x509.pem
     1379
     1380# Generate CRL revoking a certain certificate. Currently used to
     1381# revoke the server certificate and check if setting the CRL as
     1382# GnuTLSProxyCRLFile causes the connection to the back end server to
     1383# fail.
     1384%/crl.pem: %/x509.pem ${srcdir}/%-crl.template
     1385        certtool --generate-crl \
     1386                --load-ca-privkey authority/secret.key \
     1387                --load-ca-certificate authority/x509.pem \
     1388                --load-certificate $< \
     1389                --template "${srcdir}/$(*)-crl.template" \
     1390                > $@
     1391@USE_MSVA_TRUE@$(msva_home)/trustdb.gpg: authority/minimal.pgp client/cert.pgp
     1392@USE_MSVA_TRUE@ mkdir -p -m 0700 $(dir $@)
     1393@USE_MSVA_TRUE@ GNUPGHOME=$(dir $@) gpg --import < $<
     1394@USE_MSVA_TRUE@ printf "%s:6:\n" "$$(GNUPGHOME=authority gpg --with-colons --list-secret-keys --fingerprint | grep ^fpr: | cut -f 10 -d :)" | GNUPGHOME=$(dir $@) gpg --import-ownertrust
     1395@USE_MSVA_TRUE@ GNUPGHOME=$(dir $@) gpg --import < client/cert.pgp
     1396@USE_MSVA_TRUE@ printf "keyserver does-not-exist.example\n" > $(msva_home)/gpg.conf
     1397make-test-dirs:
     1398        mkdir -p $(extra_dirs)
     1399.PHONY: make-test-dirs
     1400
    12851401clean-local:
    1286         $(MAKE) -f $(srcdir)/TestMakefile $(AM_MAKEFLAGS) clean
    1287 
    1288 # This rule can be used for any TestMakefile target not included in
    1289 # setup.done. The dependency on setup.done is used to avoid race
    1290 # conditions between multiple calls to TestMakefile for key and
    1291 # certificate generation. It is ignored for setup.done itself.
    1292 server/crl.pem server/softhsm.db setup.done: setup.done
    1293         TEST_HOST="$(TEST_HOST)" TEST_IP="$(TEST_IP)" srcdir=$(srcdir) \
    1294         $(MAKE) -f $(srcdir)/TestMakefile $(AM_MAKEFLAGS) $@
     1402        -rmdir $(identities) || true
     1403        -rmdir $(extra_dirs) || true
     1404@USE_MSVA_TRUE@ -rmdir $(msva_home) || true
     1405
     1406# port for the main Apache server
     1407TEST_PORT ?= 9932
     1408# port for MSVA in test cases that use it
     1409MSVA_PORT ?= 9933
     1410# maximum time to wait for MSVA startup
     1411TEST_MSVA_MAX_WAIT ?= 10
     1412# wait loop time for MSVA startup
     1413TEST_MSVA_WAIT ?= 0.4
     1414# seconds for the HTTP request to be sent and responded to
     1415TEST_QUERY_DELAY ?= 30
     1416
     1417# Echo AM_TESTS_ENVIRONMENT. This can be useful for debugging, e.g. if
     1418# you want to manually run an Apache instance with Valgrind using the
     1419# same configuration as a test case.
     1420show-test-env: export TEST_ENV=$(AM_TESTS_ENVIRONMENT)
     1421show-test-env:
     1422        @echo "$${TEST_ENV}"
    12951423
    12961424# Tell versions [3.59,3.63) of GNU make to not export all variables.
Note: See TracChangeset for help on using the changeset viewer.