Add reboot_test
This test spawns several services backed by /system/bin/yes executable,
and then stops them either while SIGTERM or SIGKILL.
Ideally we want to unit test more of reboot logic, but that requires a
bigger refactoring.
Test: atest CtsInitTestCases
Bug: 170315126
Bug: 174335499
Merged-In: Ife48b1636c6ca2d0aac73f4eb6f4737343a88e7a
Change-Id: Ife48b1636c6ca2d0aac73f4eb6f4737343a88e7a
diff --git a/init/subcontext.cpp b/init/subcontext.cpp
index f1fbffe..fa48bea 100644
--- a/init/subcontext.cpp
+++ b/init/subcontext.cpp
@@ -351,6 +351,9 @@
}
bool SubcontextChildReap(pid_t pid) {
+ if (!subcontext) {
+ return false;
+ }
if (subcontext->pid() == pid) {
if (!subcontext_terminated_by_shutdown) {
subcontext->Restart();