aboutsummaryrefslogtreecommitdiff
path: root/tests/root_test/root_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/root_test/root_test.go')
-rw-r--r--tests/root_test/root_test.go52
1 files changed, 0 insertions, 52 deletions
diff --git a/tests/root_test/root_test.go b/tests/root_test/root_test.go
index 42b3694..c531ebb 100644
--- a/tests/root_test/root_test.go
+++ b/tests/root_test/root_test.go
@@ -300,58 +300,6 @@ func TestAcl(t *testing.T) {
}
}
-// TestBtrfsQuirks needs root permissions because it creates a loop disk
-func TestBtrfsQuirks(t *testing.T) {
- if os.Getuid() != 0 {
- t.Skip("must run as root")
- }
-
- img := filepath.Join(test_helpers.TmpDir, t.Name()+".img")
- f, err := os.Create(img)
- if err != nil {
- t.Fatal(err)
- }
- defer f.Close()
- // minimum size for each btrfs device is 114294784
- err = f.Truncate(200 * 1024 * 1024)
- if err != nil {
- t.Fatal(err)
- }
-
- // Format as Btrfs
- _, err = exec.LookPath("mkfs.btrfs")
- if err != nil {
- t.Skip("mkfs.btrfs not found, skipping test")
- }
- cmd := exec.Command("mkfs.btrfs", img)
- out, err := cmd.CombinedOutput()
- if err != nil {
- t.Logf("%q", cmd.Args)
- t.Log(string(out))
- t.Fatal(err)
- }
-
- // Mount
- mnt := img + ".mnt"
- err = os.Mkdir(mnt, 0600)
- if err != nil {
- t.Fatal(err)
- }
- cmd = exec.Command("mount", img, mnt)
- out, err = cmd.CombinedOutput()
- if err != nil {
- t.Log(string(out))
- t.Fatal(err)
- }
- defer syscall.Unlink(img)
- defer syscall.Unmount(mnt, 0)
-
- quirk := syscallcompat.DetectQuirks(mnt)
- if quirk != syscallcompat.QuirkBrokenFalloc {
- t.Errorf("wrong quirk: %v", quirk)
- }
-}
-
func TestOverlay(t *testing.T) {
if os.Getuid() != 0 {
t.Skip("must run as root")