summaryrefslogtreecommitdiffhomepage
path: root/test/e2e/integration_test.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2020-08-06 18:13:55 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-06 18:16:21 -0700
commitf20e63e31b56784c596897e86f03441f9d05f567 (patch)
tree99139042eb7d7caeaa0dfcc866a303b14aa8e42c /test/e2e/integration_test.go
parent90021e775a6e8059ea4f4262a16c4f962d3b9732 (diff)
Add LinkAt support to gofer
Updates #1198 PiperOrigin-RevId: 325350818
Diffstat (limited to 'test/e2e/integration_test.go')
-rw-r--r--test/e2e/integration_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/e2e/integration_test.go b/test/e2e/integration_test.go
index 6fe6d304f..71ec4791e 100644
--- a/test/e2e/integration_test.go
+++ b/test/e2e/integration_test.go
@@ -467,6 +467,24 @@ func TestHostOverlayfsRewindDir(t *testing.T) {
}
}
+// Basic test for linkat(2). Syscall tests requires CAP_DAC_READ_SEARCH and it
+// cannot use tricks like userns as root. For this reason, run a basic link test
+// to ensure some coverage.
+func TestLink(t *testing.T) {
+ ctx := context.Background()
+ d := dockerutil.MakeContainer(ctx, t)
+ defer d.CleanUp(ctx)
+
+ if got, err := d.Run(ctx, dockerutil.RunOpts{
+ Image: "basic/linktest",
+ WorkDir: "/root",
+ }, "./link_test"); err != nil {
+ t.Fatalf("docker run failed: %v", err)
+ } else if got != "" {
+ t.Errorf("test failed:\n%s", got)
+ }
+}
+
func TestMain(m *testing.M) {
dockerutil.EnsureSupportedDockerVersion()
flag.Parse()