diff options
author | Lukáš Ježek <lukas.jezek@nic.cz> | 2019-11-18 12:16:42 +0100 |
---|---|---|
committer | Petr Špaček <petr.spacek@nic.cz> | 2019-11-20 13:36:18 +0100 |
commit | e4196a56ad9d900c7ec6228c5682c131fab62f95 (patch) | |
tree | da6543a137661b439a7aa465833a746709d36b9e /modules | |
parent | Merge branch 'doh_decrypt' into 'master' (diff) | |
download | knot-resolver-e4196a56ad9d900c7ec6228c5682c131fab62f95.tar.xz knot-resolver-e4196a56ad9d900c7ec6228c5682c131fab62f95.zip |
tests: packaging
Directory with subdirectory "packaging" is called "component".
List all components: python3 tests/packaging-doc.py --list
Run all tests/compoments: python3 tests/packaging-doc.py
Run specific test/component: python3 tests/packaging-doc.py --test <component>
The file structure for 1 component:
daemon - dependencies for 1 component "kresd daemon" (default component, must always be there)
scripts/distros - dependencies for 1 component for specific distro (must always be there)
scripts/dockerfile_gen.py - test Dockerfile generator, see below
tests/packaging.py - script to generate and build all combinations
of Docker files for all components
[component] - directory of component/test, see below
(e.g. "client/packaging/", "modules/http/packaging/" etc.)
The file structure of each component:
[component]
<distro>/<version> - package names
- builddeps - list of build depedencies
- rundeps - list of runtime depedencies
- pre-build.sh - script called before build phase
- post-build.sh - script called after build phase
- pre-run.sh - script called before run phase
- post-run.sh - script called after run phase
- install.sh and build.sh script called during build phase
test.config or test.sh - kresd config test or shell script
note: content of "scripts/distroos" is same as "<distro>/<version>" of component.
There are "build" and "run" phases. "build" phase precedes "run" phase.
All script are called in this order:
1. pre-<phase>.sh
2. install packages specifed in the file "<phase>deps"
3a. for "build" phase: run build.sh and install.sh
3b. for "run" phase: run 'kresd -c [component]/test.config' or config.sh
4. remove packages specified in the file "<phase>deps"
5. post-<phase>.sh
Each step above is combines base components with a component under test.
E.g. component "scripts/distros" always precedes component "daemon/packaging"
and it precedes the tested component e.g. "modules/http".
In long term we might migrate this to py.test or some other well known
framework.
Diffstat (limited to 'modules')
34 files changed, 99 insertions, 0 deletions
diff --git a/modules/bogus_log/packaging/debian/10/rundeps b/modules/bogus_log/packaging/debian/10/rundeps new file mode 100644 index 00000000..c557cb28 --- /dev/null +++ b/modules/bogus_log/packaging/debian/10/rundeps @@ -0,0 +1 @@ +lua-http diff --git a/modules/bogus_log/packaging/test.config b/modules/bogus_log/packaging/test.config new file mode 100644 index 00000000..dde661b1 --- /dev/null +++ b/modules/bogus_log/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('bogus_log') +assert(bogus_log) +quit() diff --git a/modules/daf/packaging/test.config b/modules/daf/packaging/test.config new file mode 100644 index 00000000..951b0729 --- /dev/null +++ b/modules/daf/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('daf') +assert(daf) +quit() diff --git a/modules/detect_time_jump/packaging/test.config b/modules/detect_time_jump/packaging/test.config new file mode 100644 index 00000000..911fc3c7 --- /dev/null +++ b/modules/detect_time_jump/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('detect_time_jump') +assert(detect_time_jump) +quit() diff --git a/modules/detect_time_skew/packaging/test.config b/modules/detect_time_skew/packaging/test.config new file mode 100644 index 00000000..ebb9366f --- /dev/null +++ b/modules/detect_time_skew/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('detect_time_skew') +assert(detect_time_skew) +quit() diff --git a/modules/dns64/packaging/test.config b/modules/dns64/packaging/test.config new file mode 100644 index 00000000..6c8650f0 --- /dev/null +++ b/modules/dns64/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('dns64') +assert(dns64) +quit() diff --git a/modules/dnstap/packaging/debian/10/builddeps b/modules/dnstap/packaging/debian/10/builddeps new file mode 100644 index 00000000..417dc04a --- /dev/null +++ b/modules/dnstap/packaging/debian/10/builddeps @@ -0,0 +1,3 @@ +libfstrm-dev +libprotobuf-c-dev +protobuf-c-compiler diff --git a/modules/dnstap/packaging/debian/10/rundeps b/modules/dnstap/packaging/debian/10/rundeps new file mode 100644 index 00000000..a726e120 --- /dev/null +++ b/modules/dnstap/packaging/debian/10/rundeps @@ -0,0 +1,2 @@ +libfstrm0 +libprotobuf-c1 diff --git a/modules/dnstap/packaging/test.config b/modules/dnstap/packaging/test.config new file mode 100644 index 00000000..362b1995 --- /dev/null +++ b/modules/dnstap/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('dnstap') +assert(dnstap) +quit() diff --git a/modules/edns_keepalive/packaging/test.config b/modules/edns_keepalive/packaging/test.config new file mode 100644 index 00000000..3d824fa5 --- /dev/null +++ b/modules/edns_keepalive/packaging/test.config @@ -0,0 +1,9 @@ +modules.load('edns_keepalive') + +for _,item in ipairs(modules.list()) do + if item == "edns_keepalive" then + os.exit(0) + end +end + +os.exit(1) diff --git a/modules/etcd/packaging/debian/10/builddeps b/modules/etcd/packaging/debian/10/builddeps new file mode 100644 index 00000000..a355a9f8 --- /dev/null +++ b/modules/etcd/packaging/debian/10/builddeps @@ -0,0 +1,3 @@ +libssl-dev +luarocks +git diff --git a/modules/etcd/packaging/debian/10/install.sh b/modules/etcd/packaging/debian/10/install.sh new file mode 100755 index 00000000..4df79d99 --- /dev/null +++ b/modules/etcd/packaging/debian/10/install.sh @@ -0,0 +1 @@ +luarocks install etcd --from=https://mah0x211.github.io/rocks/ diff --git a/modules/etcd/packaging/test.config b/modules/etcd/packaging/test.config new file mode 100644 index 00000000..701aa869 --- /dev/null +++ b/modules/etcd/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('etcd') +assert(etcd) +quit() diff --git a/modules/experimental_dot_auth/packaging/debian/10/rundeps b/modules/experimental_dot_auth/packaging/debian/10/rundeps new file mode 100644 index 00000000..36b83e18 --- /dev/null +++ b/modules/experimental_dot_auth/packaging/debian/10/rundeps @@ -0,0 +1 @@ +lua-basexx diff --git a/modules/experimental_dot_auth/packaging/test.config b/modules/experimental_dot_auth/packaging/test.config new file mode 100644 index 00000000..e66cff40 --- /dev/null +++ b/modules/experimental_dot_auth/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('experimental_dot_auth') +assert(experimental_dot_auth) +quit() diff --git a/modules/graphite/packaging/test.config b/modules/graphite/packaging/test.config new file mode 100644 index 00000000..1c87f4ff --- /dev/null +++ b/modules/graphite/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('graphite') +assert(graphite) +quit() diff --git a/modules/hints/packaging/test.config b/modules/hints/packaging/test.config new file mode 100644 index 00000000..804e2c10 --- /dev/null +++ b/modules/hints/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('hints') +assert(hints) +quit() diff --git a/modules/http/packaging/debian/10/rundeps b/modules/http/packaging/debian/10/rundeps new file mode 100644 index 00000000..c557cb28 --- /dev/null +++ b/modules/http/packaging/debian/10/rundeps @@ -0,0 +1 @@ +lua-http diff --git a/modules/http/packaging/test.config b/modules/http/packaging/test.config new file mode 100644 index 00000000..64e9d398 --- /dev/null +++ b/modules/http/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('http') +assert(http) +quit() diff --git a/modules/nsid/packaging/test.config b/modules/nsid/packaging/test.config new file mode 100644 index 00000000..bbef9c7a --- /dev/null +++ b/modules/nsid/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('nsid') +assert(nsid) +quit() diff --git a/modules/policy/packaging/test.config b/modules/policy/packaging/test.config new file mode 100644 index 00000000..60b81bf4 --- /dev/null +++ b/modules/policy/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('policy') +assert(policy) +quit() diff --git a/modules/predict/packaging/test.config b/modules/predict/packaging/test.config new file mode 100644 index 00000000..bd70193c --- /dev/null +++ b/modules/predict/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('predict') +assert(predict) +quit() diff --git a/modules/prefill/packaging/test.config b/modules/prefill/packaging/test.config new file mode 100644 index 00000000..424160da --- /dev/null +++ b/modules/prefill/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('prefill') +assert(prefill) +quit() diff --git a/modules/priming/packaging/test.config b/modules/priming/packaging/test.config new file mode 100644 index 00000000..b5d14b05 --- /dev/null +++ b/modules/priming/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('priming') +assert(priming) +quit() diff --git a/modules/rebinding/packaging/test.config b/modules/rebinding/packaging/test.config new file mode 100644 index 00000000..f7472fbc --- /dev/null +++ b/modules/rebinding/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('rebinding') +assert(rebinding) +quit() diff --git a/modules/renumber/packaging/test.config b/modules/renumber/packaging/test.config new file mode 100644 index 00000000..7465e86a --- /dev/null +++ b/modules/renumber/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('renumber') +assert(renumber) +quit() diff --git a/modules/serve_stale/packaging/test.config b/modules/serve_stale/packaging/test.config new file mode 100644 index 00000000..6e720eae --- /dev/null +++ b/modules/serve_stale/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('serve_stale') +assert(serve_stale) +quit() diff --git a/modules/stats/packaging/test.config b/modules/stats/packaging/test.config new file mode 100644 index 00000000..038670a0 --- /dev/null +++ b/modules/stats/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('stats') +assert(stats) +quit() diff --git a/modules/ta_sentinel/packaging/test.config b/modules/ta_sentinel/packaging/test.config new file mode 100644 index 00000000..bf0111e5 --- /dev/null +++ b/modules/ta_sentinel/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('ta_sentinel') +assert(ta_sentinel) +quit() diff --git a/modules/ta_signal_query/packaging/test.config b/modules/ta_signal_query/packaging/test.config new file mode 100644 index 00000000..58517b53 --- /dev/null +++ b/modules/ta_signal_query/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('ta_signal_query') +assert(ta_signal_query) +quit() diff --git a/modules/ta_update/packaging/test.config b/modules/ta_update/packaging/test.config new file mode 100644 index 00000000..59681ad1 --- /dev/null +++ b/modules/ta_update/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('ta_update') +assert(ta_update) +quit() diff --git a/modules/view/packaging/test.config b/modules/view/packaging/test.config new file mode 100644 index 00000000..8d65b2e8 --- /dev/null +++ b/modules/view/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('view') +assert(view) +quit() diff --git a/modules/watchdog/packaging/test.config b/modules/watchdog/packaging/test.config new file mode 100644 index 00000000..42be572f --- /dev/null +++ b/modules/watchdog/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('watchdog') +assert(watchdog) +quit() diff --git a/modules/workarounds/packaging/test.config b/modules/workarounds/packaging/test.config new file mode 100644 index 00000000..0bf78ca9 --- /dev/null +++ b/modules/workarounds/packaging/test.config @@ -0,0 +1,3 @@ +modules.load('workarounds') +assert(workarounds) +quit() |