From 4bab60af1569feae0f1c7c445fc760486577000e Mon Sep 17 00:00:00 2001 From: Riya Singhal Date: Fri, 29 Sep 2023 11:32:01 +0530 Subject: [PATCH] cephfs: adds unit testing for unfencing procedure Signed-off-by: Riya Singhal --- internal/csi-addons/cephfs/network_fence_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/internal/csi-addons/cephfs/network_fence_test.go b/internal/csi-addons/cephfs/network_fence_test.go index ce463f1346cb..0d5cb96119ce 100644 --- a/internal/csi-addons/cephfs/network_fence_test.go +++ b/internal/csi-addons/cephfs/network_fence_test.go @@ -42,3 +42,19 @@ func TestFenceClusterNetwork(t *testing.T) { _, err := controller.FenceClusterNetwork(context.TODO(), req) assert.Error(t, err) } + +// TestUnfenceClusterNetwork is a minimal test for the UnfenceClusterNetwork() +// procedure. During unit-testing, there is no Ceph cluster available, so actual +// operations can not be performed. +func TestUnfenceClusterNetwork(t *testing.T) { + t.Parallel() + controller := NewFenceControllerServer() + + req := &fence.UnfenceClusterNetworkRequest{ + Parameters: map[string]string{}, + Secrets: nil, + Cidrs: nil, + } + _, err := controller.UnfenceClusterNetwork(context.TODO(), req) + assert.Error(t, err) +}