test/udev-test: gracefully exit when imports fail v239-44
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 17 Nov 2020 16:13:31 +0000 (17:13 +0100)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Mon, 25 Jan 2021 14:05:18 +0000 (15:05 +0100)
commit2e50a00f6930f1c65ca804b78f4a853e2ae2d2c0
treedbcdd441d6df901ea0df286fcb141acd9f8d1b35
parente0cee95e0cc401ce120a1b56cdb7a8b9afbd6bcf
test/udev-test: gracefully exit when imports fail

In Fedora rawhide various perl modules are now available as separate
packages that are not pulled in by dependencies. If we don't have some
package, skip the tests.

This ugly code is apparently the way to do conditional imports:
https://www.cs.ait.ac.th/~on/O/oreilly/perl/cookbook/ch12_03.htm.

(cherry picked from commit d40763838278246e2073d15ca927ee700e583afc)

Related: #1642728
test/udev-test.pl