| 1 |
package btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ |
| 2 |
|
| 3 |
import ( |
| 4 |
"github.com/dennwc/btrfs/testscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/" |
| 5 |
"ioscip-go gomod github.com/golang/go/src go1.12 io/" |
| 6 |
"io/ioutilscip-go gomod github.com/golang/go/src go1.12 `io/ioutil`/" |
| 7 |
"osscip-go gomod github.com/golang/go/src go1.12 os/" |
| 8 |
"path/filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/" |
| 9 |
"reflectscip-go gomod github.com/golang/go/src go1.12 reflect/" |
| 10 |
"sortscip-go gomod github.com/golang/go/src go1.12 sort/" |
| 11 |
"testingscip-go gomod github.com/golang/go/src go1.12 testing/" |
| •12 |
"timescip-go gomod github.com/golang/go/src go1.12 time/" |
| 13 |
) |
| 14 |
|
| 15 |
const sizeDefscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/sizeDef. = 256 * 1024 * 1024 |
| 16 |
|
| 17 |
func TestOpenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/TestOpen().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 18 |
dir, closer := btrfstestscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/.Newscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/New().(t, sizeDefscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/sizeDef.) |
| 19 |
defer closer() |
| 20 |
fs, err := Openscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/Open().(dir, true) |
| 21 |
if err != nil { |
| 22 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 23 |
} |
| 24 |
if err = fs.Closescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#Close().(); err != nil { |
| 25 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
func TestIsSubvolumescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/TestIsSubvolume().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 30 |
dir, closer := btrfstestscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/.Newscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/New().(t, sizeDefscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/sizeDef.) |
| 31 |
defer closer() |
| 32 |
|
| 33 |
isSubvol := func(path string, expect bool) { |
| 34 |
ok, err := IsSubVolumescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/IsSubVolume().(path) |
| 35 |
if err != nil { |
| 36 |
t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("failed to check subvolume %v: %v", path, err) |
| 37 |
return |
| 38 |
} else if ok != expect { |
| 39 |
t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("unexpected result for %v", path) |
| 40 |
} |
| 41 |
} |
| 42 |
mkdir := func(path string) { |
| 43 |
path = filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, path) |
| 44 |
if err := osscip-go gomod github.com/golang/go/src go1.12 os/.MkdirAllscip-go gomod github.com/golang/go/src go1.12 os/MkdirAll().(path, 0755); err != nil { |
| 45 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("cannot create dir %v: %v", path, err) |
| 46 |
} |
| 47 |
isSubvol(path, false) |
| 48 |
} |
| 49 |
|
| 50 |
mksub := func(path string) { |
| 51 |
path = filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, path) |
| 52 |
if err := CreateSubVolumescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/CreateSubVolume().(path); err != nil { |
| 53 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("cannot create subvolume %v: %v", path, err) |
| 54 |
} |
| 55 |
isSubvol(path, true) |
| 56 |
} |
| 57 |
|
| 58 |
mksub("v1") |
| 59 |
|
| 60 |
mkdir("v1/d2") |
| 61 |
mksub("v1/v2") |
| 62 |
|
| 63 |
mkdir("v1/d2/d3") |
| 64 |
mksub("v1/d2/v3") |
| 65 |
|
| 66 |
mkdir("v1/v2/d3") |
| 67 |
mksub("v1/v2/v3") |
| 68 |
|
| 69 |
mkdir("d1") |
| 70 |
|
| 71 |
mkdir("d1/d2") |
| 72 |
mksub("d1/v2") |
| 73 |
|
| 74 |
mkdir("d1/d2/d3") |
| 75 |
mksub("d1/d2/v3") |
| 76 |
|
| 77 |
mkdir("d1/v2/d3") |
| 78 |
mksub("d1/v2/v3") |
| 79 |
} |
| 80 |
|
| 81 |
func TestSubvolumesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/TestSubvolumes().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 82 |
dir, closer := btrfstestscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/.Newscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/New().(t, sizeDefscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/sizeDef.) |
| 83 |
defer closer() |
| 84 |
fs, err := Openscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/Open().(dir, false) |
| 85 |
if err != nil { |
| 86 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 87 |
} |
| 88 |
defer fs.Closescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#Close().() |
| 89 |
|
| 90 |
mksub := func(in string, path string) { |
| 91 |
if in != "" { |
| 92 |
path = filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, in, path) |
| 93 |
} else { |
| 94 |
path = filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, path) |
| 95 |
} |
| 96 |
if err := CreateSubVolumescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/CreateSubVolume().(path); err != nil { |
| 97 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("cannot create subvolume %v: %v", path, err) |
| 98 |
} |
| 99 |
} |
| 100 |
delsub := func(path string) { |
| 101 |
path = filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, path) |
| 102 |
if err := DeleteSubVolumescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/DeleteSubVolume().(path); err != nil { |
| 103 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("cannot delete subvolume %v: %v", path, err) |
| 104 |
} |
| 105 |
} |
| 106 |
expect := func(exp []string) { |
| 107 |
subs, err := fs.ListSubvolumesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#ListSubvolumes().(nil) |
| 108 |
if err != nil { |
| 109 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 110 |
} |
| 111 |
var got []string |
| 112 |
for _, s := range subs { |
| 113 |
if s.UUIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/SubvolInfo#UUID..IsZeroscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UUID#IsZero().() { |
| 114 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("zero uuid in %+v", s) |
| 115 |
} |
| 116 |
if s.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/SubvolInfo#Path. != "" { |
| 117 |
got = append(got, s.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/SubvolInfo#Path.) |
| 118 |
} |
| 119 |
} |
| 120 |
sortscip-go gomod github.com/golang/go/src go1.12 sort/.Stringsscip-go gomod github.com/golang/go/src go1.12 sort/Strings().(got) |
| 121 |
sortscip-go gomod github.com/golang/go/src go1.12 sort/.Stringsscip-go gomod github.com/golang/go/src go1.12 sort/Strings().(exp) |
| 122 |
if !reflectscip-go gomod github.com/golang/go/src go1.12 reflect/.DeepEqualscip-go gomod github.com/golang/go/src go1.12 reflect/DeepEqual().(got, exp) { |
| 123 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("list failed:\ngot: %v\nvs\nexp: %v", got, exp) |
| 124 |
} |
| 125 |
} |
| 126 |
|
| 127 |
names := []string{"foo", "bar", "baz"} |
| 128 |
for _, name := range names { |
| 129 |
mksub("", name) |
| 130 |
} |
| 131 |
for _, name := range names { |
| 132 |
mksub(names[0], name) |
| 133 |
} |
| 134 |
expect([]string{ |
| 135 |
"foo", "bar", "baz", |
| 136 |
"foo/foo", "foo/bar", "foo/baz", |
| 137 |
}) |
| 138 |
delsub("foo/bar") |
| 139 |
expect([]string{ |
| 140 |
"foo", "bar", "baz", |
| 141 |
"foo/foo", "foo/baz", |
| 142 |
}) |
| 143 |
|
| 144 |
path := filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(names[0], names[2]) |
| 145 |
mksub(path, "new") |
| 146 |
path = filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(path, "new") |
| 147 |
|
| 148 |
id, err := getPathRootIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/getPathRootID().(filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, path)) |
| 149 |
if err != nil { |
| 150 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 151 |
} |
| 152 |
info, err := subvolSearchByRootIDscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/subvolSearchByRootID().(fs.fscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#f., id, "") |
| 153 |
if err != nil { |
| 154 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 155 |
} else if info.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/SubvolInfo#Path. != path { |
| 156 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("wrong path returned: %v vs %v", info.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/SubvolInfo#Path., path) |
| 157 |
} |
| 158 |
} |
| 159 |
|
| 160 |
func TestCompressionscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/TestCompression().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 161 |
dir, closer := btrfstestscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/.Newscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/New().(t, sizeDefscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/sizeDef.) |
| 162 |
defer closer() |
| 163 |
fs, err := Openscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/Open().(dir, true) |
| 164 |
if err != nil { |
| 165 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 166 |
} |
| 167 |
defer fs.Closescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#Close().() |
| 168 |
if err := fs.CreateSubVolumescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#CreateSubVolume().("sub"); err != nil { |
| 169 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 170 |
} |
| 171 |
path := filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, "sub") |
| 172 |
|
| 173 |
if err := SetCompressionscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/SetCompression().(path, LZOscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/LZO.); err != nil { |
| 174 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 175 |
} |
| 176 |
if c, err := GetCompressionscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/GetCompression().(path); err != nil { |
| 177 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 178 |
} else if c != LZOscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/LZO. { |
| 179 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("unexpected compression returned: %q", string(c)) |
| 180 |
} |
| 181 |
} |
| 182 |
|
| 183 |
func TestCloneFilescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/TestCloneFile().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 184 |
dir, closer := btrfstestscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/.Newscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/New().(t, sizeDefscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/sizeDef.) |
| 185 |
defer closer() |
| 186 |
|
| 187 |
f1, err := osscip-go gomod github.com/golang/go/src go1.12 os/.Createscip-go gomod github.com/golang/go/src go1.12 os/Create().(filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, "1.dat")) |
| 188 |
if err != nil { |
| 189 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 190 |
} |
| 191 |
defer f1.Closescip-go gomod github.com/golang/go/src go1.12 os/File#Close().() |
| 192 |
|
| 193 |
const data = "btrfs_test" |
| 194 |
_, err = f1.WriteStringscip-go gomod github.com/golang/go/src go1.12 os/File#WriteString().(data) |
| 195 |
if err != nil { |
| 196 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 197 |
} |
| 198 |
|
| 199 |
f2, err := osscip-go gomod github.com/golang/go/src go1.12 os/.Createscip-go gomod github.com/golang/go/src go1.12 os/Create().(filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, "2.dat")) |
| 200 |
if err != nil { |
| 201 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 202 |
} |
| 203 |
defer f2.Closescip-go gomod github.com/golang/go/src go1.12 os/File#Close().() |
| 204 |
|
| 205 |
err = CloneFilescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/CloneFile().(f2, f1) |
| 206 |
if err != nil { |
| 207 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 208 |
} |
| 209 |
|
| 210 |
buf := make([]byte, len(data)) |
| 211 |
n, err := f2.Readscip-go gomod github.com/golang/go/src go1.12 os/File#Read().(buf) |
| 212 |
if err != nil && err != ioscip-go gomod github.com/golang/go/src go1.12 io/.EOFscip-go gomod github.com/golang/go/src go1.12 io/EOF. { |
| 213 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 214 |
} |
| 215 |
buf = buf[:n] |
| 216 |
if string(buf) != data { |
| 217 |
t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("wrong data returned: %q", string(buf)) |
| 218 |
} |
| 219 |
} |
| 220 |
|
| 221 |
func TestResizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/TestResize().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 222 |
dir, err := ioutilscip-go gomod github.com/golang/go/src go1.12 `io/ioutil`/.TempDirscip-go gomod github.com/golang/go/src go1.12 `io/ioutil`/TempDir().("", "btrfs_data_") |
| 223 |
if err != nil { |
| 224 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 225 |
} |
| 226 |
defer osscip-go gomod github.com/golang/go/src go1.12 os/.RemoveAllscip-go gomod github.com/golang/go/src go1.12 os/RemoveAll().(dir) |
| 227 |
fname := filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, "data") |
| 228 |
if err = btrfstestscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/.Mkfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/Mkfs().(fname, sizeDefscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/sizeDef.); err != nil { |
| 229 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 230 |
} |
| 231 |
mnt := filepathscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.12 `path/filepath`/Join().(dir, "mnt") |
| 232 |
if err = osscip-go gomod github.com/golang/go/src go1.12 os/.MkdirAllscip-go gomod github.com/golang/go/src go1.12 os/MkdirAll().(mnt, 0755); err != nil { |
| 233 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 234 |
} |
| 235 |
if err = btrfstestscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/.Mountscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/Mount().(mnt, fname); err != nil { |
| 236 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 237 |
} |
| 238 |
defer btrfstestscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/.Unmountscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/Unmount().(mnt) |
| 239 |
|
| 240 |
fs, err := Openscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/Open().(mnt, false) |
| 241 |
if err != nil { |
| 242 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 243 |
} |
| 244 |
st, err := fs.Usagescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#Usage().() |
| 245 |
fs.Closescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#Close().() |
| 246 |
if err != nil { |
| 247 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 248 |
} |
| 249 |
|
| 250 |
if err = btrfstestscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/.Unmountscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/Unmount().(mnt); err != nil { |
| 251 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 252 |
} |
| 253 |
var newSize int64 = sizeDefscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/sizeDef. |
| 254 |
newSize = int64(float64(newSize) * 1.1) |
| 255 |
if err = osscip-go gomod github.com/golang/go/src go1.12 os/.Truncatescip-go gomod github.com/golang/go/src go1.12 os/Truncate().(fname, newSize); err != nil { |
| 256 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 257 |
} |
| •258 |
timescip-go gomod github.com/golang/go/src go1.12 time/.Sleepscip-go gomod github.com/golang/go/src go1.12 time/Sleep().(timescip-go gomod github.com/golang/go/src go1.12 time/.Secondscip-go gomod github.com/golang/go/src go1.12 time/Second.) |
| 259 |
if err = btrfstestscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/.Mountscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/test`/Mount().(mnt, fname); err != nil { |
| 260 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 261 |
} |
| 262 |
|
| 263 |
fs, err = Openscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/Open().(mnt, false) |
| 264 |
if err != nil { |
| 265 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 266 |
} |
| 267 |
defer fs.Closescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#Close().() |
| 268 |
|
| 269 |
if err = fs.ResizeToMaxscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#ResizeToMax().(); err != nil { |
| 270 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 271 |
} |
| 272 |
|
| 273 |
st2, err := fs.Usagescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/FS#Usage().() |
| 274 |
if err != nil { |
| 275 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().(err) |
| 276 |
} else if st.Totalscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UsageInfo#Total. >= st2.Totalscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UsageInfo#Total. { |
| 277 |
t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().("to resized:", st.Totalscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UsageInfo#Total., st2.Totalscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/UsageInfo#Total.) |
| 278 |
} |
| 279 |
} |