patchpanel: use System in MinijailedProcessRunner
Also makes unit tests of MinijailedProcessRunner more strictly asserts
arguments and expected calls.
BUG=b:178980566
TEST=Unit tests. Compiled, flashed trogdor, booted, started user
session, checked iptables setup and ARC setup.
Change-Id: I28e365f23cb45f9a2285c77c3d7e7feecdba5f63
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2991802
Tested-by: Hugo Benichi <hugobenichi@google.com>
Commit-Queue: Hugo Benichi <hugobenichi@google.com>
Reviewed-by: Garrick Evans <garrick@chromium.org>
diff --git a/patchpanel/system.h b/patchpanel/system.h
index 011aedb..98cb089 100644
--- a/patchpanel/system.h
+++ b/patchpanel/system.h
@@ -5,11 +5,12 @@
#ifndef PATCHPANEL_SYSTEM_H_
#define PATCHPANEL_SYSTEM_H_
-#include <string>
-
#include <net/if.h>
#include <net/route.h>
#include <sys/ioctl.h>
+#include <sys/types.h>
+
+#include <string>
namespace patchpanel {
@@ -57,6 +58,8 @@
int Ioctl(int fd, ioctl_req_t request, struct ifreq* ifr);
int Ioctl(int fd, ioctl_req_t request, struct rtentry* route);
+ virtual pid_t WaitPid(pid_t pid, int* wstatus, int options = 0);
+
static bool Write(const std::string& path, const std::string& content);
private: