This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.
Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
defer func() {
if err := os.RemoveAll(dir); err != nil {
t.Fatal(err)
}
}
is also tedious, but `t.TempDir` handles this for us nicely.
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
If a mount has the inode32 or inode64 option, even when we didn't
request it (which happens on XFS), don't treat that as an error.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Fix test error messages:
- add missing commas;
- fix a typo (failed -> field)
- allow for clear distinction between mount
and vfs (per-superblock) options.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Files that end with _linux.go and *_linux_test.go are
already used when GOOS=linux only, and so linux build
tag is redundant.
Files were found by
git ls-files | grep -E '_linux(_test|).go' | xargs grep -F '+build '
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
On SELinux-enabled kernels, the kernel will helpfully add a "seclabel"
option to mounted filesystems to indicate that labeling is supported.
Don't let that break our tests.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Had to vendor in a new version of golang.org/x/net to build
Also had to make some changes to drivers to handle
archive.Reader -> io.Reader
archive.Archive -> io.ReadCloser
Also update .gitingore to ignore emacs files, containers-storage.*
and generated man pages.
Also no longer test travis against golang 1.7, cri-o, moby have also
done this.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>