#!/usr/bin/env bash # SPDX-License-Identifier: LGPL-2.1-or-later # shellcheck disable=SC2317 set -ex set -o pipefail # This is a reproducer of issue #35329, # which is a regression caused by 405be62f05d76f1845f347737b5972158c79dd3e. IFNAME=udevtestnetif at_exit() { set +e systemctl stop testsleep.service rm -f /run/udev/udev.conf.d/timeout.conf rm -f /run/udev/rules.d/99-testsuite.rules # Forcibly kills sleep command invoked by the udev rule before restarting, # otherwise systemctl restart below will takes longer. killall -KILL sleep systemctl restart systemd-udevd.service ip link del "$IFNAME" } trap at_exit EXIT udevadm settle mkdir -p /run/udev/udev.conf.d/ cat >/run/udev/udev.conf.d/timeout.conf </run/udev/rules.d/99-testsuite.rules <