Skip to content

Commit d6cbeee

Browse files
committed
Add extra permission check in removal test
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
1 parent b006663 commit d6cbeee

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

integration/image/remove_unix_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"io/ioutil"
99
"os"
1010
"strconv"
11+
"strings"
1112
"syscall"
1213
"testing"
1314
"unsafe"
@@ -75,7 +76,11 @@ func TestRemoveImageGarbageCollector(t *testing.T) {
7576
argp = uintptr(unsafe.Pointer(&attr))
7677
_, _, errno = syscall.Syscall(syscall.SYS_IOCTL, file.Fd(), fsflags, argp)
7778
assert.Equal(t, "errno 0", errno.Error())
78-
assert.ErrorContains(t, err, "permission denied")
79+
assert.Assert(t, err != nil)
80+
errStr := err.Error()
81+
if !(strings.Contains(errStr, "permission denied") || strings.Contains(errStr, "operation not permitted")) {
82+
t.Errorf("ImageRemove error not an permission error %s", errStr)
83+
}
7984

8085
// Verify that layer remaining on disk
8186
dir, _ := os.Stat(data["UpperDir"])

0 commit comments

Comments
 (0)