mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
tests: Restrict the use of gpgconf.ctl to make check.
* common/homedir.c (unix_rootdir): Add ".enable" statement to gpgconf.ctl * tests/gpgconf.ctl.in: Use this statement. * tests/cms/Makefile.am (OLD_TESTS_ENVIRONMENT): Enable .enable. (TESTS_ENVIRONMENT): Ditto. * tests/gpgme/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/migrations/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/openpgp/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/pkits/Makefile.am (TESTS_ENVIRONMENT): Ditto. * tests/tpm2dtests/Makefile.am (TESTS_ENVIRONMENT): Ditto. -- Without that it was required to delete the gpgconf.ctl to run manual tests. What a hack.
This commit is contained in:
parent
e70e09c3d5
commit
50d12860ef
@ -473,6 +473,7 @@ unix_rootdir (int want_sysconfdir)
|
|||||||
char *rootdir;
|
char *rootdir;
|
||||||
char *sysconfdir;
|
char *sysconfdir;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
int ignoreall = 0;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@ -590,6 +591,16 @@ unix_rootdir (int want_sysconfdir)
|
|||||||
name = "sysconfdir";
|
name = "sysconfdir";
|
||||||
p = line + 12;
|
p = line + 12;
|
||||||
}
|
}
|
||||||
|
else if (!strncmp (line, ".enable=", 8))
|
||||||
|
{
|
||||||
|
name = ".enable";
|
||||||
|
p = line + 8;
|
||||||
|
}
|
||||||
|
else if (!strncmp (line, ".enable =", 9))
|
||||||
|
{
|
||||||
|
name = ".enable";
|
||||||
|
p = line + 9;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
trim_spaces (p);
|
trim_spaces (p);
|
||||||
@ -600,6 +611,17 @@ unix_rootdir (int want_sysconfdir)
|
|||||||
log_info ("error getting %s from gpgconf.ctl: %s\n",
|
log_info ("error getting %s from gpgconf.ctl: %s\n",
|
||||||
name, gpg_strerror (err));
|
name, gpg_strerror (err));
|
||||||
}
|
}
|
||||||
|
else if (!strcmp (name, ".enable"))
|
||||||
|
{
|
||||||
|
if (atoi (p)
|
||||||
|
|| !ascii_strcasecmp (p, "yes")
|
||||||
|
|| !ascii_strcasecmp (p, "true")
|
||||||
|
|| !ascii_strcasecmp (p, "fact"))
|
||||||
|
; /* Yes, this file shall be used. */
|
||||||
|
else
|
||||||
|
ignoreall = 1; /* No, this file shall be ignored. */
|
||||||
|
xfree (p);
|
||||||
|
}
|
||||||
else if (!strcmp (name, "sysconfdir"))
|
else if (!strcmp (name, "sysconfdir"))
|
||||||
{
|
{
|
||||||
xfree (sysconfdir);
|
xfree (sysconfdir);
|
||||||
@ -627,7 +649,13 @@ unix_rootdir (int want_sysconfdir)
|
|||||||
xfree (buffer);
|
xfree (buffer);
|
||||||
xfree (line);
|
xfree (line);
|
||||||
|
|
||||||
if (!rootdir || !*rootdir || *rootdir != '/')
|
if (ignoreall)
|
||||||
|
{
|
||||||
|
xfree (rootdir);
|
||||||
|
xfree (sysconfdir);
|
||||||
|
sdir = dir = NULL;
|
||||||
|
}
|
||||||
|
else if (!rootdir || !*rootdir || *rootdir != '/')
|
||||||
{
|
{
|
||||||
log_info ("invalid rootdir '%s' specified in gpgconf.ctl\n", rootdir);
|
log_info ("invalid rootdir '%s' specified in gpgconf.ctl\n", rootdir);
|
||||||
xfree (rootdir);
|
xfree (rootdir);
|
||||||
|
@ -33,6 +33,7 @@ AM_CFLAGS =
|
|||||||
# pwd which handles symlinks differently.
|
# pwd which handles symlinks differently.
|
||||||
OLD_TESTS_ENVIRONMENT = GNUPGHOME=`/bin/pwd` GPG_AGENT_INFO= LC_ALL=C \
|
OLD_TESTS_ENVIRONMENT = GNUPGHOME=`/bin/pwd` GPG_AGENT_INFO= LC_ALL=C \
|
||||||
GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
|
GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
|
||||||
|
GNUPG_IN_TEST_SUITE=fact \
|
||||||
GPGSM="$(GPGSM)" "$(srcdir)/runtest"
|
GPGSM="$(GPGSM)" "$(srcdir)/runtest"
|
||||||
|
|
||||||
TESTS_ENVIRONMENT = LC_ALL=C \
|
TESTS_ENVIRONMENT = LC_ALL=C \
|
||||||
@ -41,6 +42,7 @@ TESTS_ENVIRONMENT = LC_ALL=C \
|
|||||||
abs_top_srcdir="$(abs_top_srcdir)" \
|
abs_top_srcdir="$(abs_top_srcdir)" \
|
||||||
objdir="$(abs_top_builddir)" \
|
objdir="$(abs_top_builddir)" \
|
||||||
GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
|
GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
|
||||||
|
GNUPG_IN_TEST_SUITE=fact \
|
||||||
GPGSCM_PATH="$(abs_top_srcdir)/tests/gpgscm"
|
GPGSCM_PATH="$(abs_top_srcdir)/tests/gpgscm"
|
||||||
|
|
||||||
XTESTS = \
|
XTESTS = \
|
||||||
|
@ -11,5 +11,8 @@
|
|||||||
# variables are substituted in standard shell manner, the final value
|
# variables are substituted in standard shell manner, the final value
|
||||||
# must start with a slash, trailing slashes are stripped.
|
# must start with a slash, trailing slashes are stripped.
|
||||||
|
|
||||||
|
# This file is only considered if the given envvar evaluates to true.
|
||||||
|
.enable = $GNUPG_IN_TEST_SUITE
|
||||||
|
|
||||||
sysconfdir = $GNUPG_BUILD_ROOT/etc
|
sysconfdir = $GNUPG_BUILD_ROOT/etc
|
||||||
rootdir = $GNUPG_BUILD_ROOT/
|
rootdir = $GNUPG_BUILD_ROOT/
|
||||||
|
@ -34,6 +34,7 @@ TESTS_ENVIRONMENT = LC_ALL=C \
|
|||||||
abs_top_srcdir=$(abs_top_srcdir) \
|
abs_top_srcdir=$(abs_top_srcdir) \
|
||||||
objdir=$(abs_top_builddir) \
|
objdir=$(abs_top_builddir) \
|
||||||
GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
|
GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
|
||||||
|
GNUPG_IN_TEST_SUITE=fact \
|
||||||
GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm
|
GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm
|
||||||
|
|
||||||
# XXX: Currently, one cannot override automake's 'check' target. As a
|
# XXX: Currently, one cannot override automake's 'check' target. As a
|
||||||
|
@ -34,6 +34,7 @@ TESTS_ENVIRONMENT = GPG_AGENT_INFO= LC_ALL=C \
|
|||||||
abs_top_srcdir="$(abs_top_srcdir)" \
|
abs_top_srcdir="$(abs_top_srcdir)" \
|
||||||
objdir="$(abs_top_builddir)" \
|
objdir="$(abs_top_builddir)" \
|
||||||
GNUPG_BUILD_ROOT="$(abs_top_builddir)/tests" \
|
GNUPG_BUILD_ROOT="$(abs_top_builddir)/tests" \
|
||||||
|
GNUPG_IN_TEST_SUITE=fact \
|
||||||
GPGSCM_PATH="$(abs_top_srcdir)/tests/gpgscm"
|
GPGSCM_PATH="$(abs_top_srcdir)/tests/gpgscm"
|
||||||
|
|
||||||
XTESTS = from-classic.scm \
|
XTESTS = from-classic.scm \
|
||||||
|
@ -39,6 +39,7 @@ TESTS_ENVIRONMENT = LC_ALL=C \
|
|||||||
abs_top_srcdir="$(abs_top_srcdir)" \
|
abs_top_srcdir="$(abs_top_srcdir)" \
|
||||||
objdir="$(abs_top_builddir)" \
|
objdir="$(abs_top_builddir)" \
|
||||||
GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
|
GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
|
||||||
|
GNUPG_IN_TEST_SUITE=fact \
|
||||||
GPGSCM_PATH="$(abs_top_srcdir)/tests/gpgscm"
|
GPGSCM_PATH="$(abs_top_srcdir)/tests/gpgscm"
|
||||||
|
|
||||||
XTESTS = \
|
XTESTS = \
|
||||||
|
@ -22,6 +22,7 @@ GPGSM = ../../sm/gpgsm
|
|||||||
|
|
||||||
TESTS_ENVIRONMENT = GNUPGHOME=`/bin/pwd` GPG_AGENT_INFO= LC_ALL=C \
|
TESTS_ENVIRONMENT = GNUPGHOME=`/bin/pwd` GPG_AGENT_INFO= LC_ALL=C \
|
||||||
GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
|
GNUPG_BUILD_ROOT="$(abs_top_builddir)" \
|
||||||
|
GNUPG_IN_TEST_SUITE=fact \
|
||||||
GPGSM=$(GPGSM) silent=yes
|
GPGSM=$(GPGSM) silent=yes
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ TESTS_ENVIRONMENT = LC_ALL=C \
|
|||||||
SWTPM="$(SWTPM)" \
|
SWTPM="$(SWTPM)" \
|
||||||
SWTPM_IOCTL="$(SWTPM_IOCTL)" \
|
SWTPM_IOCTL="$(SWTPM_IOCTL)" \
|
||||||
GNUPG_BUILD_ROOT="$(abs_top_builddir)/tests" \
|
GNUPG_BUILD_ROOT="$(abs_top_builddir)/tests" \
|
||||||
|
GNUPG_IN_TEST_SUITE=fact \
|
||||||
GPGSCM_PATH="$(abs_top_srcdir)/tests/gpgscm"
|
GPGSCM_PATH="$(abs_top_srcdir)/tests/gpgscm"
|
||||||
|
|
||||||
XTESTS = \
|
XTESTS = \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user