Skip to content

Commit

Permalink
cephfs: adds unit testing for unfencing procedure
Browse files Browse the repository at this point in the history
Signed-off-by: Riya Singhal <[email protected]>
  • Loading branch information
riya-singhal31 authored and mergify[bot] committed Oct 24, 2023
1 parent 14b0683 commit 74dfb7b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/csi-addons/cephfs/network_fence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 74dfb7b

Please sign in to comment.