hwdb: fix screen rotation for EXO Wings 2in1 w1125 (#36283)
[systemd.io.git] / test / units / TEST-19-CGROUP.keyed-properties.sh
blobcadefe26d5f4362773be60a75b8ac5f9d7bab85d
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -ex
4 set -o pipefail
6 # shellcheck source=test/units/test-control.sh
7 . "$(dirname "$0")"/test-control.sh
8 # shellcheck source=test/units/util.sh
9 . "$(dirname "$0")"/util.sh
11 if [[ "$(get_cgroup_hierarchy)" != unified ]]; then
12 echo "Skipping $0 as we're not running with the unified cgroup hierarchy"
13 exit 0
16 testcase_iodevice_dbus () {
17 # Test that per-device properties are applied in configured order even for different devices (because
18 # they may resolve to same underlying device in the end
19 # Note: if device does not exist cgroup attribute write fails but systemd should still track the
20 # configured properties
21 systemd-run --unit=test0.service \
22 --property="IOAccounting=yes" \
23 sleep inf
25 systemctl set-property test0.service \
26 IOReadBandwidthMax="/dev/sda1 1M" \
27 IOReadBandwidthMax="/dev/sda2 2M" \
28 IOReadBandwidthMax="/dev/sda3 4M"
30 local output
31 output=$(mktemp)
32 trap 'rm -f "$output"' RETURN
33 systemctl show -P IOReadBandwidthMax test0.service >"$output"
34 diff -u "$output" - <<EOF
35 /dev/sda1 1000000
36 /dev/sda2 2000000
37 /dev/sda3 4000000
38 EOF
40 systemctl stop test0.service
43 testcase_iodevice_unitfile () {
44 cat >/run/systemd/system/test1.service <<EOF
45 [Service]
46 ExecStart=/usr/bin/sleep inf
47 IOReadBandwidthMax=/dev/sda1 1M
48 IOReadBandwidthMax=/dev/sda2 2M
49 IOReadBandwidthMax=/dev/sda3 4M
50 EOF
51 systemctl daemon-reload
53 local output
54 output=$(mktemp)
55 trap 'rm -f "$output"' RETURN
56 systemctl show -P IOReadBandwidthMax test1.service >"$output"
57 diff -u "$output" - <<EOF
58 /dev/sda1 1000000
59 /dev/sda2 2000000
60 /dev/sda3 4000000
61 EOF
62 rm -f /run/systemd/system/test1.service
65 run_testcases