Run the console test with /dev/null

The availability of /dev/console varies across different devices and
even across different build variants (ex: userdebug/user). Instead of
relying on the device-specific condition, use the /dev/null as the
console device for the test.

Bug: 262090304
Test: atest CtsInitTestCases on raven-user
Change-Id: I3b12d66e94609328dfdd6f640d1adb88a773fa38
This commit is contained in:
Jiyong Park 2022-12-15 16:29:01 +09:00
parent 6dfeccf9c8
commit ae412804ca

View file

@ -194,13 +194,10 @@ service A something
}
TEST(init, StartConsole) {
if (access("/dev/console", F_OK) < 0) {
GTEST_SKIP() << "/dev/console not found";
}
std::string init_script = R"init(
service console /system/bin/sh
class core
console console
console null
disabled
user root
group root shell log readproc