system_unittest: Fix on Android.

Some system unit tests were failing on Android:
-get_temp_path() was failing because it was trying to call mkstemp() on
a RO file. This happens because tests are usually run with 'adb shell',
and in that case CWD is /, which is RO.
--Fix by using /data/local/tmp on Android.

-setup_mount_destination() was failing because /etc/passwd doesn't
exist.
--Fix by using /etc/hosts.

-setup_mount_destination() was failing to fail because almost all user
IDs are valid. Fix by skipping that check on Android.

https://blackbox.googleplex.com/#/custom/apct/testcase/git_master/continuous_native_tests/6/mj_system_unittest_gtest.mkdir_p%23create_tree
https://blackbox.googleplex.com/#/custom/apct/testcase/git_master/continuous_native_tests/6/mj_system_unittest_gtest.setup_mount_destination%23create_bind_dir
https://blackbox.googleplex.com/#/custom/apct/testcase/git_master/continuous_native_tests/6/mj_system_unittest_gtest.setup_mount_destination%23create_bind_file
https://blackbox.googleplex.com/#/custom/apct/testcase/git_master/continuous_native_tests/6/mj_system_unittest_gtest.setup_mount_destination%23create_char_dev
https://blackbox.googleplex.com/#/custom/apct/testcase/git_master/continuous_native_tests/6/mj_system_unittest_gtest.setup_mount_destination%23create_pseudo_fs
https://blackbox.googleplex.com/#/custom/apct/testcase/git_master/continuous_native_tests/6/mj_system_unittest_gtest.write_pid_to_path%23basic

Bug: None
Test: Passes on HiKey, passes on Linux.
Change-Id: I685eedcad9c01a17fb3141ff2d95dc2d99284ee1
1 file changed