1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Skip some tests requires root uid when run as user

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2018-04-20 11:59:08 +02:00
parent 5d8b88b114
commit a7999aaa53
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3
16 changed files with 75 additions and 33 deletions

View file

@ -12,6 +12,7 @@ import (
"github.com/docker/docker/pkg/system"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/skip"
)
func max(x, y int) int {
@ -480,6 +481,7 @@ func TestChangesSize(t *testing.T) {
}
func checkChanges(expectedChanges, changes []Change, t *testing.T) {
skip.If(t, os.Getuid() != 0, "skipping test that requires root")
sort.Sort(changesByPath(expectedChanges))
sort.Sort(changesByPath(changes))
for i := 0; i < max(len(changes), len(expectedChanges)); i++ {