History log of /system/connectivity/shill/process_manager_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c0cb425746bbf1fadb421f93a3ba248e1903f127 16-Oct-2015 Samuel Tan <samueltan@google.com> shill: call DropRoot() on Android

Since libminijail now supports a non-LD_PRELOAD version of
its minijail_run_pid_pipes() API function, libminijail's
DropRoot() function should now work properly. Call this
function in ProcessManager on Android and restore the
corresponding expecatations in unit tests.

BUG: 25083940
TEST: dhcpcd-6.8.2 runs as expected as the dhcp user during weaved setup
in a brillo build.

Change-Id: I0e6fa43cc1745990862b651e5fd4fffbbfc9134c
/system/connectivity/shill/process_manager_unittest.cc
03e6719bae1e0903d94853b896673a033196bcf5 13-Oct-2015 Alex Vakulenko <avakulenko@google.com> shill: Rename "chromeos" -> "brillo" in include paths and namespaces

libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.

Bug: 24872993
TEST=built for aosp and brillo, all unit tests pass on dragonboard

Change-Id: I804311e49ee780ca96e05f6a581e8c95709d4e1d
/system/connectivity/shill/process_manager_unittest.cc
b4b506bbefd27c930171647afa11c73e010ac989 07-Oct-2015 Samuel Tan <samueltan@google.com> shill: remove DropRoot and UseCapabilities unittest expectations in Android

Currently, when we build for Android, we do not call DropRoot and
UseCapabilities in ProcessManager::StartProcessInMinijailWithPipes
since they do not work on Android yet. Account for this by removing
expectations for these two function calls from
process_manager_unittest.cc when we build for Android.

BUG: 24705085
Change-Id: I32f468d4fb0ee46a18f5f4cb4d810323264367ca
TEST: shill unittests pass in Android and Chrome OS.
/system/connectivity/shill/process_manager_unittest.cc
5ecc8d0e9eccb1bdc75bc54f0711751be5b1d57b 19-Sep-2015 mukesh agrawal <quiche@google.com> shill: ProcessManager: add StartProcessInMinjailWithPipes()

To migrate CryptoUtilProxy to ProcessManager, we need
ProcessManager to provide a method for forking a child
with pipes back to us.

Make it so.

While there: rename the |from_here| paramater to
|spawn_source|. I found it confusing to pass |from_here|
through to another function. (The name suggests that
we're passing the current location, rather than the
original location.)

Bug: None
BUG=chromium:533598
TEST=unit tests

Change-Id: Id89371d8700b693afed05be61e6913a1d0a496d4
/system/connectivity/shill/process_manager_unittest.cc
1268ce808b0bd506ef5366a3f32e173e8086a0fa 19-Sep-2015 mukesh agrawal <quiche@google.com> shill: ProcessManager: check result of DropRoot()

When spawning a process in minijail, check if DropRoot()
succeeded. If not, don't run the child process. Update
tests accordingly.

This is primarily for parity with existing code. More
specifically:
- We want to migrate CryptoUtilProxy to use
ProcessManager::StartProcessInMinijail().
- CryptoUtilProxy calls DropRoot() on the minijail,
and fails if DropRoot() fails.
-> StartProcessInMinijail() should check the return value
of DropRoot() as well.

Bug: None
BUG=chromium:533596
TEST=unit tests

Change-Id: I70eaf43403f2612daa26d3675687ce2e02e92763
/system/connectivity/shill/process_manager_unittest.cc
fd8a18d20f747ac0f912d2daf12fd5a2659c6674 19-Sep-2015 mukesh agrawal <quiche@google.com> shill: ProcessManager: add UpdateExitCallback

We want to migrate CryptoUtilProxy and OpenVPNDriver
from ProcessKiller to ProcessManager. There a hitch,
though.

Both classes use ProcessKiller with an exit callback.
And both classes want child exit to be handled differently
in this case, than before they've sent the kill signal.

To meet this need, we add UpdateExitCallback to
ProcessManager. With this new method, CryptoUtilProxy
and OpenVPNDriver will be able to retain their existing
behavior as follows:

process_manager_->UpdateExitCallback(
pid, base::Bind(HandleChildDeath));
process_manager_->StopProcess(pid);

Bug: None
BUG=chromium:533594
TEST=unit tests

Change-Id: I3452c30088917b79311a3b3356bd7135a961be26
/system/connectivity/shill/process_manager_unittest.cc
c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5 03-Sep-2015 Peter Qiu <zqiu@google.com> License shill to Apache2

This patch automatically replaced the license on all text files from
Chromium OS (BSD style) to AOSP (Apache2), keeping the original year as
a reference.

The license header was added to .gyp and .gypi, the NOTICE was added with a copy
of the Apache2 license and MODULE_LICENSE_* file was added.

BUG=23587594
TEST=grep 'Chromium OS Authors' doesn't find anything.

Change-Id: If41ede586c2465f5831fb7fee270ff41dbfdb596
/system/connectivity/shill/process_manager_unittest.cc
1658004ebbb954b71ccf9925dcdce609a5611c59 06-Aug-2015 Peter Qiu <zqiu@chromium.org> shill: ProcessManager: start process in minijail

Add support for starting a process in a minijail. This is needed
for sandboxing dhcpcd processes.

BUG=chromium:516841
TEST=USE="asan clang" FEATURES=test emerge-$BOARD shill

Change-Id: I5343f5aa9c3751ee7b4f41dc26397d7ad79ee4df
Reviewed-on: https://chromium-review.googlesource.com/291091
Trybot-Ready: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
/system/connectivity/shill/process_manager_unittest.cc
177462644d4925111fe3414d93970a2356d65813 05-Aug-2015 Peter Qiu <zqiu@chromium.org> shill: process management using libchromeos's process library

This provides APIs for process creation and asynchronous process
termination.

Exit callback will not be invoked when the caller initiates the process
termination. In this case, the caller is not interested in the
exit callback anymore and the callback might've been cleanup by the caller
by the time the process terminates.

When terminating a process, ProcessManager will attempt to send a
SIGTERM signal to the process first, and then attempt SIGKILL signal
if it doesn't terminate within certain timeout. If the process
failed to terminate with both attempts, an error message will be logged,
and we will give up on terminating that process.

BUG=chromium:516841
TEST=USE="asan clang" FEATURES=test emerge-$BOARD shill

Change-Id: Iae201c1f8d0c86a96af71befb2c35b195b900dbb
Reviewed-on: https://chromium-review.googlesource.com/290652
Reviewed-by: Zeping Qiu <zqiu@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
/system/connectivity/shill/process_manager_unittest.cc