+++ /dev/null
-# knot-resolver-manager upstream packaging sources
-
-Top level distro/ dir contains upstream packaging sources for native packages.
-
-Files in this directory follow [apkg] conventions and apkg can be used to
-create BIRD packages for various distros directly from upstream sources as
-well as from upstream archives once available.
-
-[apkg]: https://apkg.rtfd.io
-
-
-## Create package from current repo commit
-
-Create native packages using isolated builder (pbuilder, mock, ...):
-
- apkg build
-
-If you're using VM, container or other disposable system, it's recommended to
-build packages directly using -h/--host-build and -i/--install-dep:
-
- apkg build -Hi
-
-To create source package:
-
- apkg srcpkg
-
+++ /dev/null
-[project]
-name = "knot-resolver-manager"
-# needed for make-archive
-make_archive_script = "scripts/make-dev-archive.sh"
+++ /dev/null
-knot-resolver-manager ({{ version }}-cznic.{{ release }}) unstable; urgency=medium
-
- * new upstream version {{ version }}
-
- -- Jakub Ružička <jakub.ruzicka@nic.cz> Tue, 20 Apr 2020 16:20:00 +0100
+++ /dev/null
-Source: knot-resolver-manager
-Section: python
-Priority: optional
-Maintainer: Jakub Ružička <jakub.ruzicka@nic.cz>
-Build-Depends:
- debhelper,
- dh-python,
- python3,
-Homepage: https://gitlab.nic.cz/knot/knot-resolver-manager
-
-Package: python3-knot-resolver-manager
-Architecture: all
-Depends:
- python3-aiohttp,
- python3-click,
- python3-gi,
- python3-pydbus,
- python3-yaml,
- ${misc:Depends},
- ${python3:Depends},
-Recommends:
- knot-resolver
-Provides: knot-resolver-manager
-Description: Knot Resolver Manager
+++ /dev/null
-Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: knot-resolver-manager
-Source: https://gitlab.nic.cz/knot/knot-resolver-manager
-
-Files: *
-Copyright: (c) 2021, CZ.NIC
-License: GPL-3+
-
-License: GPL-3+
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- .
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
- .
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
- .
- On Debian systems, the full text of the GNU General Public License
- version 3 can be found in the file `/usr/share/common-licenses/GPL-3'.
+++ /dev/null
-#!/usr/bin/make -f
-
-%:
- dh $@ --buildsystem=pybuild
-
-override_dh_auto_build:
- echo "no build required"
+++ /dev/null
-3.0 (quilt)
run = { cmd = "scripts/run", help = "Run the manager" }
run-debug = { cmd = "scripts/run-debug", help = "Run the manager under debugger" }
docs = { cmd = "scripts/docs", help = "Create HTML documentation" }
-test = { cmd = "pytest --cov=knot_resolver_manager --show-capture=all tests/", help = "Run tests" }
+test = { cmd = "pytest --cov=knot_resolver_manager --show-capture=all tests/unit/", help = "Run tests" }
check = { cmd = "scripts/codecheck", help = "Run static code analysis" }
-format = { shell = "black knot_resolver_manager/ tests/ integration/ scripts/; isort .", help = "Run code formatter" }
+format = { shell = "black knot_resolver_manager/ tests/ scripts/; isort .", help = "Run code formatter" }
fixdeps = { shell = "poetry install; npm install; npm update", help = "Install/update dependencies according to configuration files"}
commit = { shell = "scripts/commit", help = "Invoke every single check before commiting" }
container = { cmd = "scripts/container.py", help = "Manage containers" }
"""
gen-setuppy = { shell = "python scripts/create_setup.py > setup.py", help = "Generate setup.py file for backwards compatibility" }
tox = { cmd = "tox", help = "Run tests in tox" }
-integration = {cmd = "python integration/runner.py", help = "Run integration tests" }
+integration = {cmd = "python tests/integration/runner.py", help = "Run integration tests" }
configure-vscode = {cmd = "scripts/configure-vscode", help = "Create VSCode configuration for debugging, virtual envs etc" }
# check formatting using black
echo -e "${yellow}Checking formatting using black...${reset}"
-black knot_resolver_manager tests integration scripts --check --diff
+black knot_resolver_manager tests scripts --check --diff
check_rv $?
echo
git config --global user.name "GitLab CI"
git checkout manager-integration
git submodule update --init --recursive
+cd manager
+git checkout master
+cd ..
+git commit -a -m "auto-update of knot-resolver's manager to the latest master branch"
# build the package
apkg system-setup
--- /dev/null
+# Testing infrastructure
+
+## Unit tests
+
+The unit tests use `pytest` and can be invoked by the command `poe test`. They reside in the `unit` subdirectory. They can be run from freshly cloned repository and they should suceed.
+
+## Integration tests
+
+The integration tests spawn a full manager with `kresd` instances (which it expects to be installed). The tests are implemented by a custom script and they can be invoked by `poe integration` command.
\ No newline at end of file
listen:
ip: 127.0.0.1
port: 5001
- rundir: integration/run
+ rundir: tests/integration/run
cache:
storage: cache
logging:
def test_wrapper(test: Test) -> bool:
- p = start_manager_in_background(Path("integration/config.yml"))
+ p = start_manager_in_background(Path("tests/integration/config.yml"))
client = KnotManagerClient(BASE_URL)
client.wait_for_initialization()
assert cnt == 2, f"Expected 2 kresd instances, found {cnt}"
# start the server again
- p = start_manager_in_background(Path("integration/config.yml"))
+ p = start_manager_in_background(Path("test/integration/config.yml"))
try:
client.wait_for_initialization()
except TimeoutError as e:
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
+
+ # create run directories if it does not exist
+ Path("tests/integration/run").mkdir(exist_ok=True)
+
+ # run the tests
success = True
success &= test_wrapper(worker_count)
# success &= test_wrapper(crash_resistance)
+
+ # exit with proper exitcode
sys.exit(int(not success))