mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Load env vars in shell-only processing of conf.sh
While this isn't required for pytest operation and execution of the system test suite, it can be handy to allow test script development and debugging. Especially setup scripts often source conf.sh and expect environment variables to be loaded. If these scripts are executed stand-alone, the environment variables need to be loaded from the python package.
This commit is contained in:
@@ -11,6 +11,13 @@
|
||||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
# When sourcing the script outside the pytest environment (e.g. during helper
|
||||
# script development), the env variables have to be loaded.
|
||||
if [ -z "$TOP_SRCDIR" ]; then
|
||||
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd | sed -E 's|(.*bin/tests/system).*|\1|')
|
||||
eval "$(PYTHONPATH="$SCRIPT_DIR:$PYTHONPATH" /usr/bin/env python3 -m isctest)"
|
||||
fi
|
||||
|
||||
testsock6() {
|
||||
if test -n "$PERL" && $PERL -e "use IO::Socket::IP;" 2> /dev/null
|
||||
then
|
||||
|
17
bin/tests/system/isctest/__main__.py
Normal file
17
bin/tests/system/isctest/__main__.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# 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 .vars import ALL
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
for name, value in ALL.items():
|
||||
print(f"export {name}={value}")
|
Reference in New Issue
Block a user