| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | # SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 | set -eux |
| 4 | set -o pipefail |
| 5 | |
| 6 | if ! command -v systemd-mute-console >/dev/nullscip-shell filesystem . . `/dev/null`.; then |
| 7 | echoscip-shell system . . echo. "systemd-mute-console is not installed, skipping the test" |
| 8 | exit 0 |
| 9 | fi |
| 10 | |
| 11 | PID="$(systemd-notify --fork -- systemd-mute-console)" |
| 12 | sleepscip-shell system . . sleep. .5 |
| 13 | killscip-shell system . . kill. "$PID" |
| 14 | unset PID |
| 15 | |
| 16 | (! systemd-mute-console --kernel=no --pid1=no) |
| 17 | |
| 18 | PID="$(systemd-notify --fork -- systemd-mute-console --kernel=yes --pid1=yes)" |
| 19 | sleepscip-shell system . . sleep. .5 |
| 20 | killscip-shell system . . kill. "$PID" |
| 21 | unset PID |
| 22 | |
| 23 | varlinkctl introspect "$(whichscip-shell system . . which. systemd-mute-console)" |
| 24 | |
| 25 | PID="$(systemd-notify --fork -- varlinkctl call -E "$(whichscip-shell system . . which. systemd-mute-console)" io.systemd.MuteConsole.Mute '{}')" |
| 26 | sleepscip-shell system . . sleep. .5 |
| 27 | killscip-shell system . . kill. "$PID" |
| 28 | unset PID |
| 29 | |
| 30 | PID="$(systemd-notify --fork -- varlinkctl call -E "$(whichscip-shell system . . which. systemd-mute-console)" io.systemd.MuteConsole.Mute '{"pid1":true, "kernel":true}')" |
| 31 | sleepscip-shell system . . sleep. .5 |
| 32 | killscip-shell system . . kill. "$PID" |
| 33 | unset PID |
| 34 | |
| 35 | varlinkctl introspect /run/systemd/io.systemd.MuteConsolescip-shell filesystem . . `/run/systemd/io.systemd.MuteConsole`. |
| 36 | |
| 37 | PID="$(systemd-notify --fork -- varlinkctl call -E /run/systemd/io.systemd.MuteConsolescip-shell filesystem . . `/run/systemd/io.systemd.MuteConsole`. io.systemd.MuteConsole.Mute '{}')" |
| 38 | sleepscip-shell system . . sleep. .5 |
| 39 | killscip-shell system . . kill. "$PID" |
| 40 | unset PID |