Skip pmsg related tests if /dev/pmsg0 is not found

These test use fopen() with append which includes O_CREAT.  If these
tests are run in the 'su' SELinux domain (aka through `adb root`) then
they'll create a blank text file when opening /dev/pmsg0 if it does
not exist.  Other tests and processes will attempt to write to this
file, either succeeding (for 'su' domain processes) and wasting memory,
or failing due to SELinux and generating audits (for typical
processes).

This isn't a problem for user builds, since without `adb root`, the
tests simply fail when pmsg0 does not exist.

Test: no excess denials or /dev/pmsg0 creation when running
      liblog-unit-tests as root
Change-Id: I06e0f308c72db5a53c5f9e4a29bd23f56352c7e2
2 files changed
tree: 24680e9e80a24d7da984665bcf3afdc83c104552
  1. liblog/
  2. logcat/
  3. logd/
  4. logwrapper/