Debian Codegraph @

stat_test.go

raw symbols SCIP
1 package fsutilscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/
2
3 import (
4 "osscip-go gomod github.com/golang/go/src go1.21 os/"
5 "path/filepathscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/"
6 "runtimescip-go gomod github.com/golang/go/src go1.21 runtime/"
7 "stringsscip-go gomod github.com/golang/go/src go1.21 strings/"
8 "testingscip-go gomod github.com/golang/go/src go1.21 testing/"
9
10 "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/"
11 "github.com/tonistiigi/fsutil/typesscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/"
12 )
13
14 func TestStatscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/TestStat().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
15 requiresRootscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/requiresRoot().(t)
16
17 d, err := tmpDirscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/tmpDir().(changeStreamscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/changeStream().([]string{
18 "ADD foo file data1",
19 "ADD zzz dir",
20 "ADD zzz/aa file data3",
21 "ADD zzz/bb dir",
22 "ADD zzz/bb/cc dir",
23 "ADD zzz/bb/cc/dd symlink ../../",
24 "ADD sock socket",
25 }))
26 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NoError().(t, err)
27 defer osscip-go gomod github.com/golang/go/src go1.21 os/.RemoveAllscip-go gomod github.com/golang/go/src go1.21 os/RemoveAll().(d)
28
29 st, err := Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/Stat().(filepathscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/Join().(d, "foo"))
30 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NoError().(t, err)
31 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NotZeroscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NotZero().(t, st.ModTimescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#ModTime.)
32 st.ModTimescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#ModTime. = 0
33 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/Equal().(t, &typesscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/.Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#{Pathscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Path.: "foo", Modescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Mode.: 0644, Sizescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Size.: 5}, st)
34
35 st, err = Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/Stat().(filepathscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/Join().(d, "zzz"))
36 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NoError().(t, err)
37 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NotZeroscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NotZero().(t, st.ModTimescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#ModTime.)
38 st.ModTimescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#ModTime. = 0
39 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/Equal().(t, &typesscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/.Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#{Pathscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Path.: "zzz", Modescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Mode.: uint32(osscip-go gomod github.com/golang/go/src go1.21 os/.ModeDirscip-go gomod github.com/golang/go/src go1.21 os/ModeDir. | 0700)}, st)
40
41 st, err = Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/Stat().(filepathscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/Join().(d, "zzz/aa"))
42 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NoError().(t, err)
43 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NotZeroscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NotZero().(t, st.ModTimescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#ModTime.)
44 st.ModTimescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#ModTime. = 0
45 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/Equal().(t, &typesscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/.Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#{Pathscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Path.: "aa", Modescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Mode.: 0644, Sizescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Size.: 5}, st)
46
47 st, err = Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/Stat().(filepathscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/Join().(d, "zzz/bb/cc/dd"))
48 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NoError().(t, err)
49 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NotZeroscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NotZero().(t, st.ModTimescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#ModTime.)
50 st.ModTimescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#ModTime. = 0
51 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/Equal().(t, &typesscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/.Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#{Pathscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Path.: "dd", Modescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Mode.: uint32(osscip-go gomod github.com/golang/go/src go1.21 os/.ModeSymlinkscip-go gomod github.com/golang/go/src go1.21 os/ModeSymlink. | 0777), Sizescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Size.: 6, Linknamescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Linkname.: "../../"}, st)
52
53 st, err = Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/Stat().(filepathscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.21 `path/filepath`/Join().(d, "sock"))
54 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NoError().(t, err)
55 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NotZeroscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NotZero().(t, st.ModTimescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#ModTime.)
56 st.ModTimescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#ModTime. = 0
57 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/Equal().(t, &typesscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/.Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#{Pathscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Path.: "sock", Modescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Mode.: 0755 /* ModeSocket not set */}, st)
58 }
59
60 func TestStat_SkipAppleXattrsscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/TestStat_SkipAppleXattrs().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
61 if runtimescip-go gomod github.com/golang/go/src go1.21 runtime/.GOOSscip-go gomod github.com/golang/go/src go1.21 runtime/GOOS. != "darwin" {
62 t.Skipscip-go gomod github.com/golang/go/src go1.21 testing/common#Skip().("skipping test that requires darwin")
63 }
64
65 st, err := Statscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/Stat().("Dockerfile")
66 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NoError().(t, err)
67
68 for key := range st.Xattrsscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/types`/Stat#Xattrs. {
69 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/False().(t, stringsscip-go gomod github.com/golang/go/src go1.21 strings/.HasPrefixscip-go gomod github.com/golang/go/src go1.21 strings/HasPrefix().(key, "com.apple."))
70 }
71 }