summaryrefslogtreecommitdiffhomepage
path: root/runsc/test/testutil
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-11-07 23:28:37 -0800
committerShentubot <shentubot@google.com>2018-11-07 23:29:48 -0800
commit90e81b2e5c665b9fc149f97dcf15142c190260c6 (patch)
tree3fa27177d77c080e92aa3fd8b23a2d337200e000 /runsc/test/testutil
parentd12a0dd6b8afaca9fbb5fe60fb84a3ae0502261a (diff)
Add test that volume can be mounted on top of a symlink
PiperOrigin-RevId: 220588094 Change-Id: I18915e892ceac86eac1f89ebcadffb4fdf8d0cf6
Diffstat (limited to 'runsc/test/testutil')
-rw-r--r--runsc/test/testutil/crictl.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/runsc/test/testutil/crictl.go b/runsc/test/testutil/crictl.go
index 4f82e8234..84bb4475a 100644
--- a/runsc/test/testutil/crictl.go
+++ b/runsc/test/testutil/crictl.go
@@ -92,6 +92,17 @@ func (cc *Crictl) Stop(contID string) error {
return err
}
+// Exec execs a program inside a container. It corresponds to `crictl exec`.
+func (cc *Crictl) Exec(contID string, args ...string) (string, error) {
+ a := []string{"exec", contID}
+ a = append(a, args...)
+ output, err := cc.run(a...)
+ if err != nil {
+ return "", fmt.Errorf("exec failed: %v", err)
+ }
+ return output, nil
+}
+
// Rm removes a container. It corresponds to `crictl rm`.
func (cc *Crictl) Rm(contID string) error {
_, err := cc.run("rm", contID)