Commit Graph

9 Commits

Author SHA1 Message Date
Eng Zer Jun 6ea3603b6b
test: use `T.TempDir` to create temporary test directory
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>
2022-08-30 01:21:37 +08:00
Nalin Dahyabhai 0cff781592 pkg/mount: don't complain if the filesystem volunteers inode32/inode64
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>
2021-02-23 10:29:40 -05:00
Kir Kolyshkin d53aa83fd2 vendor: bump mountinfo to v0.3.1
Unfortunately it contains some breaking changes (in names),
so fix the code accordingly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-10-01 17:59:49 -07:00
Kir Kolyshkin 39f3c84440 pkg/mount/mounter_linux_test: nits
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>
2020-03-06 17:00:54 -08:00
Kir Kolyshkin fa56ab963c pkg/mount: rm redundant build tags
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>
2020-03-06 17:00:54 -08:00
Sascha Grunert b66d5a5c12
Enable goconst linter and fix lints
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-01-28 15:59:15 +01:00
Daniel J Walsh f71306a490
Fixes to allow unit test to pass on fedora 30
Fix unit test to ignore relatime
Update vendor to fix unit tests

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-05-16 21:34:23 -04:00
Nalin Dahyabhai 252bf574a0 Don't fail the mounter test because the kernel added options
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>
2019-01-17 14:36:47 -05:00
Daniel J Walsh f39066fe1b Update packages to match latest code in moby/pkg
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>
2017-09-12 18:00:29 +00:00