test/udev-test.pl: cleanup if skipping test
authorDan Streetman <ddstreet@canonical.com>
Fri, 5 Jul 2019 15:24:55 +0000 (11:24 -0400)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 9 Jul 2019 05:54:34 +0000 (14:54 +0900)
commitabb9cc50afb3949c442849f43301fb33578f3888
tree31b259d6f3161cbbd22ba7648f6bd1b2c0fb5dcc
parent869250e6b813840f24dac1204745dee37800d25b
test/udev-test.pl: cleanup if skipping test

In Ubuntu CI, udev-test.pl is run from the debian/test/udev script,
in a test dir created for it; but udev-test.pl setup mounts a
dir, so if it doesn't cleanup/unmount before exiting, the test dir
autopkgtest created for it can't be removed, and autopkgtest
aborts the entire test suite, for example this output (from a
test run inside an armhf container):

autopkgtest [12:45:36]: test udev: [-----------------------
umount: test/tmpfs: no mount point specified.
mknod: test/tmpfs/dev/null: Operation not permitted
unable to create test/tmpfs/dev/null at ./udev-test.pl line 1611.
Failed to set up the environment, skipping the test at ./udev-test.pl line 1731.
autopkgtest [12:45:41]: test udev: -----------------------]
autopkgtest [12:45:44]: test udev:  - - - - - - - - - - results - - - - - - - - - -
udev                 FAIL non-zero exit status 77
rm: cannot remove '/tmp/autopkgtest.ocPFA6/autopkgtest_tmp/test/tmpfs': Device or resource busy
autopkgtest [12:46:22]: ERROR: "rm -rf /tmp/autopkgtest.ocPFA6/udev-artifacts /tmp/autopkgtest.ocPFA6/autopkgtest_tmp" failed with stderr "rm:
test/udev-test.pl