Commit 718d9de6 authored by Joe Tsai's avatar Joe Tsai Committed by Joe Tsai

archive/tar: perform test for hole-detection on specific builders

The test for hole-detection is heavily dependent on whether the
OS and underlying FS provides support for it.
Even on Linux, which has support for SEEK_HOLE and SEEK_DATA,
the underlying filesystem may not have support for it.
In order to avoid an ever-changing game of whack-a-mole,
we whitelist the specific builders that we expect the test to pass on.

Updates #21964

Change-Id: I7334e8532c96cc346ea83aabbb81b719685ad7e5
Reviewed-on: https://go-review.googlesource.com/65270
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 2f7b57e9
...@@ -771,19 +771,9 @@ func TestSparseFiles(t *testing.T) { ...@@ -771,19 +771,9 @@ func TestSparseFiles(t *testing.T) {
// Only perform the tests for hole-detection on the builders, // Only perform the tests for hole-detection on the builders,
// where we have greater control over the filesystem. // where we have greater control over the filesystem.
sparseSupport := testenv.Builder() != "" sparseSupport := testenv.Builder() != ""
if runtime.GOOS == "linux" && runtime.GOARCH == "arm" { switch runtime.GOOS + "-" + runtime.GOARCH {
// The "linux-arm" builder uses aufs for its root FS, case "linux-amd64", "linux-386", "windows-amd64", "windows-386":
// which only supports hole-punching, but not hole-detection. default:
sparseSupport = false
}
if runtime.GOOS == "darwin" {
// The "darwin-*" builders use hfs+ for its root FS,
// which does not support sparse files.
sparseSupport = false
}
if runtime.GOOS == "openbsd" {
// The "openbsd-*" builders use ffs for its root FS,
// which does not support sparse files.
sparseSupport = false sparseSupport = false
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment