mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04: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:
parent
fc84bf80e4
commit
d7ace928b5
3 changed files with 10 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue