summaryrefslogtreecommitdiffstats
path: root/test/units/testsuite-17.13.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:42 +0000
commit78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch)
treef515d16b6efd858a9aeb5b0ef5d6f90bf288283d /test/units/testsuite-17.13.sh
parentAdding debian version 255.5-1. (diff)
downloadsystemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz
systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/units/testsuite-17.13.sh')
-rwxr-xr-xtest/units/testsuite-17.13.sh89
1 files changed, 0 insertions, 89 deletions
diff --git a/test/units/testsuite-17.13.sh b/test/units/testsuite-17.13.sh
deleted file mode 100755
index d9dfdd7..0000000
--- a/test/units/testsuite-17.13.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: LGPL-2.1-or-later
-set -ex
-set -o pipefail
-
-# shellcheck source=test/units/util.sh
-. "$(dirname "$0")"/util.sh
-
-# Test for `udevadm control -p`
-
-test_not_property() {
- assert_eq "$(udevadm info --query property --property "$2" --value "$1")" ""
-}
-
-test_property() {
- assert_eq "$(udevadm info --query property --property "$2" --value "$1")" "$3"
-}
-
-# shellcheck disable=SC2317
-cleanup() {
- set +e
-
- udevadm control -p FOO= -p BAR=
-
- rm -f "$rules"
-}
-
-# Set up a test device
-trap cleanup EXIT
-
-rules="/run/udev/rules.d/99-test-17.13.rules"
-
-mkdir -p "${rules%/*}"
-cat > "$rules" <<'EOF'
-ENV{FOO}=="?*", ENV{PROP_FOO}="$env{FOO}"
-ENV{BAR}=="?*", ENV{PROP_BAR}="$env{BAR}"
-EOF
-
-udevadm control --reload
-
-test_not_property /dev/null PROP_FOO
-test_not_property /dev/null PROP_BAR
-
-: Setting of a property works
-
-udevadm control --property FOO=foo
-udevadm trigger --action change --settle /dev/null
-test_property /dev/null PROP_FOO foo
-test_not_property /dev/null PROP_BAR
-
-: Change of a property works
-
-udevadm control --property FOO=goo
-udevadm trigger --action change --settle /dev/null
-test_property /dev/null PROP_FOO goo
-
-: Removal of a property works
-
-udevadm control --property FOO=
-udevadm trigger --action change --settle /dev/null
-test_not_property /dev/null PROP_FOO
-
-: Repeated removal of a property does nothing
-
-udevadm control --property FOO=
-udevadm trigger --action change --settle /dev/null
-test_not_property /dev/null PROP_FOO
-
-: Multiple properties can be set at once
-
-udevadm control --property FOO=foo --property BAR=bar
-udevadm trigger --action change --settle /dev/null
-test_property /dev/null PROP_FOO foo
-test_property /dev/null PROP_BAR bar
-
-: Multiple setting of the same property is handled correctly
-
-udevadm control --property FOO=foo --property FOO=42
-udevadm trigger --action change --settle /dev/null
-test_property /dev/null PROP_FOO 42
-
-: Mix of settings and removals of the same property is handled correctly
-
-udevadm control -p FOO= -p FOO=foo -p BAR=car -p BAR=
-udevadm trigger --action change --settle /dev/null
-test_property /dev/null PROP_FOO foo
-test_not_property /dev/null PROP_BAR
-
-exit 0