From 1d5b4317cd0140c043495f946e5352b188f3bec0 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 18 Sep 2024 15:38:43 +0200 Subject: [PATCH 1/3] ci: Don't add testuser to wheel and systemd-journal groups This breaks TEST-74-AUX-UTILS when run in a VM as the user gets access to journal files that the test expects it can't access. --- mkosi.postinst.chroot | 7 ------- 1 file changed, 7 deletions(-) diff --git a/mkosi.postinst.chroot b/mkosi.postinst.chroot index 1809a302bc..0d0eab93d2 100755 --- a/mkosi.postinst.chroot +++ b/mkosi.postinst.chroot @@ -3,18 +3,11 @@ set -e set -o nounset -if [[ "$DISTRIBUTION" =~ ubuntu|debian ]]; then - SUDO_GROUP=sudo -else - SUDO_GROUP=wheel -fi - useradd \ --uid 4711 \ --user-group \ --create-home \ --password "$(openssl passwd -1 testuser)" \ - --groups "$SUDO_GROUP",systemd-journal \ --shell /bin/bash \ testuser From 2bcc2a89f3b52cb98e81c4ec1af82600919e2d7d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 19 Sep 2024 08:43:51 +0900 Subject: [PATCH 2/3] test: create .netdev file at last Previously, when the test ran on mkosi, then networkd was not masked, and might be already started. In that case, the interface test2 would be created soon after the .netdev file is created, and the .link file would not be applied to the interface. Hence, the later test case for 'networkctl cat @test2:link' would fail. This make networkd always started at the beginning of the test, and .netdev file created after .link file is created. So, .link file is always applied to the interface created by the .netdev file. --- test/units/TEST-74-AUX-UTILS.networkctl.sh | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/test/units/TEST-74-AUX-UTILS.networkctl.sh b/test/units/TEST-74-AUX-UTILS.networkctl.sh index 0576d6c055..3d402a7182 100755 --- a/test/units/TEST-74-AUX-UTILS.networkctl.sh +++ b/test/units/TEST-74-AUX-UTILS.networkctl.sh @@ -21,6 +21,9 @@ at_exit() { trap at_exit EXIT +systemctl unmask systemd-networkd.service +systemctl start systemd-networkd.service + export NETWORK_NAME="10-networkctl-test-$RANDOM.network" export NETDEV_NAME="10-networkctl-test-$RANDOM.netdev" export LINK_NAME="10-networkctl-test-$RANDOM.link" @@ -75,15 +78,6 @@ cmp "+4" "/etc/systemd/network/${NETWORK_NAME}.d/test.conf" networkctl cat "$NETWORK_NAME" | grep '^# ' | cmp - <(printf '%s\n' "# /etc/systemd/network/$NETWORK_NAME" "# /etc/systemd/network/${NETWORK_NAME}.d/test.conf") -networkctl edit --stdin --runtime "$NETDEV_NAME" <"/usr/lib/systemd/network/$LINK_NAME" < Date: Wed, 18 Sep 2024 15:53:33 +0200 Subject: [PATCH 3/3] test: Run TEST-74-AUX-UTILS in virtual machine Various tests skip themselves when running in a container so make sure the test runs in a virtual machine so we get full coverage. --- test/TEST-74-AUX-UTILS/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/test/TEST-74-AUX-UTILS/meson.build b/test/TEST-74-AUX-UTILS/meson.build index 43a733ee64..668ad492ca 100644 --- a/test/TEST-74-AUX-UTILS/meson.build +++ b/test/TEST-74-AUX-UTILS/meson.build @@ -4,5 +4,6 @@ integration_tests += [ integration_test_template + { 'name' : fs.name(meson.current_source_dir()), 'storage': 'persistent', + 'vm' : true, }, ]