From c9a351f5af289c8f6919854c40f235c781b76ec7 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 15 Feb 2018 10:27:59 +0900 Subject: [PATCH 1/4] build: More Makefile fix. * lang/python/tests/Makefile.am: Avoid target with '/'. Signed-off-by: NIIBE Yutaka --- lang/python/tests/Makefile.am | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lang/python/tests/Makefile.am b/lang/python/tests/Makefile.am index 25b15f2b..6224e5a9 100644 --- a/lang/python/tests/Makefile.am +++ b/lang/python/tests/Makefile.am @@ -79,7 +79,7 @@ xcheck: all CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \ gpg-agent.conf pubring.kbx~ gpg.conf pubring.gpg~ \ random_seed .gpg-v21-migrated tofu.db \ - pubring-stamp private-keys-v1.d/gpg-sample.stamp + pubring-stamp gpg-sample.stamp private_keys = \ $(test_srcdir)/13CD0F3BDF24BE53FE192D62F18737256FF6E4FD \ @@ -94,18 +94,17 @@ clean-local: BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \ - private-keys-v1.d/gpg-sample.stamp + gpg-sample.stamp -private-keys-v1.d/gpg-sample.stamp: $(private_keys) +gpg-sample.stamp: $(private_keys) -gpgconf --kill all $(MKDIR_P) ./private-keys-v1.d for k in $(private_keys); do \ cp $$k private-keys-v1.d/$${k#$(test_srcdir)/}.key; \ done - echo x > ./private-keys-v1.d/gpg-sample.stamp + echo x > ./gpg-sample.stamp -pubring-stamp: $(test_srcdir)/pubdemo.asc \ - ./private-keys-v1.d/gpg-sample.stamp +pubring-stamp: $(test_srcdir)/pubdemo.asc gpg-sample.stamp $(GPG) --batch --no-permission-warning \ --import $(test_srcdir)/pubdemo.asc -$(GPG) --batch --no-permission-warning \ From b5ec21b9baf017b4cee88c9ef3cc1a638547cd20 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 15 Feb 2018 11:14:49 +0900 Subject: [PATCH 2/4] tests: Makefile portability. * tests/gpg/Makefile.am: Don't use "export" directive. * tests/gpgsm/Makefile.am: Ditto. * lang/qt/tests/Makefile.am: Ditto. * lang/python/tests/Makefile.am: Ditto. -- GnuPG-bug-id: 3056 Signed-off-by: NIIBE Yutaka --- lang/python/tests/Makefile.am | 10 ++++------ lang/qt/tests/Makefile.am | 10 ++++------ tests/gpg/Makefile.am | 8 ++------ tests/gpgsm/Makefile.am | 10 +++------- 4 files changed, 13 insertions(+), 25 deletions(-) diff --git a/lang/python/tests/Makefile.am b/lang/python/tests/Makefile.am index 6224e5a9..3864f8ba 100644 --- a/lang/python/tests/Makefile.am +++ b/lang/python/tests/Makefile.am @@ -18,8 +18,6 @@ GPG = gpg GPG_AGENT = gpg-agent -export GNUPGHOME := $(abs_builddir) -export GPG_AGENT_INFO := test_srcdir = $(top_srcdir)/tests/gpg @@ -89,7 +87,7 @@ private_keys = \ $(test_srcdir)/7A030357C0F253A5BBCD282FFC4E521B37558F5C clean-local: - -$(top_srcdir)/tests/start-stop-agent --stop + -$(TESTS_ENVIRONMENT) $(top_srcdir)/tests/start-stop-agent --stop -rm -fR -- private-keys-v1.d openpgp-revocs.d S.gpg-agent sshcontrol @@ -97,7 +95,7 @@ BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \ gpg-sample.stamp gpg-sample.stamp: $(private_keys) - -gpgconf --kill all + -$(TESTS_ENVIRONMENT) gpgconf --kill all $(MKDIR_P) ./private-keys-v1.d for k in $(private_keys); do \ cp $$k private-keys-v1.d/$${k#$(test_srcdir)/}.key; \ @@ -105,9 +103,9 @@ gpg-sample.stamp: $(private_keys) echo x > ./gpg-sample.stamp pubring-stamp: $(test_srcdir)/pubdemo.asc gpg-sample.stamp - $(GPG) --batch --no-permission-warning \ + $(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(test_srcdir)/pubdemo.asc - -$(GPG) --batch --no-permission-warning \ + -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(test_srcdir)/secdemo.asc echo x > ./pubring-stamp diff --git a/lang/qt/tests/Makefile.am b/lang/qt/tests/Makefile.am index a662b4cf..104672e4 100644 --- a/lang/qt/tests/Makefile.am +++ b/lang/qt/tests/Makefile.am @@ -70,21 +70,19 @@ CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \ gpg.conf tofu.db clean-local: - -$(top_srcdir)/tests/start-stop-agent --stop + -$(TESTS_ENVIRONMENT) $(top_srcdir)/tests/start-stop-agent --stop -rm -fR private-keys-v1.d crls.d -export GNUPGHOME := $(abs_builddir) - pubring-stamp: $(top_srcdir)/tests/gpg/pubdemo.asc \ $(top_srcdir)/tests/gpg/secdemo.asc - -gpgconf --kill all + -$(TESTS_ENVIRONMENT) gpgconf --kill all echo "ignore-invalid-option allow-loopback-pinentry" > $(abs_builddir)/gpg-agent.conf echo "allow-loopback-pinentry" >> gpg-agent.conf echo "ignore-invalid-option pinentry-mode" > gpg.conf echo "pinentry-mode loopback" >> gpg.conf - $(GPG) --no-permission-warning \ + $(TESTS_ENVIRONMENT) $(GPG) --no-permission-warning \ --import $(top_srcdir)/tests/gpg/pubdemo.asc - $(GPG) --no-permission-warning \ + $(TESTS_ENVIRONMENT) $(GPG) --no-permission-warning \ --passphrase "abc" \ --import $(top_srcdir)/tests/gpg/secdemo.asc touch pubring-stamp diff --git a/tests/gpg/Makefile.am b/tests/gpg/Makefile.am index 034bb5e0..1d73d023 100644 --- a/tests/gpg/Makefile.am +++ b/tests/gpg/Makefile.am @@ -81,15 +81,11 @@ noinst_PROGRAMS = $(c_tests) $(tests_skipped) clean-local: - -$(top_srcdir)/tests/start-stop-agent --stop + -$(TESTS_ENVIRONMENT) $(top_srcdir)/tests/start-stop-agent --stop -rm -fR private-keys-v1.d -export GNUPGHOME := $(abs_builddir) - -export GPG_AGENT_INFO := - gpg-sample.stamp: $(srcdir)/$(private_keys) - -gpgconf --kill all + -$(TESTS_ENVIRONMENT) gpgconf --kill all $(MKDIR_P) ./private-keys-v1.d for k in $(private_keys); do \ cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \ diff --git a/tests/gpgsm/Makefile.am b/tests/gpgsm/Makefile.am index 3b8eb725..d2acd05b 100644 --- a/tests/gpgsm/Makefile.am +++ b/tests/gpgsm/Makefile.am @@ -49,18 +49,14 @@ CLEANFILES = pubring-stamp pubring.kbx pubring.kbx~ gpgsm.conf trustlist.txt \ random_seed S.gpg-agent gpg-sample.stamp clean-local: - -$(top_srcdir)/tests/start-stop-agent --stop + -$(TESTS_ENVIRONMENT) $(top_srcdir)/tests/start-stop-agent --stop -rm -fR private-keys-v1.d -export GNUPGHOME := $(abs_builddir) - -export GPG_AGENT_INFO := - BUILT_SOURCES = gpgsm.conf trustlist.txt pubring-stamp \ gpg-sample.stamp pubring-stamp: $(srcdir)/cert_g10code_test1.der gpg-sample.stamp - $(GPGSM) --import $(srcdir)/cert_g10code_test1.der + $(TESTS_ENVIRONMENT) $(GPGSM) --import $(srcdir)/cert_g10code_test1.der touch pubring-stamp gpgsm.conf: @@ -69,7 +65,7 @@ gpgsm.conf: echo "agent-program `which $(GPG_AGENT)`|--debug-quick-random" >> ./gpgsm.conf gpg-sample.stamp: $(srcdir)/$(key_id) - -gpgconf --kill all + -$(TESTS_ENVIRONMENT) gpgconf --kill all $(MKDIR_P) ./private-keys-v1.d cp $(srcdir)/$(key_id) private-keys-v1.d/$(key_id).key echo x > ./gpg-sample.stamp From ba6e610baa138ba9b43be303df2c5981dd04de5a Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 15 Feb 2018 11:24:33 +0900 Subject: [PATCH 3/4] tests: More Makefile portability. * tests/gpg/Makefile.am: Invoke GPG with TESTS_ENVIRONMENT. Signed-off-by: NIIBE Yutaka --- tests/gpg/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/gpg/Makefile.am b/tests/gpg/Makefile.am index 1d73d023..6a95e595 100644 --- a/tests/gpg/Makefile.am +++ b/tests/gpg/Makefile.am @@ -93,9 +93,9 @@ gpg-sample.stamp: $(srcdir)/$(private_keys) echo x > ./gpg-sample.stamp pubring-stamp: $(srcdir)/pubdemo.asc gpg-sample.stamp - $(GPG) --batch --no-permission-warning \ + $(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(srcdir)/pubdemo.asc - -$(GPG) --batch --no-permission-warning \ + $(TESTS_ENVIRONMENT) -$(GPG) --batch --no-permission-warning \ --import $(srcdir)/secdemo.asc echo x > ./pubring-stamp From 3224d7f0ea83a3c2baaa9f97846c4a5b392d2c59 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 15 Feb 2018 11:31:57 +0900 Subject: [PATCH 4/4] tests: Fix previous commit Signed-off-by: NIIBE Yutaka --- tests/gpg/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/gpg/Makefile.am b/tests/gpg/Makefile.am index 6a95e595..b50f4b07 100644 --- a/tests/gpg/Makefile.am +++ b/tests/gpg/Makefile.am @@ -95,7 +95,7 @@ gpg-sample.stamp: $(srcdir)/$(private_keys) pubring-stamp: $(srcdir)/pubdemo.asc gpg-sample.stamp $(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(srcdir)/pubdemo.asc - $(TESTS_ENVIRONMENT) -$(GPG) --batch --no-permission-warning \ + -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(srcdir)/secdemo.asc echo x > ./pubring-stamp