mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
test: drop whitespace after shell redirection operators
(The one case that is left unchanged is '< <(subcommand)'.) This way, the style with no gap was already dominant. This way, the reader immediately knows that ' < ' is a comparison operator and ' << ' is a shift. In a few cases, replace custom EOF replacement by just EOF. There is no point in using someting like "_EOL" unless "EOF" appears in the text.
This commit is contained in:
2
.github/workflows/gather-pr-metadata.yml
vendored
2
.github/workflows/gather-pr-metadata.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
||||
- name: Store PR number in file
|
||||
run: |
|
||||
mkdir -p ./${{ env.PULL_REQUEST_METADATA_DIR }}
|
||||
echo ${{ github.event.number }} > ./${{ env.PULL_REQUEST_METADATA_DIR }}/${{ env.PULL_REQUEST_METADATA_FILE }}
|
||||
echo ${{ github.event.number }} >./${{ env.PULL_REQUEST_METADATA_DIR }}/${{ env.PULL_REQUEST_METADATA_FILE }}
|
||||
|
||||
- name: Upload Pull Request Metadata artifact
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
|
||||
|
||||
@@ -28,14 +28,14 @@ create_container() {
|
||||
|
||||
# enable source repositories so that apt-get build-dep works
|
||||
sudo lxc-attach -n "$CONTAINER" -- sh -ex <<EOF
|
||||
sed 's/^deb/deb-src/' /etc/apt/sources.list >> /etc/apt/sources.list.d/sources.list
|
||||
sed 's/^deb/deb-src/' /etc/apt/sources.list >>/etc/apt/sources.list.d/sources.list
|
||||
# We might attach the console too soon
|
||||
while ! systemctl --quiet --wait is-system-running; do sleep 1; done
|
||||
# Manpages database trigger takes a lot of time and is not useful in a CI
|
||||
echo 'man-db man-db/auto-update boolean false' | debconf-set-selections
|
||||
# Speed up dpkg, image is thrown away after the test
|
||||
mkdir -p /etc/dpkg/dpkg.cfg.d/
|
||||
echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/unsafe_io
|
||||
echo 'force-unsafe-io' >/etc/dpkg/dpkg.cfg.d/unsafe_io
|
||||
# For some reason, it is necessary to run this manually or the interface won't be configured
|
||||
# Note that we avoid networkd, as some of the tests will break it later on
|
||||
dhclient
|
||||
@@ -74,7 +74,7 @@ for phase in "${PHASES[@]}"; do
|
||||
|
||||
# craft changelog
|
||||
UPSTREAM_VER="$(git describe | sed 's/^v//;s/-/./g')"
|
||||
cat << EOF > debian/changelog.new
|
||||
cat <<EOF >debian/changelog.new
|
||||
systemd (${UPSTREAM_VER}.0) UNRELEASED; urgency=low
|
||||
|
||||
* Automatic build for upstream test
|
||||
@@ -92,7 +92,7 @@ EOF
|
||||
# enable more unit tests
|
||||
sed -i '/^CONFFLAGS =/ s/=/= --werror -Dtests=unsafe -Dsplit-usr=true -Dslow-tests=true -Dfuzz-tests=true -Dman=true /' debian/rules
|
||||
# no orig tarball
|
||||
echo '1.0' > debian/source/format
|
||||
echo '1.0' >debian/source/format
|
||||
|
||||
# build source package
|
||||
dpkg-buildpackage -S -I -I"$(basename "$CACHE_DIR")" -d -us -uc -nc
|
||||
|
||||
@@ -206,7 +206,7 @@ achieve this, create a script with the following contents in systemd's project d
|
||||
|
||||
```sh
|
||||
#!/usr/bin/env sh
|
||||
tee mkosi-clangd.build > /dev/null << EOF
|
||||
tee mkosi-clangd.build >/dev/null <<EOF
|
||||
#!/usr/bin/env sh
|
||||
exec clangd \\
|
||||
--compile-commands-dir=/root/build \\
|
||||
|
||||
@@ -9,4 +9,4 @@ sudo /usr/lib/systemd/systemd-cryptsetup attach mytest /dev/sdXn - fido2-device=
|
||||
|
||||
# If that worked, let's now add the same line persistently to /etc/crypttab,
|
||||
# for the future.
|
||||
sudo bash -c 'echo "mytest /dev/sdXn - fido2-device=auto" >> /etc/crypttab'
|
||||
sudo bash -c 'echo "mytest /dev/sdXn - fido2-device=auto" >>/etc/crypttab'
|
||||
|
||||
@@ -285,17 +285,17 @@ for key in MicWinProPCA2011_2011-10-19.crt MicCorUEFCA2011_2011-06-27.crt MicCor
|
||||
done
|
||||
|
||||
# Optionally add Microsoft Windows Production CA 2011 (needed to boot into Windows).
|
||||
cat MicWinProPCA2011_2011-10-19.esl >> db.esl
|
||||
cat MicWinProPCA2011_2011-10-19.esl >>db.esl
|
||||
|
||||
# Optionally add Microsoft Corporation UEFI CA 2011 for firmware drivers / option ROMs
|
||||
# and third-party boot loaders (including shim). This is highly recommended on real
|
||||
# hardware as not including this may soft-brick your device (see next paragraph).
|
||||
cat MicCorUEFCA2011_2011-06-27.esl >> db.esl
|
||||
cat MicCorUEFCA2011_2011-06-27.esl >>db.esl
|
||||
|
||||
# Optionally add Microsoft Corporation KEK CA 2011. Recommended if either of the
|
||||
# Microsoft keys is used as the official UEFI revocation database is signed with this
|
||||
# key. The revocation database can be updated with <citerefentry><refentrytitle>fwupdmgr</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
|
||||
cat MicCorKEKCA2011_2011-06-24.esl >> KEK.esl
|
||||
cat MicCorKEKCA2011_2011-06-24.esl >>KEK.esl
|
||||
|
||||
attr=NON_VOLATILE,RUNTIME_ACCESS,BOOTSERVICE_ACCESS,TIME_BASED_AUTHENTICATED_WRITE_ACCESS
|
||||
sbvarsign --attr ${attr} --key PK.key --cert PK.crt --output PK.auth PK PK.esl
|
||||
|
||||
@@ -436,7 +436,7 @@ SetCredentialEncrypted=mysql-password: \
|
||||
<filename>xyz.service</filename>:</para>
|
||||
|
||||
<programlisting># mkdir -p /etc/systemd/system/xyz.service.d
|
||||
# systemd-ask-password -n | systemd-creds encrypt --name=mysql-password -p - - > /etc/systemd/system/xyz.service.d/50-password.conf
|
||||
# systemd-ask-password -n | systemd-creds encrypt --name=mysql-password -p - - >/etc/systemd/system/xyz.service.d/50-password.conf
|
||||
# systemctl daemon-reload
|
||||
# systemctl restart xyz.service</programlisting>
|
||||
</example>
|
||||
|
||||
@@ -366,7 +366,7 @@
|
||||
<example>
|
||||
<title>Generate a tarball from an OS disk image</title>
|
||||
|
||||
<programlisting>$ systemd-dissect --with foo.raw tar cz . > foo.tar.gz</programlisting>
|
||||
<programlisting>$ systemd-dissect --with foo.raw tar cz . >foo.tar.gz</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
--bank=sha1 \
|
||||
--bank=sha256 \
|
||||
--private-key=tpm2-pcr-private.pem \
|
||||
--public-key=tpm2-pcr-public.pem > tpm2-pcr-signature.json
|
||||
--public-key=tpm2-pcr-public.pem >tpm2-pcr-signature.json
|
||||
# ukify --output foo.efi \
|
||||
--os-release @os-release.txt \
|
||||
--cmdline @cmdline.txt \
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
to the service processes as-is. If the service runs with different privileges than
|
||||
<command>systemd-run</command>, this means the service might not be able to re-open the passed file
|
||||
descriptors, due to normal file descriptor access restrictions. If the invoked process is a shell script that
|
||||
uses the <command>echo "hello" > /dev/stderr</command> construct for writing messages to stderr, this might
|
||||
uses the <command>echo "hello" >/dev/stderr</command> construct for writing messages to stderr, this might
|
||||
cause problems, as this only works if stderr can be re-opened. To mitigate this use the construct <command>echo
|
||||
"hello" >&2</command> instead, which is mostly equivalent and avoids this pitfall.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -9,4 +9,4 @@ sudo /usr/lib/systemd/systemd-cryptsetup attach mytest /dev/sdXn - tpm2-device=a
|
||||
|
||||
# If that worked, let's now add the same line persistently to /etc/crypttab,
|
||||
# for the future.
|
||||
sudo bash -c 'echo "mytest /dev/sdXn - tpm2-device=auto" >> /etc/crypttab'
|
||||
sudo bash -c 'echo "mytest /dev/sdXn - tpm2-device=auto" >>/etc/crypttab'
|
||||
|
||||
@@ -25,4 +25,4 @@ sudo /usr/lib/systemd/systemd-cryptsetup attach mytest /dev/sdXn - pkcs11-uri=au
|
||||
|
||||
# If that worked, let's now add the same line persistently to /etc/crypttab,
|
||||
# for the future.
|
||||
sudo bash -c 'echo "mytest /dev/sdXn - pkcs11-uri=auto" >> /etc/crypttab'
|
||||
sudo bash -c 'echo "mytest /dev/sdXn - pkcs11-uri=auto" >>/etc/crypttab'
|
||||
|
||||
@@ -17,4 +17,4 @@ _Pragma(\"GCC diagnostic ignored \\\"-Wimplicit-fallthrough\\\"\")\n\
|
||||
|
||||
/^KEY_/ { print tolower(substr($1 ,5)) ", " $1 }
|
||||
{ print tolower($1) ", " $1 }
|
||||
' < "${1:?}"
|
||||
' <"${1:?}"
|
||||
|
||||
@@ -69,7 +69,7 @@ EOF
|
||||
|
||||
# Forward journal messages to the console, so we have something
|
||||
# to investigate even if we fail to mount the encrypted /var
|
||||
echo ForwardToConsole=yes >> "$initdir/etc/systemd/journald.conf"
|
||||
echo ForwardToConsole=yes >>"$initdir/etc/systemd/journald.conf"
|
||||
|
||||
# If $INITRD wasn't provided explicitly, generate a custom one with dm-crypt
|
||||
# support
|
||||
|
||||
@@ -9,8 +9,8 @@ TEST_DESCRIPTION="Openfile tests"
|
||||
|
||||
test_append_files() {
|
||||
local workspace="${1:?}"
|
||||
echo "Open" > "$workspace/test-77-open.dat"
|
||||
echo "File" > "$workspace/test-77-file.dat"
|
||||
echo "Open" >"$workspace/test-77-open.dat"
|
||||
echo "File" >"$workspace/test-77-file.dat"
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -9,7 +9,7 @@ mkdir -p "$DESTDIR"/usr/local/bin
|
||||
cp "$SRCDIR"/test/networkd-test.py "$DESTDIR"/usr/local/bin/networkd-test.py
|
||||
|
||||
mkdir -p "$DESTDIR"/etc/systemd/system
|
||||
cat > "$DESTDIR"/etc/systemd/system/networkd-test.service <<EOF
|
||||
cat >"$DESTDIR"/etc/systemd/system/networkd-test.service <<EOF
|
||||
[Unit]
|
||||
Description=networkd test service
|
||||
SuccessAction=exit
|
||||
|
||||
@@ -36,14 +36,14 @@ class ExecutionResumeTest(unittest.TestCase):
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sleep 3
|
||||
ExecStart=/bin/bash -c "echo foo >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo foo >>{self.output_file}"
|
||||
'''
|
||||
self.unit_files[InstallChange.NO_CHANGE] = unit_file_content
|
||||
|
||||
unit_file_content = f'''
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash -c "echo foo >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo foo >>{self.output_file}"
|
||||
ExecStart=/bin/sleep 3
|
||||
'''
|
||||
self.unit_files[InstallChange.LINES_SWAPPED] = unit_file_content
|
||||
@@ -51,9 +51,9 @@ class ExecutionResumeTest(unittest.TestCase):
|
||||
unit_file_content = f'''
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash -c "echo bar >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo bar >>{self.output_file}"
|
||||
ExecStart=/bin/sleep 3
|
||||
ExecStart=/bin/bash -c "echo foo >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo foo >>{self.output_file}"
|
||||
'''
|
||||
self.unit_files[InstallChange.COMMAND_ADDED_BEFORE] = unit_file_content
|
||||
|
||||
@@ -61,26 +61,26 @@ class ExecutionResumeTest(unittest.TestCase):
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sleep 3
|
||||
ExecStart=/bin/bash -c "echo foo >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo bar >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo foo >>{self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo bar >>{self.output_file}"
|
||||
'''
|
||||
self.unit_files[InstallChange.COMMAND_ADDED_AFTER] = unit_file_content
|
||||
|
||||
unit_file_content = f'''
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash -c "echo baz >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo baz >>{self.output_file}"
|
||||
ExecStart=/bin/sleep 3
|
||||
ExecStart=/bin/bash -c "echo foo >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo bar >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo foo >>{self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo bar >>{self.output_file}"
|
||||
'''
|
||||
self.unit_files[InstallChange.COMMAND_INTERLEAVED] = unit_file_content
|
||||
|
||||
unit_file_content = f'''
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash -c "echo bar >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo baz >> {self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo bar >>{self.output_file}"
|
||||
ExecStart=/bin/bash -c "echo baz >>{self.output_file}"
|
||||
'''
|
||||
self.unit_files[InstallChange.REMOVAL] = unit_file_content
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Description=Test for StandardInputText= and StandardInputData=
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/sh -x -c 'd=$$(mktemp -d -p /tmp); echo -e "this is a test\nand this is more\nsomething encoded!\nsomething in multiple lines\nand some more\nand a more bas64 data\nsomething with strange\nembedded\tcharacters\nand something with a exec-stdin-data.service specifier" > $d/text ; cmp $d/text ; rm -rf $d'
|
||||
ExecStart=/bin/sh -x -c 'd=$$(mktemp -d -p /tmp); echo -e "this is a test\nand this is more\nsomething encoded!\nsomething in multiple lines\nand some more\nand a more bas64 data\nsomething with strange\nembedded\tcharacters\nand something with a exec-stdin-data.service specifier" >$d/text ; cmp $d/text ; rm -rf $d'
|
||||
Type=oneshot
|
||||
StandardInput=data
|
||||
StandardInputText=this is a test
|
||||
|
||||
@@ -691,7 +691,7 @@ EOF
|
||||
#!/bin/bash
|
||||
set -e
|
||||
test -e /usr/lib/os-release
|
||||
echo bar > \${STATE_DIRECTORY}/foo
|
||||
echo bar >\${STATE_DIRECTORY}/foo
|
||||
cat /usr/lib/extension-release.d/extension-release.app0
|
||||
EOF
|
||||
chmod +x "$initdir/opt/script0.sh"
|
||||
@@ -717,7 +717,7 @@ EOF
|
||||
#!/bin/bash
|
||||
set -e
|
||||
test -e /usr/lib/os-release
|
||||
echo baz > \${STATE_DIRECTORY}/foo
|
||||
echo baz >\${STATE_DIRECTORY}/foo
|
||||
cat /usr/lib/extension-release.d/extension-release.app2
|
||||
EOF
|
||||
chmod +x "$initdir/opt/script1.sh"
|
||||
|
||||
@@ -53,11 +53,11 @@ echo "disable $UNIT_NAME" >/run/systemd/system-preset/99-systemd-test.preset
|
||||
EDITOR='true' script -ec 'systemctl edit "$UNIT_NAME"' /dev/null
|
||||
[ ! -e "/etc/systemd/system/$UNIT_NAME.d/override.conf" ]
|
||||
|
||||
printf '%s\n' '[Service]' 'ExecStart=' 'ExecStart=sleep 10d' > "+4"
|
||||
printf '%s\n' '[Service]' 'ExecStart=' 'ExecStart=sleep 10d' >"+4"
|
||||
EDITOR='mv' script -ec 'systemctl edit "$UNIT_NAME"' /dev/null
|
||||
printf '%s\n' '[Service]' 'ExecStart=' 'ExecStart=sleep 10d' | cmp - "/etc/systemd/system/$UNIT_NAME.d/override.conf"
|
||||
|
||||
printf '%b' '[Service]\n' 'ExecStart=\n' 'ExecStart=sleep 10d' > "+4"
|
||||
printf '%b' '[Service]\n' 'ExecStart=\n' 'ExecStart=sleep 10d' >"+4"
|
||||
EDITOR='mv' script -ec 'systemctl edit "$UNIT_NAME"' /dev/null
|
||||
printf '%s\n' '[Service]' 'ExecStart=' 'ExecStart=sleep 10d' | cmp - "/etc/systemd/system/$UNIT_NAME.d/override.conf"
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ mount /usr/share/minimal_0.raw /tmp/rootdir
|
||||
# Fix up os-release to drop the valid PORTABLE_SERVICES field (because we are
|
||||
# bypassing the sysext logic in portabled here it will otherwise not see the
|
||||
# extensions additional valid prefix)
|
||||
grep -v "^PORTABLE_PREFIXES=" /tmp/rootdir/etc/os-release > /tmp/os-release-fix/etc/os-release
|
||||
grep -v "^PORTABLE_PREFIXES=" /tmp/rootdir/etc/os-release >/tmp/os-release-fix/etc/os-release
|
||||
|
||||
mount -t overlay overlay -o lowerdir=/tmp/os-release-fix:/tmp/app1:/tmp/rootdir /tmp/overlay
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user