Add ignore socket test
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
13
vendor/github.com/containerd/continuity/fs/fstest/file.go
generated
vendored
13
vendor/github.com/containerd/continuity/fs/fstest/file.go
generated
vendored
@@ -2,6 +2,7 @@ package fstest
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
@@ -107,6 +108,18 @@ func Link(oldname, newname string) Applier {
|
||||
// }
|
||||
//}
|
||||
|
||||
func CreateSocket(name string, perm os.FileMode) Applier {
|
||||
return applyFn(func(root string) error {
|
||||
fullPath := filepath.Join(root, name)
|
||||
ln, err := net.Listen("unix", fullPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer ln.Close()
|
||||
return os.Chmod(fullPath, perm)
|
||||
})
|
||||
}
|
||||
|
||||
// Apply returns a new applier from the given appliers
|
||||
func Apply(appliers ...Applier) Applier {
|
||||
return applyFn(func(root string) error {
|
||||
|
||||
1
vendor/github.com/containerd/continuity/fs/fstest/testsuite.go
generated
vendored
1
vendor/github.com/containerd/continuity/fs/fstest/testsuite.go
generated
vendored
@@ -74,6 +74,7 @@ var (
|
||||
Symlink("libnothing.so", "/usr/local/lib/libnothing.so.2"),
|
||||
CreateDir("/home", 0755),
|
||||
CreateDir("/home/derek", 0700),
|
||||
CreateDir("/var/run/socket", 0700),
|
||||
)
|
||||
|
||||
// basicTest covers basic operations
|
||||
|
||||
Reference in New Issue
Block a user