cephfs: add a test case for calling Statx on an invalid mount
Adding this test case gets test coverage to 100% for path.go.
@@ -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) {
