cephfs: add a test case for calling Statx on an invalid mount

Adding this test case gets test coverage to 100% for path.go.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-11-11 16:25:31 -05:00 committed by mergify[bot]
parent 7cbacf9331
commit 36abb07dc5
1 changed files with 21 additions and 13 deletions

View File

@ -359,6 +359,7 @@ func TestReadlink(t *testing.T) {
}
func TestStatx(t *testing.T) {
t.Run("statPath", func(t *testing.T) {
mount := fsConnect(t)
defer fsDisconnect(t, mount)
@ -376,6 +377,13 @@ func TestStatx(t *testing.T) {
assert.Error(t, err)
assert.Nil(t, st)
assert.Equal(t, errNoEntry, err)
})
t.Run("invalidMount", func(t *testing.T) {
m := &MountInfo{}
_, err := m.Statx("junk", StatxBasicStats, 0)
assert.Error(t, err)
})
}
func TestRename(t *testing.T) {