cephfs: adds unit testing for unfencing procedure

Signed-off-by: Riya Singhal <rsinghal@redhat.com>
This commit is contained in:
Riya Singhal 2023-09-29 11:32:01 +05:30 committed by mergify[bot]
parent 14b06837d0
commit 74dfb7b913

View File

@ -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)
}