Skip to content

Commit

Permalink
Adding Test for SetPollingFrequency and GetDriverName
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshi-garg1 authored Nov 25, 2024
1 parent fe7b84e commit b86d2b9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions service/service_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,30 @@ func TestGetTransportProtocolFromEnv(t *testing.T) {
assert.Equal(t, "", output)
}

func TestSetPollingFrequency(t *testing.T) {
s := service{
useIscsi: true,
}
var expectedFreq int64 = 5
ctx := context.Background()
_ = os.Setenv(EnvPodmonArrayConnectivityPollRate, "5")
pollingFreq := s.SetPollingFrequency(ctx)
assert.Equal(t, expectedFreq, pollingFreq)

}

func TestGetDriverName(t *testing.T) {
o := Opts{
DriverName: "powermax",
}
s := service{
opts: o,
}

driverName := s.getDriverName()
assert.Equal(t, "powermax", driverName)
}

func TestSetArrayConfigEnvs(t *testing.T) {

ctx := context.Background()
Expand Down

0 comments on commit b86d2b9

Please sign in to comment.