mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Initialize all environment variables when running isctest
Ensure all the variables are initialized when running the main function of isctest module. This enables proper environment variables during test script development when only conf.sh is sourced, rather than the script being executed by the pytest runner.
This commit is contained in:
@@ -9,9 +9,16 @@
|
||||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
from .vars import ALL
|
||||
import logging
|
||||
|
||||
from . import log
|
||||
from .vars import ALL, init_vars
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# use root logger as fallback - we're not interested in proper logs here
|
||||
log.basic.LOGGERS["conftest"] = logging.getLogger()
|
||||
|
||||
init_vars()
|
||||
for name, value in ALL.items():
|
||||
print(f"export {name}={value}")
|
||||
|
@@ -14,7 +14,6 @@ from pathlib import Path
|
||||
from typing import Dict, Optional
|
||||
|
||||
|
||||
CONFTEST_LOGGER = logging.getLogger("conftest")
|
||||
LOG_FORMAT = "%(asctime)s %(levelname)7s:%(name)s %(message)s"
|
||||
|
||||
LOGGERS = {
|
||||
|
@@ -129,9 +129,11 @@ def is_crypto_supported(alg: Algorithm) -> bool:
|
||||
cwd=tmpdir,
|
||||
check=False,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.PIPE,
|
||||
)
|
||||
if proc.returncode == 0:
|
||||
return True
|
||||
log.debug(f"dnssec-keygen stderr: {proc.stderr.decode('utf-8')}")
|
||||
log.info("algorithm %s not supported", alg.name)
|
||||
return False
|
||||
|
||||
|
Reference in New Issue
Block a user