Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

tests: fix TestNonRootReadInfo when $HOME is only accessible by current user #3580

Merged
merged 1 commit into from
Feb 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/rkt_non_root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ func TestNonRootReadInfo(t *testing.T) {
ctx := testutils.NewRktRunCtx()
defer ctx.Cleanup()

gid, err := common.LookupGid(common.RktGroup)
uid, _ := ctx.GetUidGidRktBinOwnerNotRoot()

rktGid, err := common.LookupGid(common.RktGroup)
if err != nil {
t.Skipf("Skipping the test because there's no %q group", common.RktGroup)
}
Expand Down Expand Up @@ -82,7 +84,7 @@ func TestNonRootReadInfo(t *testing.T) {

imgListCmd := fmt.Sprintf("%s image list", ctx.Cmd())
t.Logf("Running %s", imgListCmd)
runRktAsGidAndCheckOutput(t, imgListCmd, "inspect-", false, gid)
runRktAsUidGidAndCheckOutput(t, imgListCmd, "inspect-", false, uid, rktGid)
}

// TestNonRootFetchRmGCImage tests that non-root users can remove all images but
Expand Down