Skip to content

Commit

Permalink
Updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshatdell committed Jan 21, 2025
1 parent b3329fc commit 581eebd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions service/features/service.feature
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,12 @@ Feature: PowerMax CSI interface
When I call BeforeServe with an invalid ClusterPrefix
Then the error contains "exceeds maximum length"

@v2.14.0
Scenario: Test BeforeServe
Given a PowerMax service
When I call BeforeServe
Then replication prefixes have default values

@v1.0.0
Scenario: Call ListVolumes, should get unimplemented
Given a PowerMax service
Expand Down
2 changes: 1 addition & 1 deletion service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestGoDog(t *testing.T) {
runOptions := godog.Options{
Format: "pretty",
Paths: []string{"features"},
Tags: "v1.0.0, v1.1.0, v1.2.0, v1.3.0, v1.4.0, v1.5.0, v1.6.0, v2.2.0, v2.3.0, v2.4.0, v2.5.0, v2.6.0, v2.7.0, v2.8.0, v2.9.0, v2.11.0, v2.12.0, v2.13.0",
Tags: "v1.0.0, v1.1.0, v1.2.0, v1.3.0, v1.4.0, v1.5.0, v1.6.0, v2.2.0, v2.3.0, v2.4.0, v2.5.0, v2.6.0, v2.7.0, v2.8.0, v2.9.0, v2.11.0, v2.12.0, v2.13.0, v2.14.0",
// Tags: "wip",
// Tags: "resiliency", // uncomment to run all node resiliency related tests,
}
Expand Down
10 changes: 10 additions & 0 deletions service/step_defs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2720,6 +2720,15 @@ func (f *feature) iCallBeforeServeWithTopologyConfigSetAt(path string) error {
return nil
}

func (f *feature) verifyDefaultReplicationPrefix() error {
opts := f.service.opts
if opts.ReplicationPrefix != "replication.storage.dell.com" || opts.ReplicationContextPrefix != "powermax" {
return fmt.Errorf("expected default replication prefix, got %s %s", opts.ReplicationPrefix, opts.ReplicationContextPrefix)
}

return nil
}

func (f *feature) iCallNodeStageVolume() error {
// _ = f.getNodePublishVolumeRequest()
header := metadata.New(map[string]string{"csi.requestid": "1"})
Expand Down Expand Up @@ -5056,6 +5065,7 @@ func FeatureContext(s *godog.ScenarioContext) {
s.Step(`^I call BeforeServe$`, f.iCallBeforeServe)
s.Step(`^I call BeforeServe without ClusterPrefix$`, f.iCallBeforeServeWithoutClusterPrefix)
s.Step(`^I call BeforeServe with an invalid ClusterPrefix$`, f.iCallBeforeServeWithAnInvalidClusterPrefix)
s.Step(`^replication prefixes have default values$`, f.verifyDefaultReplicationPrefix)
s.Step(`^I call NodeStageVolume$`, f.iCallNodeStageVolume)
s.Step(`^I call NodeUnstageVolume$`, f.iCallNodeUnstageVolume)
s.Step(`^I call NodeStageVolume with simulator$`, f.iCallNodeStageVolumeWithSimulator)
Expand Down

0 comments on commit 581eebd

Please sign in to comment.