diff options
author | Fabricio Voznika <fvoznika@google.com> | 2018-10-09 21:06:18 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-10-09 21:07:14 -0700 |
commit | 20508bafb88d2037ea3b2c8483b191ce72e7ad7e (patch) | |
tree | 7713850d594c45cd8e577dc582cb1771c6d4e6de /runsc/test/testutil | |
parent | c36d2ef3733a0619b992f8ddc23b072474b04044 (diff) |
Add tests to verify gofer is chroot'ed
PiperOrigin-RevId: 216472439
Change-Id: Ic4cb86c8e0a9cb022d3ceed9dc5615266c307cf9
Diffstat (limited to 'runsc/test/testutil')
-rw-r--r-- | runsc/test/testutil/docker.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runsc/test/testutil/docker.go b/runsc/test/testutil/docker.go index cf61f2c10..d70b4377a 100644 --- a/runsc/test/testutil/docker.go +++ b/runsc/test/testutil/docker.go @@ -280,6 +280,15 @@ func (d *Docker) SandboxPid() (int, error) { return pid, nil } +// RootDirInHost returns where the root directory is mapped on the host. +func (d *Docker) RootDirInHost() (string, error) { + out, err := do("inspect", "-f={{.GraphDriver.Data.MergedDir}}", d.Name) + if err != nil { + return "", fmt.Errorf("error retrieving pid: %v", err) + } + return strings.TrimSuffix(string(out), "\n"), nil +} + // WaitForOutput calls 'docker logs' to retrieve containers output and searches // for the given pattern. func (d *Docker) WaitForOutput(pattern string, timeout time.Duration) (string, error) { |