unix: skip TestIoctlFileDedupeRange on EOPNOTSUPP error

Fixes golang/go#68372

Change-Id: Id3b8fb920b1458e39e7370195591183ee7e450ff
Reviewed-on: https://go-review.googlesource.com/c/sys/+/597555
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Ian Lance Taylor
2024-07-10 10:50:10 -07:00
committed by Gopher Robot
parent 47fe916942
commit ee0e627958

View File

@@ -1087,7 +1087,7 @@ func TestIoctlFileDedupeRange(t *testing.T) {
// The first Info should be equal
if dedupe.Info[0].Status < 0 {
errno := unix.Errno(-dedupe.Info[0].Status)
if errno == unix.EINVAL {
if errno == unix.EINVAL || errno == unix.EOPNOTSUPP {
t.Skip("deduplication not supported on this filesystem")
}
t.Errorf("Unexpected error in FileDedupeRange: %s", unix.ErrnoName(errno))
@@ -1102,7 +1102,7 @@ func TestIoctlFileDedupeRange(t *testing.T) {
// The second Info should be different
if dedupe.Info[1].Status < 0 {
errno := unix.Errno(-dedupe.Info[1].Status)
if errno == unix.EINVAL {
if errno == unix.EINVAL || errno == unix.EOPNOTSUPP {
t.Skip("deduplication not supported on this filesystem")
}
t.Errorf("Unexpected error in FileDedupeRange: %s", unix.ErrnoName(errno))