From 5b23cef0bb3ca62c2c878fbf2f2bfd497b16b4bc Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 25 Apr 2016 12:00:11 -0400 Subject: tests: specify format=raw for qemu to avoid warning WARNING: Image format was not specified for '/var/tmp/systemd-test.tGi3od/rootdisk.img' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. Also use unsafe caching mode, we don't care about data integrity here. --- test/test-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index b07c500339..9e9f2953cb 100644 --- a/test/test-functions +++ b/test/test-functions @@ -79,6 +79,7 @@ $KERNEL_APPEND \ -m 512M \ -nographic \ -kernel $KERNEL_BIN \ +-drive format=raw,cache=unsafe,file=${TESTDIR}/rootdisk.img \ " if [[ "$INITRD" && "$SKIP_INITRD" != "yes" ]]; then @@ -93,7 +94,7 @@ $KERNEL_APPEND \ QEMU_BIN="timeout --foreground $QEMU_TIMEOUT $QEMU_BIN" fi ( set -x - $QEMU_BIN $QEMU_OPTIONS -append "$KERNEL_APPEND" $TESTDIR/rootdisk.img ) || return 1 + $QEMU_BIN $QEMU_OPTIONS -append "$KERNEL_APPEND" ) || return 1 } run_nspawn() { -- cgit v1.2.3-54-g00ecf From ed1190498f977f5dd2287b1e4db356147196ced5 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 25 Apr 2016 13:01:25 -0400 Subject: tree-wide: remove uses of --failed It has been replaced by --state=failed. --- shell-completion/bash/systemctl.in | 2 +- shell-completion/zsh/_systemctl.in | 3 +-- test/TEST-01-BASIC/test.sh | 2 +- test/TEST-02-CRYPTSETUP/test.sh | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in index ef7dc6285a..6f2b3f122c 100644 --- a/shell-completion/bash/systemctl.in +++ b/shell-completion/bash/systemctl.in @@ -96,7 +96,7 @@ _systemctl () { local i verb comps mode local -A OPTS=( - [STANDALONE]='--all -a --reverse --after --before --defaults --failed --force -f --full -l --global + [STANDALONE]='--all -a --reverse --after --before --defaults --force -f --full -l --global --help -h --no-ask-password --no-block --no-legend --no-pager --no-reload --no-wall --quiet -q --privileged -P --system --user --version --runtime --recursive -r --firmware-setup --show-types -i --ignore-inhibitors --plain' diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in index 667243eb53..44c31b7833 100644 --- a/shell-completion/zsh/_systemctl.in +++ b/shell-completion/zsh/_systemctl.in @@ -156,7 +156,7 @@ _systemctl_restartable_units(){ { while read -r a b; do echo -E - " $a"; done; } )) ) } -_systemctl_failed_units() {_sys_failed_units=( ${${(f)"$(__systemctl list-units --failed)"}%% *} ) } +_systemctl_failed_units() {_sys_failed_units=( ${${(f)"$(__systemctl list-units --state=failed)"}%% *} ) } _systemctl_unit_state() { typeset -gA _sys_unit_state; _sys_unit_state=( $(__systemctl list-unit-files) ) } local fun @@ -364,7 +364,6 @@ _arguments -s \ '--reverse[Show reverse dependencies]' \ '--after[Show units ordered after]' \ '--before[Show units ordered before]' \ - '--failed[Show only failed units]' \ {-l,--full}"[Don't ellipsize unit names on output]" \ '--show-types[When showing sockets, show socket type]' \ {-i,--ignore-inhibitors}'[When executing a job, ignore jobs dependencies]' \ diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index 6963d8c88d..21eed9b22a 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -53,7 +53,7 @@ Description=Testsuite service After=multi-user.target [Service] -ExecStart=/bin/sh -x -c 'systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok' +ExecStart=/bin/sh -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; echo OK > /testok' Type=oneshot EOF diff --git a/test/TEST-02-CRYPTSETUP/test.sh b/test/TEST-02-CRYPTSETUP/test.sh index 242090c761..aea0fc53f6 100755 --- a/test/TEST-02-CRYPTSETUP/test.sh +++ b/test/TEST-02-CRYPTSETUP/test.sh @@ -59,7 +59,7 @@ Description=Testsuite service After=multi-user.target [Service] -ExecStart=/bin/sh -x -c 'systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok' +ExecStart=/bin/sh -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; echo OK > /testok' Type=oneshot EOF -- cgit v1.2.3-54-g00ecf From e14b866bc15f30ea88fc084050e1963bb6312f72 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 25 Apr 2016 14:03:27 -0400 Subject: tests: allow root to login with empty password to test images --- test/test-functions | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/test-functions b/test/test-functions index 9e9f2953cb..be954d0fe8 100644 --- a/test/test-functions +++ b/test/test-functions @@ -416,6 +416,9 @@ install_pam() { [[ "$LOOKS_LIKE_DEBIAN" ]] && cp /etc/pam.d/systemd-user $initdir/etc/pam.d/ + + # set empty root password for easy debugging + sed -i 's/^root:x:/root::/' $initdir/etc/passwd } install_keymaps() { -- cgit v1.2.3-54-g00ecf From 61b480b68bdfff8c88800149a035c281b7bbbc71 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 25 Apr 2016 14:20:57 -0400 Subject: tests: enable logging for pid1, disable for other systemd services systemd-udev generated an insane amount of log output at debug level. It would break TEST-02-CRYPTSETUP by filling the overflowing the disk (which seems to be a bug in itself!). --- test/test-functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index be954d0fe8..e2e07a833c 100644 --- a/test/test-functions +++ b/test/test-functions @@ -64,7 +64,6 @@ run_qemu() { find_qemu_bin || return 1 KERNEL_APPEND="root=/dev/sda1 \ -systemd.log_level=debug \ raid=noautodetect \ loglevel=2 \ init=$ROOTLIBDIR/systemd \ @@ -245,6 +244,9 @@ install_systemd() { # we strip binaries since debug symbols increase binaries size a lot # and it could fill the available space strip_binaries + + # enable debug logging in PID1 + echo LogLevel=debug >> $initdir/etc/systemd/system.conf } install_missing_libraries() { -- cgit v1.2.3-54-g00ecf From 62a992bed989cd65a873373af7ab0f2e7de61114 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sun, 8 May 2016 11:08:42 -0400 Subject: TEST-08: make sure / is remounted rw In this test /etc/fstab is replaced by -.mount unit. This causes systemd-remount-fs.service to not remount / rw, which in turn causes various failures becuase /var is not writable. In particular systemd-tmpfiles-setup.service reports many failures. This is something to possibly fix on its own (see https://github.com/systemd/systemd/issues/791); in the meanwhile let's fix this test so that it doesn't fail, since the point of the test is to check aliases on mount units, and not a ro root. --- test/TEST-08-ISSUE-2730/test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/TEST-08-ISSUE-2730/test.sh b/test/TEST-08-ISSUE-2730/test.sh index 92e70b828b..409140157a 100755 --- a/test/TEST-08-ISSUE-2730/test.sh +++ b/test/TEST-08-ISSUE-2730/test.sh @@ -65,6 +65,20 @@ Options=errors=remount-ro,noatime [Install] WantedBy=local-fs.target Alias=root.mount +EOF + + cat >$initdir/etc/systemd/system/systemd-remount-fs.service <