(t *testing.T)
| 2966 | } |
| 2967 | |
| 2968 | func TestRootNotMount(t *testing.T) { |
| 2969 | appSym, err := testutil.FindFile("test/cmd/test_app/test_app") |
| 2970 | if err != nil { |
| 2971 | t.Fatal("error finding test_app:", err) |
| 2972 | } |
| 2973 | |
| 2974 | app, err := filepath.EvalSymlinks(appSym) |
| 2975 | if err != nil { |
| 2976 | t.Fatalf("error resolving %q symlink: %v", appSym, err) |
| 2977 | } |
| 2978 | log.Infof("App path %q is a symlink to %q", appSym, app) |
| 2979 | |
| 2980 | static, err := testutil.IsStatic(app) |
| 2981 | if err != nil { |
| 2982 | t.Fatalf("error reading application binary: %v", err) |
| 2983 | } |
| 2984 | if !static { |
| 2985 | // This happens during race builds; we cannot map in shared |
| 2986 | // libraries also, so we need to skip the test. |
| 2987 | t.Skip() |
| 2988 | } |
| 2989 | |
| 2990 | root := filepath.Dir(app) |
| 2991 | exe := "/" + filepath.Base(app) |
| 2992 | log.Infof("Executing %q in %q", exe, root) |
| 2993 | |
| 2994 | spec := testutil.NewSpecWithArgs(exe, "help") |
| 2995 | spec.Root.Path = root |
| 2996 | spec.Root.Readonly = true |
| 2997 | spec.Mounts = nil |
| 2998 | |
| 2999 | conf := testutil.TestConfig(t) |
| 3000 | if err := run(spec, conf); err != nil { |
| 3001 | t.Fatalf("error running sandbox: %v", err) |
| 3002 | } |
| 3003 | } |
| 3004 | |
| 3005 | func TestUserLog(t *testing.T) { |
| 3006 | app, err := testutil.FindFile("test/cmd/test_app/test_app") |
nothing calls this directly
no test coverage detected
searching dependent graphs…