Use a dedicated file for each autoconf variable
To avoid any escaping issues or messing with a language-specific format when the variable has to be parsed, create a dedicated file for each variable that is obtained from autoconf.
This commit is contained in:
@@ -271,11 +271,11 @@ stages:
|
||||
|
||||
# change directory to the workspace before including this
|
||||
.find_python: &find_python
|
||||
- PYTHON="$(sed -n -E 's|^[[:space:]]*"PYTHON":[[:space:]]*"([^"]*)",[[:space:]]*$|\1|p' bin/tests/system/isctest/vars/autoconf.py)"
|
||||
- PYTHON="$(cat bin/tests/system/isctest/vars/.ac_vars/PYTHON)"
|
||||
- test -x "$PYTHON"
|
||||
|
||||
.find_pytest: &find_pytest
|
||||
- PYTEST="$(sed -n -E 's|^[[:space:]]*"PYTEST":[[:space:]]*"([^"]*)",[[:space:]]*$|\1|p' bin/tests/system/isctest/vars/autoconf.py)"
|
||||
- PYTEST="$(cat bin/tests/system/isctest/vars/.ac_vars/PYTEST)"
|
||||
- test -x "$PYTEST"
|
||||
|
||||
.parse_tsan: &parse_tsan
|
||||
|
||||
@@ -47,6 +47,7 @@ Files: **/*.after*
|
||||
bin/tests/system/forward/CA/index.txt
|
||||
bin/tests/system/forward/CA/index.txt.attr
|
||||
bin/tests/system/forward/CA/serial
|
||||
bin/tests/system/isctest/vars/.ac_vars/*
|
||||
bin/tests/system/journal/ns1/managed-keys.bind.in
|
||||
bin/tests/system/journal/ns1/managed-keys.bind.jnl.in
|
||||
bin/tests/system/journal/ns2/managed-keys.bind.in
|
||||
|
||||
3
bin/tests/system/.gitignore
vendored
3
bin/tests/system/.gitignore
vendored
@@ -19,7 +19,8 @@ named.run
|
||||
/start.sh
|
||||
/stop.sh
|
||||
/ifconfig.sh
|
||||
/isctest/vars/autoconf.py
|
||||
/isctest/vars/.ac_vars/*
|
||||
!/isctest/vars/.ac_vars/*.in
|
||||
|
||||
# Ignore file names with underscore in their name except python or shell files.
|
||||
# This is done to ignore the temporary directories and symlinks created by the
|
||||
|
||||
1
bin/tests/system/isctest/vars/.ac_vars/CURL.in
Normal file
1
bin/tests/system/isctest/vars/.ac_vars/CURL.in
Normal file
@@ -0,0 +1 @@
|
||||
@CURL@
|
||||
1
bin/tests/system/isctest/vars/.ac_vars/FSTRM_CAPTURE.in
Normal file
1
bin/tests/system/isctest/vars/.ac_vars/FSTRM_CAPTURE.in
Normal file
@@ -0,0 +1 @@
|
||||
@FSTRM_CAPTURE@
|
||||
1
bin/tests/system/isctest/vars/.ac_vars/NC.in
Normal file
1
bin/tests/system/isctest/vars/.ac_vars/NC.in
Normal file
@@ -0,0 +1 @@
|
||||
@NC@
|
||||
1
bin/tests/system/isctest/vars/.ac_vars/PERL.in
Normal file
1
bin/tests/system/isctest/vars/.ac_vars/PERL.in
Normal file
@@ -0,0 +1 @@
|
||||
@PERL@
|
||||
1
bin/tests/system/isctest/vars/.ac_vars/PYTEST.in
Normal file
1
bin/tests/system/isctest/vars/.ac_vars/PYTEST.in
Normal file
@@ -0,0 +1 @@
|
||||
@PYTEST@
|
||||
1
bin/tests/system/isctest/vars/.ac_vars/PYTHON.in
Normal file
1
bin/tests/system/isctest/vars/.ac_vars/PYTHON.in
Normal file
@@ -0,0 +1 @@
|
||||
@PYTHON@
|
||||
1
bin/tests/system/isctest/vars/.ac_vars/SHELL.in
Normal file
1
bin/tests/system/isctest/vars/.ac_vars/SHELL.in
Normal file
@@ -0,0 +1 @@
|
||||
@SHELL@
|
||||
1
bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR.in
Normal file
1
bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR.in
Normal file
@@ -0,0 +1 @@
|
||||
@abs_top_builddir@
|
||||
1
bin/tests/system/isctest/vars/.ac_vars/TOP_SRCDIR.in
Normal file
1
bin/tests/system/isctest/vars/.ac_vars/TOP_SRCDIR.in
Normal file
@@ -0,0 +1 @@
|
||||
@abs_top_srcdir@
|
||||
1
bin/tests/system/isctest/vars/.ac_vars/XSLTPROC.in
Normal file
1
bin/tests/system/isctest/vars/.ac_vars/XSLTPROC.in
Normal file
@@ -0,0 +1 @@
|
||||
@XSLTPROC@
|
||||
29
bin/tests/system/isctest/vars/autoconf.py
Normal file
29
bin/tests/system/isctest/vars/autoconf.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
#
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
|
||||
|
||||
def load_ac_vars_from_files() -> Dict[str, str]:
|
||||
ac_vars = {}
|
||||
ac_vars_dir = Path(__file__).resolve().parent / ".ac_vars"
|
||||
var_paths = [
|
||||
path
|
||||
for path in ac_vars_dir.iterdir()
|
||||
if path.is_file() and not path.name.endswith(".in")
|
||||
]
|
||||
for var_path in var_paths:
|
||||
ac_vars[var_path.name] = var_path.read_text(encoding="utf-8").strip()
|
||||
return ac_vars
|
||||
|
||||
|
||||
AC_VARS = load_ac_vars_from_files()
|
||||
@@ -1,23 +0,0 @@
|
||||
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
#
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
AC_VARS = {
|
||||
"TOP_BUILDDIR": "@abs_top_builddir@",
|
||||
"TOP_SRCDIR": "@abs_top_srcdir@",
|
||||
"FSTRM_CAPTURE": "@FSTRM_CAPTURE@",
|
||||
"SHELL": "@SHELL@",
|
||||
"PYTHON": "@PYTHON@",
|
||||
"PERL": "@PERL@",
|
||||
"CURL": "@CURL@",
|
||||
"NC": "@NC@",
|
||||
"XSLTPROC": "@XSLTPROC@",
|
||||
"PYTEST": "@PYTEST@",
|
||||
}
|
||||
11
configure.ac
11
configure.ac
@@ -1656,7 +1656,16 @@ AC_CONFIG_FILES([tests/unit-test-driver.sh],
|
||||
|
||||
AC_CONFIG_FILES([bin/tests/Makefile
|
||||
bin/tests/system/Makefile
|
||||
bin/tests/system/isctest/vars/autoconf.py
|
||||
bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR
|
||||
bin/tests/system/isctest/vars/.ac_vars/TOP_SRCDIR
|
||||
bin/tests/system/isctest/vars/.ac_vars/FSTRM_CAPTURE
|
||||
bin/tests/system/isctest/vars/.ac_vars/SHELL
|
||||
bin/tests/system/isctest/vars/.ac_vars/PYTHON
|
||||
bin/tests/system/isctest/vars/.ac_vars/PERL
|
||||
bin/tests/system/isctest/vars/.ac_vars/CURL
|
||||
bin/tests/system/isctest/vars/.ac_vars/NC
|
||||
bin/tests/system/isctest/vars/.ac_vars/XSLTPROC
|
||||
bin/tests/system/isctest/vars/.ac_vars/PYTEST
|
||||
bin/tests/system/dyndb/driver/Makefile
|
||||
bin/tests/system/dlzexternal/driver/Makefile
|
||||
bin/tests/system/hooks/driver/Makefile
|
||||
|
||||
Reference in New Issue
Block a user