test: don't preload libasan for systemd-remount-fs.service
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 9 May 2019 17:20:34 +0000 (19:20 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 9 May 2019 18:11:20 +0000 (20:11 +0200)
commitaaef1ed21d81f3f90bf2deb5faa4bcdb0a3f6130
treea28dc4b7637786510215b24bd2f892aceb451b83
parentda35a1c9fc94d9803d48332371033baca581de70
test: don't preload libasan for systemd-remount-fs.service

The `mount` utility has an unexpected behavior when run with libasan,
causing false-positives during the integration testing.

For example, on Arch Linux with LD_PRELOAD pointing to libasan:
```
bash-5.0# mount -o remount,rw -v /
mount: /dev/sda1 mounted on /.
bash-5.0# echo $?
1
```
However:
```
bash-5.0# LD_PRELOAD= mount -o remount,rw -v /
mount: /dev/sda1 mounted on /.
bash-5.0# echo $?
0
```
Further investigation with strace shows a LeakSanitizer error:
```
bash-5.0# strace -s 512 mount -o remount,rw -v /
...
write(2, "==355==LeakSanitizer has encountered a fatal error.\n", 52) = -1 EBADF (Bad file descriptor)
write(2, "ReportFile::Write() can't output requested buffer!\n", 51) = -1 EBADF (Bad file descriptor)
exit_group(1)                           = ?
+++ exited with 1 +++
```

Let's workaround this by clearing the LD_PRELOAD variable for
systemd-remount-fs.service
test/test-functions