summaryrefslogtreecommitdiffstats
path: root/test/TEST-24-UNIT-TESTS (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test: switch TEST-02-CRYPTSETUP and TEST-24-UNITTESTSZbigniew Jędrzejewski-Szmek2020-09-243-64/+0
| | | | | | | When tests are executed serially (the default), it seems better to launch the fairly generic test that runs the unittests early in the sequence. Right now the tests are ordered based on when they were written, but this doesn't make much sense.
* test: convert ubuntu-ci to use deny-listDan Streetman2020-08-011-0/+0
| | | | Follows #16262
* test: use a helper function to move the journal filesZbigniew Jędrzejewski-Szmek2020-03-311-4/+2
|
* test: run unittests with newlines in /proc/cmdlineZbigniew Jędrzejewski-Szmek2020-03-281-0/+8
| | | | This should help catch this class of errors.
* test: stop caching loopdevZbigniew Jędrzejewski-Szmek2020-03-281-2/+2
| | | | | | It is more trouble than it is worth. The setup is of a loopback device is very quick, so it's better to always create it when needed and immediately drop afterwards.
* test: run tests directly from the loopback deviceZbigniew Jędrzejewski-Szmek2020-03-281-10/+10
| | | | | | | | | | Before, we'd copy the test tree into nspawn-root, and run the tests from there. This is OK, and doesn't actually take much extra time. But it uses quite a lot of extra disk space. So let's make things a bit more efficient by running directly from the image file. We still run the unprivileged nspawn tests from a copy. Once the kernel implements fs shift, we can do away with that too.
* test: wipe journal files after testZbigniew Jędrzejewski-Szmek2020-03-281-0/+2
| | | | Otherwise they accumulate and create noise.
* test: rework how images are createdZbigniew Jędrzejewski-Szmek2020-03-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we'd create a separate image for each test, in /var/tmp/systemd-test.XXXXX/rootdisk.img. Most of the images where very similar, except that each one had some unit files installed specifically for the test. The installation of those custom unit files was removed in previous commits (all the unit files are always installed). The new approach is to only create as few distinct images as possible. We have: default.img: the "normal" image suitable for almost all the tests basic.img: the same as default image but doesn't mask any services cryptsetup.img: p2 is used for encrypted /var badid.img: /etc/machine-id is overwritten with stuff selinux.img: with selinux added for fun and fun and a few others: ls -l build/test/*img lrwxrwxrwx 1 root root 38 Mar 21 21:23 build/test/badid.img -> /var/tmp/systemd-test.PJFFeo/badid.img lrwxrwxrwx 1 root root 38 Mar 21 21:17 build/test/basic.img -> /var/tmp/systemd-test.na0xOI/basic.img lrwxrwxrwx 1 root root 43 Mar 21 21:18 build/test/cryptsetup.img -> /var/tmp/systemd-test.Tzjv06/cryptsetup.img lrwxrwxrwx 1 root root 40 Mar 21 21:19 build/test/default.img -> /var/tmp/systemd-test.EscAsS/default.img lrwxrwxrwx 1 root root 39 Mar 21 21:22 build/test/nspawn.img -> /var/tmp/systemd-test.HSebKo/nspawn.img lrwxrwxrwx 1 root root 40 Mar 21 21:20 build/test/selinux.img -> /var/tmp/systemd-test.daBjbx/selinux.img lrwxrwxrwx 1 root root 39 Mar 21 21:21 build/test/test08.img -> /var/tmp/systemd-test.OgnN8Z/test08.img I considered trying to use the same image everywhere. It would probably be possible, but it would be very brittle. By using separate images where it is necessary we keep various orthogonal modifications independent. The way that images are cached is complicated by the fact that we still want to keep them in /var/tmp. Thus, an image is created on first use and linked to from build/test/ so it can be found by other tests. Tests cannot be run in parallel. I think that is an acceptable limitation. Creation of the images was probably taking more resources then the actual tests, so we should be better off anyway.
* test: de-duplicate test_setup() functionsZbigniew Jędrzejewski-Szmek2020-03-281-19/+0
| | | | Now we will run setup_nspawn_root() in some case where do don't need to.
* test: move TEST-24-UNIT-TESTS setup to static filesZbigniew Jędrzejewski-Szmek2020-03-282-114/+2
| | | | | | I picked the list of zone files to install by grepping through the code. This is is a bit brittle, but installing all of them takes a while, and more importantly, writes a lot of lines to the log.
* treewide: more portable bash shebangsJörg Thalheim2020-03-052-2/+2
| | | | | | | | | | | | | | | | As in 2a5fcfae024ffc370bb780572279f45a1da3f946 and in 3e67e5c9928f8b1e1c5a63def88d53ed1fed12eb using /usr/bin/env allows bash to be looked up in PATH rather than being hard-coded. As with the previous changes the same arguments apply - distributions have scripts to rewrite shebangs on installation and they know what locations to rely on. - For tests/compilation we should rather rely on the user to have setup there PATH correctly. In particular this makes testing from git easier on NixOS where do not provide /bin/bash to improve compose-ability.
* test: add temporarily blacklisted testsDan Streetman2019-10-031-0/+0
| | | | | | | | | | | | | This temporarily blacklists some tests when run under Ubuntu CI. This is the upstream side of the Debian 'upstream' test MR: https://salsa.debian.org/systemd-team/systemd/merge_requests/52 The tests blacklisted here should only be temporarily blacklisted until they can be fixed; the intention is that these blacklist files will be added and removed over time while debugging/fixing flaky and/or regressed tests, without causing test failure noise for other PRs.
* test: replace $TESTDIR/root with $initdirDan Streetman2019-08-171-11/+11
| | | | | The $initdir var is already set to $TESTDIR/root, it should be used instead of direct use of $TESTDIR/root.
* test: use "ln -fs"Zbigniew Jędrzejewski-Szmek2019-07-301-3/+3
| | | | | Without this, repeated runs of "make -C TEST/... setup" fail when trying to create the symlink.
* test: add create_empty_image_rootdir() to simplify testcase setupDan Streetman2019-07-171-6/+1
| | | | | | | | | Almost all tests were manually mounting/unmounting $TESTDIR/root from the loopback image; this moves all that into test-functions so the test setup functions are simplier. Also add test_setup_cleanup() function, to cleanup what is mounted by create_empty_image_rootdir()
* test: drop || return 1 expression which is incompatible with set -eFrantisek Sumsal2019-07-081-1/+1
| | | | | | The `set -e` option is incompatible with a subshell/compound command, which is followed by || <EXPR>. In such case, the -e option is ignored in all affected subshells/functions (see man bash(1) for command `set`).
* scripts: use 4 space indentationZbigniew Jędrzejewski-Szmek2019-04-122-4/+0
| | | | | | | | | | | | | | | | | | We had all kinds of indentation: 2 sp, 3 sp, 4 sp, 8 sp, and mixed. 4 sp was the most common, in particular the majority of scripts under test/ used that. Let's standarize on 4 sp, because many commandlines are long and there's a lot of nesting, and with 8sp indentation less stuff fits. 4 sp also seems to be the default indentation, so this will make it less likely that people will mess up if they don't load the editor config. (I think people often use vi, and vi has no support to load project-wide configuration automatically. We distribute a .vimrc file, but it is not loaded by default, and even the instructions in it seem to discourage its use for security reasons.) Also remove the few vim config lines that were left. We should either have them on all files, or none. Also remove some strange stuff like '#!/bin/env bash', yikes.
* test: parallelize tasks in TEST-24-UNIT-TESTSFrantisek Sumsal2019-03-062-22/+77
|
* test: add TEST-24-UNIT-TESTS running all basic tests under containersYu Watanabe2018-10-093-0/+141