summaryrefslogtreecommitdiffstats
path: root/tests/pytests/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:26:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:26:00 +0000
commit830407e88f9d40d954356c3754f2647f91d5c06a (patch)
treed6a0ece6feea91f3c656166dbaa884ef8a29740e /tests/pytests/meson.build
parentInitial commit. (diff)
downloadknot-resolver-830407e88f9d40d954356c3754f2647f91d5c06a.tar.xz
knot-resolver-830407e88f9d40d954356c3754f2647f91d5c06a.zip
Adding upstream version 5.6.0.upstream/5.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/pytests/meson.build')
-rw-r--r--tests/pytests/meson.build77
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/pytests/meson.build b/tests/pytests/meson.build
new file mode 100644
index 0000000..d717dc2
--- /dev/null
+++ b/tests/pytests/meson.build
@@ -0,0 +1,77 @@
+# tests: pytests
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# python 3 dependencies
+py3_deps += [
+ ['jinja2', 'jinja2 (for pytests)'],
+ ['dns', 'dnspython (for pytests)'],
+ ['pytest', 'pytest (for pytests)'],
+ ['pytest_html', 'pytest-html (for pytests)'],
+ ['xdist', 'pytest-xdist (for pytests)'],
+]
+
+if gnutls.version().version_compare('<3.6.4')
+ error('pytests require GnuTLS >= 3.6.4')
+endif
+
+# compile tlsproxy
+tlsproxy_src = files([
+ 'proxy/tlsproxy.c',
+ 'proxy/tls-proxy.c',
+])
+tlsproxy = executable(
+ 'tlsproxy',
+ tlsproxy_src,
+ dependencies: [
+ libkres_dep,
+ libuv,
+ gnutls,
+ ],
+)
+
+# path to kresd and tlsproxy
+pytests_env = environment()
+pytests_env.prepend('PATH', sbin_dir, meson.current_build_dir())
+
+test(
+ 'pytests.parallel',
+ python3,
+ args: [
+ '-m', 'pytest',
+ '-d',
+ '--html', 'pytests.parallel.html',
+ '--self-contained-html',
+ '--junitxml=pytests.parallel.junit.xml',
+ '-n', '24',
+ '-v',
+ ],
+ env: pytests_env,
+ suite: [
+ 'postinstall',
+ 'pytests',
+ ],
+ workdir: meson.current_source_dir(),
+ is_parallel: false,
+ timeout: 180,
+ depends: tlsproxy,
+)
+
+test(
+ 'pytests.single',
+ python3,
+ args: [
+ '-m', 'pytest',
+ '--junitxml=pytests.single.junit.xml',
+ '-ra',
+ '--capture=no',
+ 'conn_flood.py',
+ ],
+ env: pytests_env,
+ suite: [
+ 'postinstall',
+ 'pytests',
+ ],
+ workdir: meson.current_source_dir(),
+ is_parallel: false,
+ timeout: 240,
+)