Skip to content

Commit

Permalink
Increase coverage of controller
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshaySainiDell committed Dec 18, 2024
1 parent 0bb8fd1 commit 7c25b49
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions controllers/csm_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,17 @@ func (suite *CSMControllerTestSuite) TestReverseProxyReconcile() {
suite.runFakeCSMManager("", true)
}

func (suite *CSMControllerTestSuite) TestReverseProxySidecarReconcile() {
revProxy := getReverseProxyModule()
deploAsSidecar := corev1.EnvVar{Name: "DeployAsSidecar", Value: "true"}
revProxy[0].Components[0].Envs = append(revProxy[0].Components[0].Envs, deploAsSidecar)
modules.IsReverseProxySidecar = func() bool { return true }
suite.makeFakeRevProxyCSM(csmName, suite.namespace, true, revProxy, string(v1.PowerMax))
suite.runFakeCSMManager("", false)
suite.deleteCSM(csmName)
suite.runFakeCSMManager("", true)
}

func (suite *CSMControllerTestSuite) TestReverseProxyPreCheckError() {
suite.makeFakeRevProxyCSM(csmName, suite.namespace, false, getReverseProxyModule(), "badVersion")
reconciler := suite.createReconciler()
Expand Down Expand Up @@ -802,6 +813,7 @@ func (suite *CSMControllerTestSuite) TestSyncCSM() {
appMobCSM.Spec.Modules = getAppMob()
reverseProxyServerCSM := shared.MakeCSM(csmName, suite.namespace, configVersion)
reverseProxyServerCSM.Spec.Modules = getReverseProxyModule()
modules.IsReverseProxySidecar = func() bool { return false }

syncCSMTests := []struct {
name string
Expand Down

0 comments on commit 7c25b49

Please sign in to comment.