diff options
author | Fabricio Voznika <fvoznika@google.com> | 2019-08-27 10:46:06 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-08-27 10:47:16 -0700 |
commit | c39564332bdd5030b9031ed3b1a428464fea670e (patch) | |
tree | 3f0f8b8a9b160d24470c4d85f43f4876e139cb9d /runsc/boot/user_test.go | |
parent | b4cdaef4a1d545867d8e34036c5ed3175e55079d (diff) |
Mount volumes as super user
This used to be the case, but regressed after a recent change.
Also made a few fixes around it and clean up the code a bit.
Closes #720
PiperOrigin-RevId: 265717496
Diffstat (limited to 'runsc/boot/user_test.go')
-rw-r--r-- | runsc/boot/user_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runsc/boot/user_test.go b/runsc/boot/user_test.go index 01f666507..906baf3e5 100644 --- a/runsc/boot/user_test.go +++ b/runsc/boot/user_test.go @@ -164,13 +164,13 @@ func TestGetExecUserHome(t *testing.T) { }, } - var mns *fs.MountNamespace - setMountNS := func(m *fs.MountNamespace) { - mns = m - ctx.(*contexttest.TestContext).RegisterValue(fs.CtxRoot, mns.Root()) - } mntr := newContainerMounter(spec, []int{sandEnd}, nil, &podMountHints{}) - if err := mntr.setupRootContainer(ctx, ctx, conf, setMountNS); err != nil { + mns, err := mntr.createMountNamespace(ctx, conf) + if err != nil { + t.Fatalf("failed to create mount namespace: %v", err) + } + ctx = fs.WithRoot(ctx, mns.Root()) + if err := mntr.mountSubmounts(ctx, conf, mns); err != nil { t.Fatalf("failed to create mount namespace: %v", err) } |