From ce8e45541b8d3afc65bbcce119cb0c5db0084bc7 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 13 May 2020 14:33:43 -0400 Subject: [PATCH] cephfs: add test coverage for invalid file state in Fchown Signed-off-by: John Mulligan --- cephfs/file_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cephfs/file_test.go b/cephfs/file_test.go index cd10262..ae00f4f 100644 --- a/cephfs/file_test.go +++ b/cephfs/file_test.go @@ -409,4 +409,9 @@ func TestFchown(t *testing.T) { assert.NoError(t, err) assert.Equal(t, uint32(stats.Sys().(*syscall.Stat_t).Uid), bob) assert.Equal(t, uint32(stats.Sys().(*syscall.Stat_t).Gid), bob) + + // TODO use t.Run sub-tests where appropriate + f2 := &File{} + err = f2.Fchown(bob, bob) + assert.Error(t, err) }