mirror of https://github.com/ceph/go-ceph
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:
parent
7cbacf9331
commit
36abb07dc5
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue