summaryrefslogtreecommitdiffstats
path: root/test/TEST-02-CRYPTSETUP
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@users.noreply.github.com>2017-08-04 14:34:14 +0200
committerEvgeny Vereshchagin <evvers@ya.ru>2017-08-04 14:34:14 +0200
commit054ee249a28194626115a23257870f257bf69fda (patch)
tree309bf895976f355f02e89277d8c91b0d2028248f /test/TEST-02-CRYPTSETUP
parentMerge pull request #6518 from joukewitteveen/process-rename (diff)
downloadsystemd-054ee249a28194626115a23257870f257bf69fda.tar.xz
systemd-054ee249a28194626115a23257870f257bf69fda.zip
test: Factorize common integration test functions (#6540)
All test/TEST* but TEST-02-CRYPTSETUP share the same check_result_qemu() and test_cleanup(), so move them into test_functions and only override them in TEST-02-CRYPTSETUP. Also provide a common test_run() which by default assumes that both QEMU and nspawn tests are run. Particular tests which don't support either need to explicitly opt out by setting $TEST_NO_{QEMU,NSPAWN}. Do it this way around to avoid accidentally forgetting to opt in, and to encourage test authors to at least always support nspawn.
Diffstat (limited to 'test/TEST-02-CRYPTSETUP')
-rwxr-xr-xtest/TEST-02-CRYPTSETUP/test.sh10
1 files changed, 1 insertions, 9 deletions
diff --git a/test/TEST-02-CRYPTSETUP/test.sh b/test/TEST-02-CRYPTSETUP/test.sh
index aea0fc53f6..31eced5809 100755
--- a/test/TEST-02-CRYPTSETUP/test.sh
+++ b/test/TEST-02-CRYPTSETUP/test.sh
@@ -2,6 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
TEST_DESCRIPTION="cryptsetup systemd setup"
+TEST_NO_NSPAWN=1
. $TEST_BASE_DIR/test-functions
@@ -24,15 +25,6 @@ check_result_qemu() {
}
-test_run() {
- if run_qemu; then
- check_result_qemu || return 1
- else
- dwarn "can't run QEMU, skipping"
- fi
- return 0
-}
-
test_setup() {
create_empty_image
echo -n test >$TESTDIR/keyfile