diff --git a/Makefile b/Makefile index 98bb4b0b..a969e69a 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ push: docker # Run unit tests and skip the BDD tests unit-test: golint check - ( cd service; go clean -cache; CGO_ENABLED=0 GO111MODULE=on go test -skip TestGoDog -v -coverprofile=c.out ./... ) + ( cd service; go clean -cache; CGO_ENABLED=0 GO111MODULE=on go test -v -coverprofile=c.out ./... ) # Run BDD tests. Need to be root to run as tests require some system access, need to fix bdd-test: golint check diff --git a/csireverseproxy/manifests/revproxy.yaml b/csireverseproxy/manifests/revproxy.yaml index 19e04738..2422e3f3 100644 --- a/csireverseproxy/manifests/revproxy.yaml +++ b/csireverseproxy/manifests/revproxy.yaml @@ -73,7 +73,7 @@ spec: - name: X_CSI_REVPROXY_TLS_CERT_DIR value: /app/tls - name: X_CSI_REVPROXY_WATCH_NAMESPACE - value: powermax #Change this to the namespace where proxy will be installed + value: powermax # Change this to the namespace where proxy will be installed volumeMounts: - name: configmap-volume mountPath: /etc/config/configmap diff --git a/go.mod b/go.mod index ee90f412..04f48834 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/dell/gofsutil v1.17.0 github.com/dell/goiscsi v1.10.0 github.com/dell/gonvme v1.9.0 - github.com/dell/gopowermax/v2 v2.8.0 + github.com/dell/gopowermax/v2 v2.8.1-0.20241125093918-928d66cb1027 github.com/fsnotify/fsnotify v1.4.9 github.com/gorilla/mux v1.7.3 github.com/kubernetes-csi/csi-lib-utils v0.7.0 @@ -50,6 +50,7 @@ require ( github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/googleapis/gnostic v0.4.1 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-memdb v1.3.4 // indirect diff --git a/go.sum b/go.sum index 4173dbfe..0b261d47 100644 --- a/go.sum +++ b/go.sum @@ -112,8 +112,8 @@ github.com/dell/goiscsi v1.10.0 h1:0U24YZ2aEbjdvcMCx4x8GcXwwonDUwpCjAFP5QJiiXs= github.com/dell/goiscsi v1.10.0/go.mod h1:uDXlWSh0w5BdLr5XhPKUyNpkJDTc0jmnz/u6QcPkIyA= github.com/dell/gonvme v1.9.0 h1:r/Gs88+NUKypDwyyoL8wzcx9zsqyVbea+oDnA/PPmiI= github.com/dell/gonvme v1.9.0/go.mod h1:5IgWNLcuffHzuXSa6YH3APHiET/hROouuj3mg7GPoqQ= -github.com/dell/gopowermax/v2 v2.8.0 h1:skBPhCDDio4CU9naxJrAytXWQarDZGtLsOhyUtAFfuM= -github.com/dell/gopowermax/v2 v2.8.0/go.mod h1:LAwLBmN44WT/u1ixPf2M0cTXzsMwIFZ6NcTyC0gwvXA= +github.com/dell/gopowermax/v2 v2.8.1-0.20241125093918-928d66cb1027 h1:RE5VVC+ZcW+RdVm1P7ZcqFfKc71Xh1xrdVEHddvOSgo= +github.com/dell/gopowermax/v2 v2.8.1-0.20241125093918-928d66cb1027/go.mod h1:LAwLBmN44WT/u1ixPf2M0cTXzsMwIFZ6NcTyC0gwvXA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= diff --git a/pkg/migration/migration.go b/pkg/migration/migration.go index 21a941b5..928e98d3 100644 --- a/pkg/migration/migration.go +++ b/pkg/migration/migration.go @@ -78,7 +78,7 @@ func getOrCreateSGMigration(ctx context.Context, symID, remoteSymID, storageGrou // 1. Remove volumes from default SRP SG // 2. Create migration session for no-srp SG // 3. Create default SRP storage group on remote array, and maintain a list of volumes to be added. -func StorageGroupMigration(ctx context.Context, symID, remoteSymID, clusterPrefix string, pmaxClient pmax.Pmax) (bool, error) { +var StorageGroupMigration = func(ctx context.Context, symID, remoteSymID, clusterPrefix string, pmaxClient pmax.Pmax) (bool, error) { // Before running no-srp-sg migrate call, remove the volumes from srp SG // for all the SG for this cluster on local sym ID localSgList, err := pmaxClient.GetStorageGroupIDList(ctx, symID, CsiVolumePrefix+clusterPrefix, true) @@ -178,7 +178,7 @@ func StorageGroupMigration(ctx context.Context, symID, remoteSymID, clusterPrefi // StorageGroupCommit does a "commit" on all the migration session SG // Returns true if not sessions found, all migration completed -func StorageGroupCommit(ctx context.Context, symID, action string, pmaxClient pmax.Pmax) (bool, error) { +var StorageGroupCommit = func(ctx context.Context, symID, action string, pmaxClient pmax.Pmax) (bool, error) { // for all the SG in saved local SG mgSGList, err := pmaxClient.GetStorageGroupMigration(ctx, symID) if err != nil { @@ -206,7 +206,7 @@ func StorageGroupCommit(ctx context.Context, symID, action string, pmaxClient pm } // AddVolumesToRemoteSG adds remote volumes to default SRP SG on remote array -func AddVolumesToRemoteSG(ctx context.Context, remoteSymID string, pmaxClient pmax.Pmax) (bool, error) { +var AddVolumesToRemoteSG = func(ctx context.Context, remoteSymID string, pmaxClient pmax.Pmax) (bool, error) { // add all the volumes in SGtoRemoteVols log.Debugf("SGToRemoteVols: %v", SGToRemoteVols) if len(SGToRemoteVols) == 0 { @@ -227,7 +227,7 @@ func AddVolumesToRemoteSG(ctx context.Context, remoteSymID string, pmaxClient pm } // GetOrCreateMigrationEnvironment creates migration environment between array pair -func GetOrCreateMigrationEnvironment(ctx context.Context, localSymID, remoteSymID string, pmaxClient pmax.Pmax) (*types.MigrationEnv, error) { +var GetOrCreateMigrationEnvironment = func(ctx context.Context, localSymID, remoteSymID string, pmaxClient pmax.Pmax) (*types.MigrationEnv, error) { var migrationEnv *types.MigrationEnv migrationEnv, err := pmaxClient.GetMigrationEnvironment(ctx, localSymID, remoteSymID) if err != nil || migrationEnv == nil { diff --git a/samples/configmap/powermax-array-config.yaml b/samples/configmap/powermax-array-config.yaml index 14034e43..4d234962 100644 --- a/samples/configmap/powermax-array-config.yaml +++ b/samples/configmap/powermax-array-config.yaml @@ -17,7 +17,7 @@ metadata: namespace: powermax data: powermax-array-config.yaml: | - X_CSI_POWERMAX_PORTGROUPS: "" # required for ISCSI + X_CSI_POWERMAX_PORTGROUPS: "" # required for ISCSI X_CSI_TRANSPORT_PROTOCOL: "" # Defaults to auto X_CSI_POWERMAX_ENDPOINT: "https://10.0.0.0:1234" X_CSI_MANAGED_ARRAYS: "000000000000,000000000000," diff --git a/samples/storageclass/powermax.yaml b/samples/storageclass/powermax.yaml index b1227349..47468b65 100644 --- a/samples/storageclass/powermax.yaml +++ b/samples/storageclass/powermax.yaml @@ -47,19 +47,19 @@ parameters: # This is used in naming storage group, max of 3 letter # Optional: true # Example: "HL1", "HL2" - #HostLimitName: "HL1" + # HostLimitName: "HL1" # The MBs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitMBSec: "" + # HostIOLimitMBSec: "" # The IOs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitIOSec: "" + # HostIOLimitIOSec: "" # distribution of the Host IO limits for the storage class # Optional: true, Default: "" # Allowed values: Never","Always" or "OnFailure" only - #DynamicDistribution: "" + # DynamicDistribution: "" # If using custom driver name, change the following to point to the custom name # Optional: true, Default value: csi-powermax.dellemc.com # Examples: "csi-driver-powermax", "csi-powermax.dellemc.com" diff --git a/samples/storageclass/powermax_fc.yaml b/samples/storageclass/powermax_fc.yaml index d9eadfce..b2293192 100644 --- a/samples/storageclass/powermax_fc.yaml +++ b/samples/storageclass/powermax_fc.yaml @@ -38,19 +38,19 @@ parameters: # This is used in naming storage group, max of 3 letter # Optional: true # Example: "HL1", "HL2" - #HostLimitName: "HL1" + # HostLimitName: "HL1" # The MBs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitMBSec: "" + # HostIOLimitMBSec: "" # The IOs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitIOSec: "" + # HostIOLimitIOSec: "" # distribution of the Host IO limits for the storage class # Optional: true, Default: "" # Allowed values: Never","Always" or "OnFailure" only - #DynamicDistribution: "" + # DynamicDistribution: "" # If using custom driver name, change the following to point to the custom name # Optional: true, Default value: csi-powermax.dellemc.com # Examples: "csi-driver-powermax", "csi-powermax.dellemc.com" @@ -88,4 +88,3 @@ allowedTopologies: - key: csi-powermax.dellemc.com/.fc values: - csi-powermax.dellemc.com - diff --git a/samples/storageclass/powermax_iscsi.yaml b/samples/storageclass/powermax_iscsi.yaml index 3e2ec178..8b3ebd26 100644 --- a/samples/storageclass/powermax_iscsi.yaml +++ b/samples/storageclass/powermax_iscsi.yaml @@ -38,19 +38,19 @@ parameters: # This is used in naming storage group, max of 3 letter # Optional: true # Example: "HL1", "HL2" - #HostLimitName: "HL1" + # HostLimitName: "HL1" # The MBs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitMBSec: "" + # HostIOLimitMBSec: "" # The IOs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitIOSec: "" + # HostIOLimitIOSec: "" # distribution of the Host IO limits for the storage class # Optional: true, Default: "" # Allowed values: Never","Always" or "OnFailure" only - #DynamicDistribution: "" + # DynamicDistribution: "" # If using custom driver name, change the following to point to the custom name # Optional: true, Default value: csi-powermax.dellemc.com # Examples: "csi-driver-powermax", "csi-powermax.dellemc.com" diff --git a/samples/storageclass/powermax_nfs.yaml b/samples/storageclass/powermax_nfs.yaml index 3399051c..bd30f844 100644 --- a/samples/storageclass/powermax_nfs.yaml +++ b/samples/storageclass/powermax_nfs.yaml @@ -54,19 +54,19 @@ parameters: # This is used in naming storage group, max of 3 letter # Optional: true # Example: "HL1", "HL2" - #HostLimitName: "HL1" + # HostLimitName: "HL1" # The MBs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitMBSec: "" + # HostIOLimitMBSec: "" # The IOs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitIOSec: "" + # HostIOLimitIOSec: "" # distribution of the Host IO limits for the storage class # Optional: true, Default: "" # Allowed values: Never","Always" or "OnFailure" only - #DynamicDistribution: "" + # DynamicDistribution: "" # If using custom driver name, change the following to point to the custom name # Optional: true, Default value: csi-powermax.dellemc.com # Examples: "csi-driver-powermax", "csi-powermax.dellemc.com" diff --git a/samples/storageclass/powermax_nvmetcp.yaml b/samples/storageclass/powermax_nvmetcp.yaml index d6976715..03525c74 100644 --- a/samples/storageclass/powermax_nvmetcp.yaml +++ b/samples/storageclass/powermax_nvmetcp.yaml @@ -38,19 +38,19 @@ parameters: # This is used in naming storage group, max of 3 letter # Optional: true # Example: "HL1", "HL2" - #HostLimitName: "HL1" + # HostLimitName: "HL1" # The MBs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitMBSec: "" + # HostIOLimitMBSec: "" # The IOs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitIOSec: "" + # HostIOLimitIOSec: "" # distribution of the Host IO limits for the storage class # Optional: true, Default: "" # Allowed values: Never","Always" or "OnFailure" only - #DynamicDistribution: "" + # DynamicDistribution: "" # If using custom driver name, change the following to point to the custom name # Optional: true, Default value: csi-powermax.dellemc.com # Examples: "csi-driver-powermax", "csi-powermax.dellemc.com" diff --git a/samples/storageclass/powermax_srdf.yaml b/samples/storageclass/powermax_srdf.yaml index 125392be..037e2206 100644 --- a/samples/storageclass/powermax_srdf.yaml +++ b/samples/storageclass/powermax_srdf.yaml @@ -16,7 +16,7 @@ metadata: parameters: ####################### # k8s/driver attributes - ####################### + ####################### # "csi.storage.k8s.io/fstype" is used to set the filesystem type which will be used to format the new volume # Allowed values: # "ext4" - EXT4 File system @@ -51,19 +51,19 @@ parameters: # This is used in naming storage group, max of 3 letter # Optional: true # Example: "HL1", "HL2" - #HostLimitName: "HL1" + # HostLimitName: "HL1" # The MBs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitMBSec: "" + # HostIOLimitMBSec: "" # The IOs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitIOSec: "" + # HostIOLimitIOSec: "" # distribution of the Host IO limits for the storage class # Optional: true, Default: "" # Allowed values: Never","Always" or "OnFailure" only - #DynamicDistribution: "" + # DynamicDistribution: "" ######################## # CSM module attributes # ###################### diff --git a/samples/storageclass/powermax_vsphere.yaml b/samples/storageclass/powermax_vsphere.yaml index 1324faf1..ef9a3881 100644 --- a/samples/storageclass/powermax_vsphere.yaml +++ b/samples/storageclass/powermax_vsphere.yaml @@ -38,19 +38,19 @@ parameters: # This is used in naming storage group, max of 3 letter # Optional: true # Example: "HL1", "HL2" - #HostLimitName: "HL1" + # HostLimitName: "HL1" # The MBs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitMBSec: "" + # HostIOLimitMBSec: "" # The IOs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitIOSec: "" + # HostIOLimitIOSec: "" # distribution of the Host IO limits for the storage class # Optional: true, Default: "" # Allowed values: Never","Always" or "OnFailure" only - #DynamicDistribution: "" + # DynamicDistribution: "" # If using custom driver name, change the following to point to the custom name # Optional: true, Default value: csi-powermax.dellemc.com # Examples: "csi-driver-powermax", "csi-powermax.dellemc.com" diff --git a/samples/storageclass/powermax_xfs.yaml b/samples/storageclass/powermax_xfs.yaml index e0d0225f..a5547b53 100644 --- a/samples/storageclass/powermax_xfs.yaml +++ b/samples/storageclass/powermax_xfs.yaml @@ -35,19 +35,19 @@ parameters: # This is used in naming storage group, max of 3 letter # Optional: true # Example: "HL1", "HL2" - #HostLimitName: "HL1" + # HostLimitName: "HL1" # The MBs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitMBSec: "" + # HostIOLimitMBSec: "" # The IOs per Second Host IO limit for the storage class # Optional: true, Default: "" # Examples: 100, 200, NOLIMIT - #HostIOLimitIOSec: "" + # HostIOLimitIOSec: "" # distribution of the Host IO limits for the storage class # Optional: true, Default: "" # Allowed values: Never","Always" or "OnFailure" only - #DynamicDistribution: "" + # DynamicDistribution: "" # If using custom driver name, change the following to point to the custom name # Optional: true, Default value: csi-powermax.dellemc.com # Examples: "csi-driver-powermax", "csi-powermax.dellemc.com" diff --git a/service/deletion_worker_test.go b/service/deletion_worker_test.go new file mode 100644 index 00000000..21671da6 --- /dev/null +++ b/service/deletion_worker_test.go @@ -0,0 +1,160 @@ +/* + Copyright © 2024 Dell Inc. or its subsidiaries. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package service + +import ( + "fmt" + "testing" + + "github.com/dell/csi-powermax/v2/pkg/symmetrix" + types "github.com/dell/gopowermax/v2/types/v100" + "github.com/stretchr/testify/assert" +) + +func TestCaseUnlinkTarget(t *testing.T) { + pmaxClient, _ := symmetrix.GetPowerMaxClient("123") + symVol := &types.Volume{ + VolumeID: "vol-12345", + Type: "Thin", + Emulation: "FBA", + SSID: "ssid-001", + AllocatedPercent: 75, + CapacityGB: 1000.5, + FloatCapacityMB: 1024000.5, + CapacityCYL: 5000, + Status: "Online", + Reserved: true, + Pinned: false, + PhysicalName: "Disk 1", + VolumeIdentifier: "vol-identifier-123", + WWN: "1234567890ABCDEF", + Encapsulated: false, + NumberOfStorageGroups: 3, + NumberOfFrontEndPaths: 4, + StorageGroupIDList: []string{"sg-001", "sg-002", "sg-003"}, + RDFGroupIDList: []types.RDFGroupID{{RDFGroupNumber: 42, Label: "label"}, {RDFGroupNumber: 42, Label: "label"}}, + // SymmetrixPortKey: []SymmetrixPortKeyType{{Key: "port-1"}, {Key: "port-2"}}, + SnapSource: true, + SnapTarget: false, + CUImageBaseAddress: "0x1000", + HasEffectiveWWN: true, + EffectiveWWN: "abcdef1234567890", + EncapsulatedWWN: "encapsulated-wwn", + OracleInstanceName: "oracle-instance-01", + MobilityIDEnabled: true, + StorageGroups: []types.StorageGroupName{{StorageGroupName: "group1", ParentStorageGroupName: "group2"}, {StorageGroupName: "group1", ParentStorageGroupName: "group2"}}, + UnreducibleDataGB: 200.5, + NGUID: "nguid-1234", + } + + err := unlinkTarget(symVol, "123", "456", "a", 0, pmaxClient) + expectederr := fmt.Errorf("can't unlink as link state is not defined. retry after sometime") + if err != nil { + assert.Equal(t, expectederr, err) + } +} + +func TestIsValid(t *testing.T) { + dr := deletionRequest{ + DeviceID: "", + VolumeHandle: "456", + SymID: "788", + } + err := dr.isValid("") + expectederr := fmt.Errorf("device id can't be empty") + if err != nil { + assert.Equal(t, expectederr, err) + } + + dr1 := deletionRequest{ + DeviceID: "123", + VolumeHandle: "456", + SymID: "", + } + err = dr1.isValid("") + expectederr = fmt.Errorf("sym id can't be empty") + if err != nil { + assert.Equal(t, expectederr, err) + } + + dr2 := deletionRequest{ + DeviceID: "123", + VolumeHandle: "456", + SymID: "124", + } + err = dr2.isValid("_DEL") + expectederr = fmt.Errorf("device id doesn't contain the cluster prefix") + if err != nil { + assert.Equal(t, expectederr, err) + } + + dr3 := deletionRequest{ + DeviceID: "123", + VolumeHandle: "_DEL", + SymID: "124", + } + err = dr3.isValid("_DEL") + expectederr = fmt.Errorf("device has not been marked for deletion") + if err != nil { + assert.Equal(t, expectederr, err) + } +} + +func TestCaseGetDevice(t *testing.T) { + csidev := getDevice("1234", []*csiDevice{{}, {}}) + var expectedoutput *csiDevice + expectedoutput = nil + assert.Equal(t, expectedoutput, csidev) +} + +func TestCaseGetDeviceRanges(t *testing.T) { + sdID1 := symDeviceID{ + DeviceID: "1234", + IntVal: 1, + } + sdID2 := symDeviceID{ + DeviceID: "2345", + IntVal: 2, + } + expectedOutput := []deviceRange{ + { + Start: sdID1, + End: sdID2, + }, + } + devicerang := getDeviceRanges([]symDeviceID{{DeviceID: "1234", IntVal: 1}, {DeviceID: "2345", IntVal: 2}}) + assert.Equal(t, expectedOutput, devicerang) +} + +func TestCaseQueueDeviceForDeletion(t *testing.T) { + sdID1 := symDeviceID{ + DeviceID: "1234", + IntVal: 2, + } + csiDev := csiDevice{ + SymDeviceID: sdID1, + SymID: "123", + VolumeIdentifier: "123", + } + DeviceList1 := []*csiDevice{&csiDev, &csiDev} + deletionQueuevalue := deletionQueue{ + DeviceList: DeviceList1, + SymID: "123", + } + err := deletionQueuevalue.QueueDeviceForDeletion(csiDev) + expectederror := fmt.Errorf("%s", fmt.Sprintf("%s: found existing entry in deletion queue with volume handle: %s, added at: %v", + csiDev.print(), csiDev.VolumeIdentifier, csiDev.Status.AdditionTime)) + assert.Equal(t, expectederror, err) +} diff --git a/service/features/csi_extension.feature b/service/features/csi_extension.feature index 23ba6532..d1cadcde 100644 --- a/service/features/csi_extension.feature +++ b/service/features/csi_extension.feature @@ -41,6 +41,7 @@ Feature: PowerMax CSI interface @resiliency + @v2.11.0 Scenario: Call ValidateVolumeHostConnectivity with a connected node Given a PowerMax service And I call CreateVolume "volume1" @@ -53,6 +54,18 @@ Feature: PowerMax CSI interface Then I call ValidateVolumeHostConnectivity with "connected-node-faultyVolID" and symID "default" Then the error contains "invalid symID" + @resiliency + @v2.11.0 + Scenario: Call QueryArrayStatus + Given a PowerMax service + And I call QueryArrayStatus with and + Then the error contains + Examples: + | url | statusType | error | + | "/array-status/symmetrixID1" | "new" | "none" | + | "/array-status/symmetrixID2" | "old" | "none" | + | "/array-status/symmetrixID3" | "invalid" | "unexpected end of JSON input" | + | "" | "none" | "connection refused" | @resiliency @v2.11.0 diff --git a/service/features/migration.feature b/service/features/migration.feature index b6111dc7..a3e10457 100644 --- a/service/features/migration.feature +++ b/service/features/migration.feature @@ -74,4 +74,32 @@ Feature: PowerMax CSI Interface | volID | errormsg | | "csi-TST-volume1-000197900046-531379167" | "Could not find volume" | | "volume1" | "Invalid volume id" | + + @migration + @v1.0.0 + Scenario Outline: ArrayMigrate + Given a PowerMax service + And I call ArrayMigrate with + And the error contains + Examples: + | actionvalue | errormsg | + | "csimgr.ActionTypes_MG_MIGRATE" | "failed to create array migration environment for target array" | + | "csimgr.ActionTypes_MG_COMMIT" | "Not Found" | + | "" | "Invalid action" | + @migration + @v1.0.0 + Scenario Outline: ArrayMigrate + Given a PowerMax service + And I call ArrayMigrate with + Then I induce error + Then I induce error + And the error contains + Examples: + | induced1 | induced2 | actionvalue | errormsg | + | "GetOrCreateMigrationEnvironmentNoError" | "StorageGroupMigrationError" | "csimgr.ActionTypes_MG_MIGRATE" | "failed to create array migration environment for target array" | + | "GetOrCreateMigrationEnvironmentError" | "none" | "csimgr.ActionTypes_MG_MIGRATE" | "failed to create array migration environment for target array" | + | "none" | "none" | "" | "Invalid action" | + | "StorageGroupCommitNoError" | "AddVolumesToRemoteSGNoError" | "csimgr.ActionTypes_MG_COMMIT" | "Not Found" | + | "StorageGroupCommitNoError" | "AddVolumesToRemoteSGError" | "csimgr.ActionTypes_MG_COMMIT" | "Not Found" | + | "StorageGroupCommitError" | "none" | "csimgr.ActionTypes_MG_COMMIT" | "Not Found" | \ No newline at end of file diff --git a/service/features/node_publish_unpublish.feature b/service/features/node_publish_unpublish.feature index d53955ff..3eb860fd 100644 --- a/service/features/node_publish_unpublish.feature +++ b/service/features/node_publish_unpublish.feature @@ -31,6 +31,13 @@ Feature: PowerMax CSI interface | "FC" | "mount" | "single-node-multi-writer" | "none" | "none" | | "ISCSI" | "mount" | "single-node-single-writer" | "none" | "none" | | "ISCSI" | "mount" | "single-node-multi-writer" | "none" | "none" | + | "NVME" | "mount" | "single-writer" | "xfs" | "none" | + | "NVME" | "mount" | "single-writer" | "ext4" | "none" | + | "NVME" | "mount" | "multiple-writer" | "ext4" | "Mount volumes do not support AccessMode" | + | "NVME" | "block" | "single-writer" | "none" | "none" | + | "NVME" | "block" | "multiple-writer" | "none" | "none" | + | "NVME" | "mount" | "single-node-single-writer" | "none" | "none" | + | "NVME" | "mount" | "single-node-multi-writer" | "none" | "none" | @nodePublish @v1.0.0 @@ -58,7 +65,47 @@ Feature: PowerMax CSI interface | "ISCSI" | "UnspecifiedNodeName" | "Error getting NodeName from the environment" | | "ISCSI" | "NodePublishNoTargetPath" | "Target Path is required" | | "ISCSI" | "GobrickConnectError" | "induced ConnectVolumeError" | + | "NVME" | "TargetNotCreatedForNodePublish" | "none" | + | "NVME" | "BadVolumeIdentifier" | "bad volume identifier" | + | "NVME" | "UnspecifiedNodeName" | "Error getting NodeName from the environment" | + | "NVME" | "NodePublishNoTargetPath" | "Target Path is required" | + | "NVME" | "GobrickConnectError" | "induced ConnectVolumeError" | +@nodePublish +@v1.0.0 + Scenario Outline: Node stage volume with vSphere enabled + Given a PowerMax service + And I call set attribute IsVsphereEnabled "true" + And I set transport protocol to + And I have a Node "node1" with MaskingView + And a controller published volume + When I call NodeStageVolume with simulator + Then the error contains + + Examples: + | transport | errormsg | + | "FC" | "could not attach RDM" | + | "NVME" | "could not attach RDM" | + | "ISCSI" | "could not attach RDM" | + +@nodePublish +@v1.0.0 + Scenario Outline: Node unstage volume with vSphere enabled + Given a PowerMax service + And I call set attribute IsVsphereEnabled "true" + And I set transport protocol to + And I have a Node "node1" with MaskingView + And a controller published volume + When I call NodeStageVolume with simulator + And I call NodeUnstageVolume with simulator + And there are no remaining mounts + Then the error contains + + Examples: + | transport | errormsg | + | "FC" | "none" | + | "NVME" | "none" | + | "ISCSI" | "none" | @nodePublish @v1.0.0 diff --git a/service/features/service.feature b/service/features/service.feature index a58f5c13..f837e7c4 100644 --- a/service/features/service.feature +++ b/service/features/service.feature @@ -704,6 +704,30 @@ Feature: PowerMax CSI interface When I call getAndConfigureArrayISCSITargets Then 2 targets are returned +@v1.3.0 + Scenario: Test getAndConfigureArrayNVMeTCPTargets + Given a PowerMax service + And I set transport protocol to "NVME" + And I have a Node "node1" with MaskingView + When I call getAndConfigureArrayNVMeTCPTargets + Then 2 nvmetcp targets are returned + +@v1.3.0 + Scenario: Test getAndConfigureArrayNVMeTCPTargets after cache was populated + Given a PowerMax service + And I set transport protocol to "NVME" + And I have a Node "node1" with MaskingView + When I call getAndConfigureArrayNVMeTCPTargets + Then 2 nvmetcp targets are returned + +@v1.3.0 + Scenario: Test getAndConfigureArrayNVMeTCPTargets without masking view + Given a PowerMax service + And I set transport protocol to "NVME" + And I invalidate symToMaskingViewTarget cache + When I call getAndConfigureArrayNVMeTCPTargets + Then 0 nvmetcp targets are returned + @v1.4.0 Scenario: Validate nodeHostSetup with temporary failure Given a PowerMax service @@ -825,4 +849,3 @@ Scenario: Create a fileSystem volume with error And I induce error "GetFileSystemError" And I call fileSystem CreateVolume "volume1" Then the error contains "induced error" - diff --git a/service/gobrick_mock_test.go b/service/gobrick_mock_test.go index 1b3c59b1..bbaf752f 100644 --- a/service/gobrick_mock_test.go +++ b/service/gobrick_mock_test.go @@ -126,3 +126,21 @@ func (g *mockFCGobrick) ConnectRDMVolume(_ context.Context, info gobrick.RDMVolu gofsutil.GOFSMockWWNToDevice[nodePublishWWN] = nodePublishBlockDevicePath return dev, nil } + +type mockNVMeTCPConnector struct{} + +func (m *mockNVMeTCPConnector) ConnectVolume(_ context.Context, _ gobrick.NVMeVolumeInfo, _ bool) (gobrick.Device, error) { + if mockGobrickInducedErrors.ConnectVolumeError { + return gobrick.Device{}, fmt.Errorf("induced ConnectVolumeError") + } + return gobrick.Device{}, nil +} + +func (m *mockNVMeTCPConnector) DisconnectVolumeByDeviceName(_ context.Context, _ string) error { + return nil +} + +func (m *mockNVMeTCPConnector) GetInitiatorName(_ context.Context) ([]string, error) { + result := make([]string, 0) + return result, nil +} diff --git a/service/mock-data/directorIDList.json b/service/mock-data/directorIDList.json new file mode 100644 index 00000000..bb5e4ac9 --- /dev/null +++ b/service/mock-data/directorIDList.json @@ -0,0 +1,8 @@ +{ + "directorId": [ + "RF-1F", + "RF-2F", + "SE-1E", + "SE-2E" + ] +} diff --git a/service/mock-data/director_template.json b/service/mock-data/director_template.json new file mode 100644 index 00000000..3b55cf73 --- /dev/null +++ b/service/mock-data/director_template.json @@ -0,0 +1,8 @@ +{ + "availability": "Online", + "director_number": 66, + "director_slot_number": 2, + "directorId": "__DIRECTOR_ID__", + "num_of_ports": 4, + "num_of_cores": 4 +} diff --git a/service/mock-data/hostIDList.json b/service/mock-data/hostIDList.json new file mode 100644 index 00000000..c8f237c4 --- /dev/null +++ b/service/mock-data/hostIDList.json @@ -0,0 +1,19 @@ +{ + "hostId": [ + "IS_lqam9024_IG", + "IS_LQAM9025_IG", + "l2se0042_ig", + "l2se0042_iscsi_ig", + "l2se0046_ig", + "l2se0046_iscsi_ig", + "l2se0049_ig", + "l2se0132_IG", + "l2se0221_IG", + "l2se0226_Initiator", + "lqam9025_FC", + "LQTF0116_IG", + "lqtf0118_ig", + "Test", + "csi-node-node1" + ] +} \ No newline at end of file diff --git a/service/mock-data/host_template.json b/service/mock-data/host_template.json new file mode 100644 index 00000000..97459459 --- /dev/null +++ b/service/mock-data/host_template.json @@ -0,0 +1,18 @@ +{ + "hostId": "__HOST_ID__", + "num_of_masking_views": 1, + "num_of_initiators": 1, + "num_of_host_groups": 0, + "port_flags_override": false, + "consistent_lun": false, + "enabled_flags": "", + "disabled_flags": "", + "type": "iSCSI", + "initiator": [ + "10000000c9f3b094" + ], + "maskingview": [ + "__MV_ID__" + ], + "num_of_powerpath_hosts": 0 +} \ No newline at end of file diff --git a/service/mock-data/initiatorIDList.json b/service/mock-data/initiatorIDList.json new file mode 100644 index 00000000..b605dc17 --- /dev/null +++ b/service/mock-data/initiatorIDList.json @@ -0,0 +1,78 @@ +{ + "initiatorId": [ + "FA-1D:6:10000000c98096f0", + "FA-1D:5:10000000c9ae2ada", + "FA-2D:5:10000000c9ae2ada", + "FA-1D:4:10000000c9f3adff", + "FA-2D:4:10000000c9f3adff", + "FA-2D:5:10000000c9f3b07c", + "FA-1D:5:10000000c9f3b07c", + "FA-2D:4:10000000c9f3b07d", + "FA-2D:5:10000000c9f3b07d", + "FA-1D:5:10000000c9f3b07d", + "FA-2D:4:10000000c9f3b07f", + "FA-1D:4:10000000c9f3b07f", + "FA-2D:5:10000000c9f3b08f", + "FA-1D:5:10000000c9f3b094", + "FA-2D:5:10000000c9f3b0a1", + "FA-1D:5:10000000c9f3b0a1", + "FA-1D:4:10000000c9fbfd36", + "FA-1D:4:10000000c9fc3f82", + "FA-1D:9:10000090fa19149b", + "FA-1D:4:10000090fa1cdf76", + "FA-1D:4:10000090fa1cecea", + "FA-2D:4:10000090fa1cecea", + "FA-2D:4:10000090fa1cef5a", + "FA-1D:4:10000090fa1cef5a", + "FA-2D:4:10000090fa1cf2b2", + "FA-2D:5:10000090fa1cf2b2", + "FA-1D:4:10000090fa1cf2b2", + "FA-1D:5:10000090fa1cf2b2", + "FA-2D:4:10000090fa1cf2b3", + "FA-2D:5:10000090fa1cf2b3", + "FA-1D:4:10000090fa1cf2b3", + "FA-1D:5:10000090fa1cf2b3", + "FA-1D:4:10000090fa1cf36a", + "FA-2D:4:10000090fa1cf36a", + "FA-1D:4:10000090fa1cf36b", + "FA-2D:4:10000090fa1cf36b", + "FA-1D:4:10000090fa6603b6", + "FA-1D:5:10000090fa6603b6", + "FA-1D:4:10000090fa6603b7", + "FA-1D:5:10000090fa6603b7", + "FA-1D:4:10000090fa66060a", + "FA-1D:5:10000090fa66060b", + "FA-1D:4:10000090fa662bc4", + "FA-1D:5:10000090fa662bc5", + "FA-1D:4:10000090fa662dc4", + "FA-1D:5:10000090fa662dc5", + "FA-1D:4:10000090fa9278dc", + "FA-1D:5:10000090fa9278dd", + "FA-1D:4:10000090fa9278f8", + "FA-1D:4:10000090fa9278f9", + "FA-2D:4:10000090fa927908", + "FA-1D:4:10000090fa927908", + "FA-2D:4:10000090fa927909", + "FA-1D:4:10000090fa927909", + "FA-2D:4:10000090fa927924", + "FA-2D:5:10000090fa927925", + "FA-2D:4:21fd000533c50c00", + "FA-2D:5:21fd000533c50c00", + "FA-1D:4:21fd000533c50c00", + "FA-1D:5:21fd000533c50c00", + "FA-1D:5:50000972f8023918", + "FA-2D:5:50000972f8023918", + "FA-1D:5:50000972f8023919", + "FA-2D:5:50000972f8023919", + "FA-2D:5:50000973b000b805", + "FA-1D:5:50000973b000b845", + "FA-2D:4:50000973b000b847", + "FA-2D:5:50000973b000b84b", + "SE-1E:000:iqn.1993-08.org.debian:01:5ae293b352a2", + "SE-1E:000:iqn.1993-08.org.debian:01:8f21cc8ad2a7", + "SE-2E:000:iqn.1993-08.org.debian:01:8f21cc8ad2a7", + "SE-1E:000:iqn.1993-08.org.debian:01:a86eeef2c837", + "SE-2E:001:iqn.1993-08.org.debian:01:a86eeef2c837", + "SE-2E:000:iqn.1993-08.org.debian:01:a86eeef2c837" + ] +} \ No newline at end of file diff --git a/service/mock-data/initiator_template.json b/service/mock-data/initiator_template.json new file mode 100644 index 00000000..50a605d7 --- /dev/null +++ b/service/mock-data/initiator_template.json @@ -0,0 +1,19 @@ +{ + "initiatorId": "__INITIATOR_ID__", + "symmetrixPortKey": [ + { + "directorId": "FA-1D", + "portId": "6" + } + ], + "type": "GigE", + "host": "__INITIATOR_HOST__", + "ip_address": "192.168.1.175", + "logged_in": true, + "on_fabric": true, + "flags_in_effect": "Common_Serial_Number(C), SCSI_3(SC3), SPC2_Protocol_Version(SPC2)", + "num_of_vols": 0, + "num_of_host_groups": 0, + "num_of_masking_views": 0, + "num_of_powerpath_hosts": 0 +} diff --git a/service/mock-data/masking_view_connections_template.json b/service/mock-data/masking_view_connections_template.json new file mode 100644 index 00000000..075e7f39 --- /dev/null +++ b/service/mock-data/masking_view_connections_template.json @@ -0,0 +1,59 @@ +{ + "maskingViewConnection": [ + { + "volumeId": "__VOLUME_ID__", + "host_lun_address": "0001", + "cap_gb": "0.1", + "initiatorId": "iqn.1993-08.org.debian:01:8f21cc8ad2a7", + "dir_port": "SE-1E:000", + "logged_in": false, + "on_fabric": true + }, + { + "volumeId": "__VOLUME_ID__", + "host_lun_address": "0001", + "cap_gb": "0.1", + "initiatorId": "iqn.1993-08.org.debian:01:8f21cc8ad2a7", + "dir_port": "SE-2E:000", + "logged_in": false, + "on_fabric": true + }, + { + "volumeId": "22222", + "host_lun_address": "0002", + "cap_gb": "0.1", + "initiatorId": "iqn.1993-08.org.debian:01:8f21cc8ad2a7", + "dir_port": "SE-2E:000", + "logged_in": false, + "on_fabric": true + }, + { + "volumeId": "__VOLUME_ID__", + "host_lun_address": "0001", + "cap_gb": "0.1", + "initiatorId": "iqn.1993-08.org.debian:01:8f21cc8ad2a7", + "dir_port": "SE-1E:000", + "logged_in": false, + "on_fabric": true + }, + { + "volumeId": "__VOLUME_ID__", + "host_lun_address": "0001", + "cap_gb": "0.1", + "initiatorId": "iqn.1993-08.org.debian:01:8f21cc8ad2a7", + "dir_port": "ED-1B:000", + "logged_in": false, + "on_fabric": true + }, + { + "volumeId": "__VOLUME_ID__", + "host_lun_address": "0001", + "cap_gb": "0.1", + "initiatorId": "iqn.1993-08.org.debian:01:8f21cc8ad2a7", + "dir_port": "DF-1C:000", + "logged_in": false, + "on_fabric": true + } + ] +} + diff --git a/service/mock-data/masking_view_template.json b/service/mock-data/masking_view_template.json new file mode 100644 index 00000000..ee1056a3 --- /dev/null +++ b/service/mock-data/masking_view_template.json @@ -0,0 +1,7 @@ +{ + "maskingViewId": "__MASKING_VIEW_ID__", + "hostId": "__HOST_ID__", + "hostGroupId": "__HOST_GROUP_ID__", + "portGroupId": "__PORT_GROUP_ID__", + "storageGroupId": "__STORAGE_GROUP_ID__" +} diff --git a/service/mock-data/portGroupIDList.json b/service/mock-data/portGroupIDList.json new file mode 100644 index 00000000..8d83a85f --- /dev/null +++ b/service/mock-data/portGroupIDList.json @@ -0,0 +1,20 @@ +{ + "portGroupId": [ + "CSI-FC-PG", + "IS_lqam9024_2E_PG", + "IS_lqam9024_PG", + "IS_lqam9025_PG", + "IS_OWC2_PG", + "l2se0042_iscsi_pg", + "l2se0042_pg", + "l2se0046_iscsi_pg", + "l2se0046_pg", + "l2se0049_pg", + "l2se0132_PG", + "l2se0133_PG", + "l2se0221_PG", + "l2se0226_Port", + "LQTF0116_PG", + "lqtf0118_pg" + ] +} \ No newline at end of file diff --git a/service/mock-data/portIDList.json b/service/mock-data/portIDList.json new file mode 100644 index 00000000..d76cb821 --- /dev/null +++ b/service/mock-data/portIDList.json @@ -0,0 +1,12 @@ +{ + "symmetrixPortKey": [ + { + "directorId": "__DIRECTOR_ID__", + "portId": "0" + }, + { + "directorId": "__DIRECTOR_ID__", + "portId": "1" + } + ] +} \ No newline at end of file diff --git a/service/mock-data/port_group_template.json b/service/mock-data/port_group_template.json new file mode 100644 index 00000000..6f1ccee8 --- /dev/null +++ b/service/mock-data/port_group_template.json @@ -0,0 +1,24 @@ +{ + "portGroupId": "__PORT_GROUP_ID__", + "symmetrixPortKey": [ + { + "directorId": "SE-2E", + "portId": "SE-2E:000" + }, + { + "directorId": "SE-1E", + "portId": "SE-1E:000" + } + ], + "num_of_ports": 2, + "num_of_masking_views": 6, + "type": "iSCSI", + "maskingview": [ + "csi-mv-lqam9031", + "csi-mv-lqam9030", + "csi-mv-KPC-lqam9025", + "csi-mv-XYZ-Node1", + "csi-mv-ERY-lqam9024-10-243-149-24", + "csi-mv-TW-lqam9032" + ] +} diff --git a/service/mock-data/port_template.json b/service/mock-data/port_template.json new file mode 100644 index 00000000..22ec4796 --- /dev/null +++ b/service/mock-data/port_template.json @@ -0,0 +1,41 @@ +{ + "symmetrixPort": { + "symmetrixPortKey": { + "directorId": "__DIRECTOR_ID__", + "portId": "__PORT_ID__" + }, + "port_status": "ON", + "director_status": "Online", + "type": "GigE", + "num_of_cores": 4, + "identifier": "iqn.1992-04.com.emc:600009700bcbb70e3287017400000001", + "negotiated_speed": "0", + "num_of_port_groups": 3, + "num_of_masking_views": 2, + "num_of_mapped_vols": 10, + "vcm_state": "Enabled", + "aclx": true, + "vnx_attached": false, + "avoid_reset_broadcast": false, + "environ_set": false, + "disable_q_reset_on_ua": false, + "soft_reset": false, + "scsi_3": true, + "scsi_support1": true, + "spc2_protocol_version": true, + "portgroup": [ + "IS_lqam9024_PG", + "IS_lqam9024_2E_PG", + "IS_lqam9025_PG" + ], + "maskingview": [ + "IS_lqam9024_view", + "lqam9024_diamond_sg_mv_MV" + ], + "max_speed": "0", + "iscsi_target": true, + "ip_addresses": [ + "1.1.1.1" + ] + } +} diff --git a/service/mock-data/storageGroupIDList.json b/service/mock-data/storageGroupIDList.json new file mode 100644 index 00000000..bedc24c9 --- /dev/null +++ b/service/mock-data/storageGroupIDList.json @@ -0,0 +1,20 @@ +{ + "storageGroupId": [ + "CSI-lqam9025-F-PG_1D4-SG", + "CSI-lqam9025-F-PG_1D4-SG_1", + "CSI-lqam9025-SRP_1-PG_1D4-Diamond-SG", + "CSI-lqam9025-SRP_1-PG_1D4-Silver-SG", + "CSI-None-no-slo-SG", + "CSI-None-None-SG", + "CSI-SRP_1-Diamond-SG", + "CSI-SRP_1-None-SG", + "CSI-SRP_1-Optimized-SG", + "CSI-SRP_1-Silver-SG", + "l2se0049_sg", + "lqam9020_SG_MV", + "lqam9024_sg", + "lqam9024_sq2", + "lqam9026_sg2", + "csi-no-srp-sg-node1" + ] +} diff --git a/service/mock-data/storageResourcePool.json b/service/mock-data/storageResourcePool.json new file mode 100644 index 00000000..a62510e6 --- /dev/null +++ b/service/mock-data/storageResourcePool.json @@ -0,0 +1,5 @@ +{ + "srpId": [ + "SRP_1" + ] +} diff --git a/service/mock-data/storage_group_snapshot_policy.json b/service/mock-data/storage_group_snapshot_policy.json new file mode 100644 index 00000000..8e42d158 --- /dev/null +++ b/service/mock-data/storage_group_snapshot_policy.json @@ -0,0 +1,9 @@ +{ + "symmetrixID": "000000000001", + "snapshot_policy_id": "IntSPA", + "storage_group_id": "IntSGA", + "compliance": "NONE", + "snapshots_in_time_window": 0, + "total_snapshots": 0, + "suspended": false +} \ No newline at end of file diff --git a/service/mock-data/storage_group_template.json b/service/mock-data/storage_group_template.json new file mode 100644 index 00000000..bb7467ac --- /dev/null +++ b/service/mock-data/storage_group_template.json @@ -0,0 +1,23 @@ +{ + "storageGroupId": "__STORAGE_GROUP_ID__", + "slo": "Optimized", + "base_slo_name": "Optimized", + "service_level": "Optimized", + "srp": "__SRP_ID__", + "slo_compliance": "STABLE", + "num_of_vols": __NUMBER_OF_VOLUMES__, + "num_of_child_sgs": 0, + "num_of_parent_sgs": 0, + "num_of_masking_views": __NUM_OF_MASKING_VIEWS__, + "num_of_snapshots": 0, + "cap_gb": 534.04, + "device_emulation": "FBA", + "type": "Standalone", + "unprotected": true, + "compression": true, + "VPSaved": "100.0%", + "vp_saved_percent": 100, + "maskingview": [ + "csi-mv-node1" + ] +} diff --git a/service/mock-data/storage_pool_template.json b/service/mock-data/storage_pool_template.json new file mode 100644 index 00000000..1ccea099 --- /dev/null +++ b/service/mock-data/storage_pool_template.json @@ -0,0 +1,26 @@ +{ + "effective_used_capacity_percent": 41, + "rdfa_dse": true, + "num_of_disk_groups": 1, + "srpId": "__SRP_ID__", + "emulation": "FBA", + "total_srdf_dse_allocated_cap_gb": 0.0, + "srp_capacity": { + "usable_total_tb": 3.42, + "subscribed_total_tb": 0.4, + "subscribed_allocated_tb": 0.18, + "snapshot_total_tb": 0.0, + "usable_used_tb": 1.39, + "snapshot_modified_tb": 0.0 + }, + "reserved_cap_percent": 10, + "diskGroupId": [ + "1" + ], + "srp_efficiency": { + "overall_efficiency_ratio_to_one": 2.2, + "virtual_provisioning_savings_ratio_to_one": 2.2, + "data_reduction_enabled_percent": 0.0 + }, + "compression_state": "Disabled" +} diff --git a/service/mock-data/symmetrix13.json b/service/mock-data/symmetrix13.json new file mode 100644 index 00000000..c715765d --- /dev/null +++ b/service/mock-data/symmetrix13.json @@ -0,0 +1,49 @@ +{ + "symmetrixId": "000000000013", + "local": true, + "model": "PowerMax_2500", + "microcode": "6079.175.0", + "microcode_date": "10-12-2023", + "microcode_registered_build": 268, + "microcode_package_version": "10.0.1.3 (HotFix 10108, Build 6079_175/0268, 2023-10-12 19:17:49)", + "cache_size_mb": 454656, + "fe_dir_count": 4, + "be_dir_count": 4, + "rdf_dir_count": 4, + "max_hyper_per_disk": 512, + "dev_masking_aclx_config": "Enabled", + "aclx_lun_addr": 0, + "config_change_state": "Enabled", + "disk_group_assignment": "In Use", + "raid_config": "RAID-5 (4+1)", + "pav_model": "DynamicStandardPAV", + "pav_alias_limit": 255, + "sddf_state": "Enabled", + "srdfa_max_throttle": 0, + "srdfa_cache_usage": 75, + "max_sys_slot": 1656000, + "max_dev_slot": 82800, + "last_ipl_time": "2023-02-20 16:34:27", + "last_fast_ipl_time": "2023-10-16 23:46:25", + "symm_alert": "11/39", + "service_level_rt_multiplier": "Default", + "fba_geo_emulation": "Native", + "cache_partition": "Disabled", + "disk_service_state": "Deferred", + "data_encryption": "Enabled", + "rep_cache_usage": 0, + "device_count": 15458, + "disk_count": 33, + "spare_disk_count": 1, + "unconfig_disk_count": 0, + "reliability_state": "Degraded-NoRebuild", + "all_flash": true, + "system_sized_property": [ + { + "srp_name": "SRP_1", + "sized_fba_data_reduction_ratio": "4.0:1", + "sized_fba_capacity_tb": 1196, + "sized_fba_reducible_percent": 90 + } + ] +} \ No newline at end of file diff --git a/service/mock-data/symmetrix46.json b/service/mock-data/symmetrix46.json new file mode 100644 index 00000000..bf8510f2 --- /dev/null +++ b/service/mock-data/symmetrix46.json @@ -0,0 +1,11 @@ +{ + "symmetrixId": "000197900046", + "device_count": 1045, + "ucode": "5978.221.221", + "model": "PowerMax_2000", + "local": true, + "all_flash": true, + "disk_count": 8, + "cache_size_mb": 203776, + "data_encryption": "Disabled" +} diff --git a/service/mock-data/symmetrix47.json b/service/mock-data/symmetrix47.json new file mode 100644 index 00000000..c6d92b3d --- /dev/null +++ b/service/mock-data/symmetrix47.json @@ -0,0 +1,11 @@ +{ + "symmetrixId": "000197900047", + "device_count": 1045, + "ucode": "5978.441.441", + "model": "PowerMax_2000", + "local": true, + "all_flash": true, + "disk_count": 8, + "cache_size_mb": 203776, + "data_encryption": "Disabled" +} diff --git a/service/mock-data/symmetrixList.json b/service/mock-data/symmetrixList.json new file mode 100644 index 00000000..b4d440d0 --- /dev/null +++ b/service/mock-data/symmetrixList.json @@ -0,0 +1,7 @@ +{ + "symmetrixId": [ + "000197802104", + "000197900046", + "000197900047" + ] +} diff --git a/service/mock-data/volumeList.json b/service/mock-data/volumeList.json new file mode 100644 index 00000000..be861471 --- /dev/null +++ b/service/mock-data/volumeList.json @@ -0,0 +1,3012 @@ +{ + "resultList": { + "result": [ + { + "volumeId": "00001" + }, + { + "volumeId": "00002" + }, + { + "volumeId": "00003" + }, + { + "volumeId": "00004" + }, + { + "volumeId": "00005" + }, + { + "volumeId": "00006" + }, + { + "volumeId": "00007" + }, + { + "volumeId": "00008" + }, + { + "volumeId": "00009" + }, + { + "volumeId": "0000A" + }, + { + "volumeId": "0000B" + }, + { + "volumeId": "0000C" + }, + { + "volumeId": "0000D" + }, + { + "volumeId": "0000E" + }, + { + "volumeId": "0000F" + }, + { + "volumeId": "00010" + }, + { + "volumeId": "00011" + }, + { + "volumeId": "00012" + }, + { + "volumeId": "00013" + }, + { + "volumeId": "00014" + }, + { + "volumeId": "00015" + }, + { + "volumeId": "00016" + }, + { + "volumeId": "00017" + }, + { + "volumeId": "00018" + }, + { + "volumeId": "00019" + }, + { + "volumeId": "0001A" + }, + { + "volumeId": "0001B" + }, + { + "volumeId": "0001C" + }, + { + "volumeId": "0001D" + }, + { + "volumeId": "0001E" + }, + { + "volumeId": "0001F" + }, + { + "volumeId": "00020" + }, + { + "volumeId": "00021" + }, + { + "volumeId": "00022" + }, + { + "volumeId": "00023" + }, + { + "volumeId": "00024" + }, + { + "volumeId": "00025" + }, + { + "volumeId": "00026" + }, + { + "volumeId": "00027" + }, + { + "volumeId": "00028" + }, + { + "volumeId": "00029" + }, + { + "volumeId": "0002A" + }, + { + "volumeId": "0002B" + }, + { + "volumeId": "0002C" + }, + { + "volumeId": "0002D" + }, + { + "volumeId": "0002E" + }, + { + "volumeId": "0002F" + }, + { + "volumeId": "00030" + }, + { + "volumeId": "00031" + }, + { + "volumeId": "00032" + }, + { + "volumeId": "00033" + }, + { + "volumeId": "00034" + }, + { + "volumeId": "00035" + }, + { + "volumeId": "00036" + }, + { + "volumeId": "00037" + }, + { + "volumeId": "00038" + }, + { + "volumeId": "00039" + }, + { + "volumeId": "0003A" + }, + { + "volumeId": "0003B" + }, + { + "volumeId": "0003C" + }, + { + "volumeId": "0003D" + }, + { + "volumeId": "0003E" + }, + { + "volumeId": "0003F" + }, + { + "volumeId": "00040" + }, + { + "volumeId": "00041" + }, + { + "volumeId": "00042" + }, + { + "volumeId": "00043" + }, + { + "volumeId": "00044" + }, + { + "volumeId": "00045" + }, + { + "volumeId": "00046" + }, + { + "volumeId": "00047" + }, + { + "volumeId": "00048" + }, + { + "volumeId": "00049" + }, + { + "volumeId": "0004A" + }, + { + "volumeId": "0004B" + }, + { + "volumeId": "0004C" + }, + { + "volumeId": "0004D" + }, + { + "volumeId": "0004E" + }, + { + "volumeId": "0004F" + }, + { + "volumeId": "00050" + }, + { + "volumeId": "00051" + }, + { + "volumeId": "00052" + }, + { + "volumeId": "00053" + }, + { + "volumeId": "00054" + }, + { + "volumeId": "00055" + }, + { + "volumeId": "00056" + }, + { + "volumeId": "00057" + }, + { + "volumeId": "00058" + }, + { + "volumeId": "00059" + }, + { + "volumeId": "0005A" + }, + { + "volumeId": "0005B" + }, + { + "volumeId": "0005C" + }, + { + "volumeId": "0005D" + }, + { + "volumeId": "0005E" + }, + { + "volumeId": "0005F" + }, + { + "volumeId": "00060" + }, + { + "volumeId": "00061" + }, + { + "volumeId": "00062" + }, + { + "volumeId": "00063" + }, + { + "volumeId": "00064" + }, + { + "volumeId": "00065" + }, + { + "volumeId": "00066" + }, + { + "volumeId": "00067" + }, + { + "volumeId": "00068" + }, + { + "volumeId": "00069" + }, + { + "volumeId": "0006A" + }, + { + "volumeId": "0006B" + }, + { + "volumeId": "0006C" + }, + { + "volumeId": "0006D" + }, + { + "volumeId": "0006E" + }, + { + "volumeId": "0006F" + }, + { + "volumeId": "00070" + }, + { + "volumeId": "00071" + }, + { + "volumeId": "00072" + }, + { + "volumeId": "00073" + }, + { + "volumeId": "00074" + }, + { + "volumeId": "00075" + }, + { + "volumeId": "00076" + }, + { + "volumeId": "00077" + }, + { + "volumeId": "00078" + }, + { + "volumeId": "00079" + }, + { + "volumeId": "0007A" + }, + { + "volumeId": "0007B" + }, + { + "volumeId": "0007C" + }, + { + "volumeId": "0007D" + }, + { + "volumeId": "0007E" + }, + { + "volumeId": "0007F" + }, + { + "volumeId": "00080" + }, + { + "volumeId": "00081" + }, + { + "volumeId": "00082" + }, + { + "volumeId": "00083" + }, + { + "volumeId": "00084" + }, + { + "volumeId": "00085" + }, + { + "volumeId": "00086" + }, + { + "volumeId": "00087" + }, + { + "volumeId": "00088" + }, + { + "volumeId": "00089" + }, + { + "volumeId": "0008A" + }, + { + "volumeId": "0008B" + }, + { + "volumeId": "0008C" + }, + { + "volumeId": "0008D" + }, + { + "volumeId": "0008E" + }, + { + "volumeId": "0008F" + }, + { + "volumeId": "00090" + }, + { + "volumeId": "00091" + }, + { + "volumeId": "00092" + }, + { + "volumeId": "00093" + }, + { + "volumeId": "00094" + }, + { + "volumeId": "00095" + }, + { + "volumeId": "00096" + }, + { + "volumeId": "00097" + }, + { + "volumeId": "00098" + }, + { + "volumeId": "00099" + }, + { + "volumeId": "0009A" + }, + { + "volumeId": "0009B" + }, + { + "volumeId": "0009C" + }, + { + "volumeId": "0009D" + }, + { + "volumeId": "0009E" + }, + { + "volumeId": "0009F" + }, + { + "volumeId": "000A0" + }, + { + "volumeId": "000A1" + }, + { + "volumeId": "000A2" + }, + { + "volumeId": "000A3" + }, + { + "volumeId": "000A4" + }, + { + "volumeId": "000A5" + }, + { + "volumeId": "000A6" + }, + { + "volumeId": "000A7" + }, + { + "volumeId": "000A8" + }, + { + "volumeId": "000A9" + }, + { + "volumeId": "000AA" + }, + { + "volumeId": "000AB" + }, + { + "volumeId": "000AC" + }, + { + "volumeId": "000AD" + }, + { + "volumeId": "000AE" + }, + { + "volumeId": "000AF" + }, + { + "volumeId": "000B0" + }, + { + "volumeId": "000B1" + }, + { + "volumeId": "000B2" + }, + { + "volumeId": "000B3" + }, + { + "volumeId": "000B4" + }, + { + "volumeId": "000B5" + }, + { + "volumeId": "000B6" + }, + { + "volumeId": "000B7" + }, + { + "volumeId": "000B8" + }, + { + "volumeId": "000B9" + }, + { + "volumeId": "000BA" + }, + { + "volumeId": "000BB" + }, + { + "volumeId": "000BC" + }, + { + "volumeId": "000BD" + }, + { + "volumeId": "000BE" + }, + { + "volumeId": "000BF" + }, + { + "volumeId": "000C0" + }, + { + "volumeId": "000C1" + }, + { + "volumeId": "000C2" + }, + { + "volumeId": "000C3" + }, + { + "volumeId": "000C4" + }, + { + "volumeId": "000C5" + }, + { + "volumeId": "000C6" + }, + { + "volumeId": "000C7" + }, + { + "volumeId": "000C8" + }, + { + "volumeId": "000C9" + }, + { + "volumeId": "000CA" + }, + { + "volumeId": "000CB" + }, + { + "volumeId": "000CC" + }, + { + "volumeId": "000CD" + }, + { + "volumeId": "000CE" + }, + { + "volumeId": "000CF" + }, + { + "volumeId": "000D0" + }, + { + "volumeId": "000D1" + }, + { + "volumeId": "000D2" + }, + { + "volumeId": "000D3" + }, + { + "volumeId": "000D4" + }, + { + "volumeId": "000D5" + }, + { + "volumeId": "000D6" + }, + { + "volumeId": "000D7" + }, + { + "volumeId": "000D8" + }, + { + "volumeId": "000D9" + }, + { + "volumeId": "000DA" + }, + { + "volumeId": "000DB" + }, + { + "volumeId": "000DC" + }, + { + "volumeId": "000DD" + }, + { + "volumeId": "000DE" + }, + { + "volumeId": "000DF" + }, + { + "volumeId": "000E0" + }, + { + "volumeId": "000E1" + }, + { + "volumeId": "000E2" + }, + { + "volumeId": "000E3" + }, + { + "volumeId": "000E4" + }, + { + "volumeId": "000E5" + }, + { + "volumeId": "000E6" + }, + { + "volumeId": "000E7" + }, + { + "volumeId": "000E8" + }, + { + "volumeId": "000E9" + }, + { + "volumeId": "000EA" + }, + { + "volumeId": "000EB" + }, + { + "volumeId": "000EC" + }, + { + "volumeId": "000ED" + }, + { + "volumeId": "000EE" + }, + { + "volumeId": "000EF" + }, + { + "volumeId": "000F0" + }, + { + "volumeId": "000F1" + }, + { + "volumeId": "000F2" + }, + { + "volumeId": "000F3" + }, + { + "volumeId": "000F4" + }, + { + "volumeId": "000F5" + }, + { + "volumeId": "000F6" + }, + { + "volumeId": "000F7" + }, + { + "volumeId": "000F8" + }, + { + "volumeId": "000F9" + }, + { + "volumeId": "000FA" + }, + { + "volumeId": "000FB" + }, + { + "volumeId": "000FC" + }, + { + "volumeId": "000FD" + }, + { + "volumeId": "000FE" + }, + { + "volumeId": "000FF" + }, + { + "volumeId": "00100" + }, + { + "volumeId": "00101" + }, + { + "volumeId": "00102" + }, + { + "volumeId": "00103" + }, + { + "volumeId": "00104" + }, + { + "volumeId": "00105" + }, + { + "volumeId": "00106" + }, + { + "volumeId": "00107" + }, + { + "volumeId": "00108" + }, + { + "volumeId": "00109" + }, + { + "volumeId": "0010A" + }, + { + "volumeId": "0010B" + }, + { + "volumeId": "0010C" + }, + { + "volumeId": "0010D" + }, + { + "volumeId": "0010E" + }, + { + "volumeId": "0010F" + }, + { + "volumeId": "00110" + }, + { + "volumeId": "00111" + }, + { + "volumeId": "00112" + }, + { + "volumeId": "00113" + }, + { + "volumeId": "00114" + }, + { + "volumeId": "00115" + }, + { + "volumeId": "00116" + }, + { + "volumeId": "00117" + }, + { + "volumeId": "00118" + }, + { + "volumeId": "00119" + }, + { + "volumeId": "0011A" + }, + { + "volumeId": "0011B" + }, + { + "volumeId": "0011C" + }, + { + "volumeId": "0011D" + }, + { + "volumeId": "0011E" + }, + { + "volumeId": "0011F" + }, + { + "volumeId": "00120" + }, + { + "volumeId": "00121" + }, + { + "volumeId": "00122" + }, + { + "volumeId": "00123" + }, + { + "volumeId": "00124" + }, + { + "volumeId": "00125" + }, + { + "volumeId": "00126" + }, + { + "volumeId": "00127" + }, + { + "volumeId": "00128" + }, + { + "volumeId": "00129" + }, + { + "volumeId": "0012A" + }, + { + "volumeId": "0012B" + }, + { + "volumeId": "0012C" + }, + { + "volumeId": "0012D" + }, + { + "volumeId": "0012E" + }, + { + "volumeId": "0012F" + }, + { + "volumeId": "00130" + }, + { + "volumeId": "00131" + }, + { + "volumeId": "00132" + }, + { + "volumeId": "00133" + }, + { + "volumeId": "00134" + }, + { + "volumeId": "00135" + }, + { + "volumeId": "00136" + }, + { + "volumeId": "00137" + }, + { + "volumeId": "00138" + }, + { + "volumeId": "00139" + }, + { + "volumeId": "0013A" + }, + { + "volumeId": "0013B" + }, + { + "volumeId": "0013C" + }, + { + "volumeId": "0013D" + }, + { + "volumeId": "0013E" + }, + { + "volumeId": "0013F" + }, + { + "volumeId": "00140" + }, + { + "volumeId": "00141" + }, + { + "volumeId": "00142" + }, + { + "volumeId": "00143" + }, + { + "volumeId": "00144" + }, + { + "volumeId": "00145" + }, + { + "volumeId": "00146" + }, + { + "volumeId": "00147" + }, + { + "volumeId": "00148" + }, + { + "volumeId": "00149" + }, + { + "volumeId": "0014A" + }, + { + "volumeId": "0014B" + }, + { + "volumeId": "0014C" + }, + { + "volumeId": "0014D" + }, + { + "volumeId": "0014E" + }, + { + "volumeId": "0014F" + }, + { + "volumeId": "00150" + }, + { + "volumeId": "00151" + }, + { + "volumeId": "00152" + }, + { + "volumeId": "00153" + }, + { + "volumeId": "00154" + }, + { + "volumeId": "00155" + }, + { + "volumeId": "00156" + }, + { + "volumeId": "00157" + }, + { + "volumeId": "00158" + }, + { + "volumeId": "00159" + }, + { + "volumeId": "0015A" + }, + { + "volumeId": "0015B" + }, + { + "volumeId": "0015C" + }, + { + "volumeId": "0015D" + }, + { + "volumeId": "0015E" + }, + { + "volumeId": "0015F" + }, + { + "volumeId": "00160" + }, + { + "volumeId": "00161" + }, + { + "volumeId": "00162" + }, + { + "volumeId": "00163" + }, + { + "volumeId": "00164" + }, + { + "volumeId": "00165" + }, + { + "volumeId": "00166" + }, + { + "volumeId": "00167" + }, + { + "volumeId": "00168" + }, + { + "volumeId": "00169" + }, + { + "volumeId": "0016A" + }, + { + "volumeId": "0016B" + }, + { + "volumeId": "0016C" + }, + { + "volumeId": "0016D" + }, + { + "volumeId": "0016E" + }, + { + "volumeId": "0016F" + }, + { + "volumeId": "00170" + }, + { + "volumeId": "00171" + }, + { + "volumeId": "00172" + }, + { + "volumeId": "00173" + }, + { + "volumeId": "00174" + }, + { + "volumeId": "00175" + }, + { + "volumeId": "00176" + }, + { + "volumeId": "00177" + }, + { + "volumeId": "00178" + }, + { + "volumeId": "00179" + }, + { + "volumeId": "0017A" + }, + { + "volumeId": "0017B" + }, + { + "volumeId": "0017C" + }, + { + "volumeId": "0017D" + }, + { + "volumeId": "0017E" + }, + { + "volumeId": "0017F" + }, + { + "volumeId": "00180" + }, + { + "volumeId": "00181" + }, + { + "volumeId": "00182" + }, + { + "volumeId": "00183" + }, + { + "volumeId": "00184" + }, + { + "volumeId": "00185" + }, + { + "volumeId": "00186" + }, + { + "volumeId": "00187" + }, + { + "volumeId": "00188" + }, + { + "volumeId": "00189" + }, + { + "volumeId": "0018A" + }, + { + "volumeId": "0018B" + }, + { + "volumeId": "0018C" + }, + { + "volumeId": "0018D" + }, + { + "volumeId": "0018E" + }, + { + "volumeId": "0018F" + }, + { + "volumeId": "00190" + }, + { + "volumeId": "00191" + }, + { + "volumeId": "00192" + }, + { + "volumeId": "00193" + }, + { + "volumeId": "00194" + }, + { + "volumeId": "00195" + }, + { + "volumeId": "00196" + }, + { + "volumeId": "00197" + }, + { + "volumeId": "00198" + }, + { + "volumeId": "00199" + }, + { + "volumeId": "0019A" + }, + { + "volumeId": "0019B" + }, + { + "volumeId": "0019C" + }, + { + "volumeId": "0019D" + }, + { + "volumeId": "0019E" + }, + { + "volumeId": "0019F" + }, + { + "volumeId": "001A0" + }, + { + "volumeId": "001A1" + }, + { + "volumeId": "001A2" + }, + { + "volumeId": "001A3" + }, + { + "volumeId": "001A4" + }, + { + "volumeId": "001A5" + }, + { + "volumeId": "001A6" + }, + { + "volumeId": "001A7" + }, + { + "volumeId": "001A8" + }, + { + "volumeId": "001A9" + }, + { + "volumeId": "001AA" + }, + { + "volumeId": "001AB" + }, + { + "volumeId": "001AC" + }, + { + "volumeId": "001AD" + }, + { + "volumeId": "001AE" + }, + { + "volumeId": "001AF" + }, + { + "volumeId": "001B0" + }, + { + "volumeId": "001B1" + }, + { + "volumeId": "001B2" + }, + { + "volumeId": "001B3" + }, + { + "volumeId": "001B4" + }, + { + "volumeId": "001B5" + }, + { + "volumeId": "001B6" + }, + { + "volumeId": "001B7" + }, + { + "volumeId": "001B8" + }, + { + "volumeId": "001B9" + }, + { + "volumeId": "001BA" + }, + { + "volumeId": "001BB" + }, + { + "volumeId": "001BC" + }, + { + "volumeId": "001BD" + }, + { + "volumeId": "001BE" + }, + { + "volumeId": "001BF" + }, + { + "volumeId": "001C0" + }, + { + "volumeId": "001C1" + }, + { + "volumeId": "001C2" + }, + { + "volumeId": "001C3" + }, + { + "volumeId": "001C4" + }, + { + "volumeId": "001C5" + }, + { + "volumeId": "001C6" + }, + { + "volumeId": "001C7" + }, + { + "volumeId": "001C8" + }, + { + "volumeId": "001C9" + }, + { + "volumeId": "001CA" + }, + { + "volumeId": "001CB" + }, + { + "volumeId": "001CC" + }, + { + "volumeId": "001CD" + }, + { + "volumeId": "001CE" + }, + { + "volumeId": "001CF" + }, + { + "volumeId": "001D0" + }, + { + "volumeId": "001D1" + }, + { + "volumeId": "001D2" + }, + { + "volumeId": "001D3" + }, + { + "volumeId": "001D4" + }, + { + "volumeId": "001D5" + }, + { + "volumeId": "001D6" + }, + { + "volumeId": "001D7" + }, + { + "volumeId": "001D8" + }, + { + "volumeId": "001D9" + }, + { + "volumeId": "001DA" + }, + { + "volumeId": "001DB" + }, + { + "volumeId": "001DC" + }, + { + "volumeId": "001DD" + }, + { + "volumeId": "001DE" + }, + { + "volumeId": "001DF" + }, + { + "volumeId": "001E0" + }, + { + "volumeId": "001E1" + }, + { + "volumeId": "001E2" + }, + { + "volumeId": "001E3" + }, + { + "volumeId": "001E4" + }, + { + "volumeId": "001E5" + }, + { + "volumeId": "001E6" + }, + { + "volumeId": "001E7" + }, + { + "volumeId": "001E8" + }, + { + "volumeId": "001E9" + }, + { + "volumeId": "001EA" + }, + { + "volumeId": "001EB" + }, + { + "volumeId": "001EC" + }, + { + "volumeId": "001ED" + }, + { + "volumeId": "001EE" + }, + { + "volumeId": "001EF" + }, + { + "volumeId": "001F0" + }, + { + "volumeId": "001F1" + }, + { + "volumeId": "001F2" + }, + { + "volumeId": "001F3" + }, + { + "volumeId": "001F4" + }, + { + "volumeId": "001F5" + }, + { + "volumeId": "001F6" + }, + { + "volumeId": "001F7" + }, + { + "volumeId": "001F8" + }, + { + "volumeId": "001F9" + }, + { + "volumeId": "001FA" + }, + { + "volumeId": "001FB" + }, + { + "volumeId": "001FC" + }, + { + "volumeId": "001FD" + }, + { + "volumeId": "001FE" + }, + { + "volumeId": "001FF" + }, + { + "volumeId": "00200" + }, + { + "volumeId": "00201" + }, + { + "volumeId": "00202" + }, + { + "volumeId": "00203" + }, + { + "volumeId": "00204" + }, + { + "volumeId": "00205" + }, + { + "volumeId": "00206" + }, + { + "volumeId": "00207" + }, + { + "volumeId": "00208" + }, + { + "volumeId": "00209" + }, + { + "volumeId": "0020A" + }, + { + "volumeId": "0020B" + }, + { + "volumeId": "0020C" + }, + { + "volumeId": "0020D" + }, + { + "volumeId": "0020E" + }, + { + "volumeId": "0020F" + }, + { + "volumeId": "00210" + }, + { + "volumeId": "00211" + }, + { + "volumeId": "00212" + }, + { + "volumeId": "00213" + }, + { + "volumeId": "00214" + }, + { + "volumeId": "00215" + }, + { + "volumeId": "00216" + }, + { + "volumeId": "00217" + }, + { + "volumeId": "00218" + }, + { + "volumeId": "00219" + }, + { + "volumeId": "0021A" + }, + { + "volumeId": "0021B" + }, + { + "volumeId": "0021C" + }, + { + "volumeId": "0021D" + }, + { + "volumeId": "0021E" + }, + { + "volumeId": "0021F" + }, + { + "volumeId": "00220" + }, + { + "volumeId": "00221" + }, + { + "volumeId": "00222" + }, + { + "volumeId": "00223" + }, + { + "volumeId": "00224" + }, + { + "volumeId": "00225" + }, + { + "volumeId": "00226" + }, + { + "volumeId": "00227" + }, + { + "volumeId": "00228" + }, + { + "volumeId": "00229" + }, + { + "volumeId": "0022A" + }, + { + "volumeId": "0022B" + }, + { + "volumeId": "0022C" + }, + { + "volumeId": "0022D" + }, + { + "volumeId": "0022E" + }, + { + "volumeId": "0022F" + }, + { + "volumeId": "00230" + }, + { + "volumeId": "00231" + }, + { + "volumeId": "00232" + }, + { + "volumeId": "00233" + }, + { + "volumeId": "00234" + }, + { + "volumeId": "00235" + }, + { + "volumeId": "00236" + }, + { + "volumeId": "00237" + }, + { + "volumeId": "00238" + }, + { + "volumeId": "00239" + }, + { + "volumeId": "0023A" + }, + { + "volumeId": "0023B" + }, + { + "volumeId": "0023C" + }, + { + "volumeId": "0023D" + }, + { + "volumeId": "0023E" + }, + { + "volumeId": "0023F" + }, + { + "volumeId": "00240" + }, + { + "volumeId": "00241" + }, + { + "volumeId": "00242" + }, + { + "volumeId": "00243" + }, + { + "volumeId": "00244" + }, + { + "volumeId": "00245" + }, + { + "volumeId": "00246" + }, + { + "volumeId": "00247" + }, + { + "volumeId": "00248" + }, + { + "volumeId": "00249" + }, + { + "volumeId": "0024A" + }, + { + "volumeId": "0024B" + }, + { + "volumeId": "0024C" + }, + { + "volumeId": "0024D" + }, + { + "volumeId": "0024E" + }, + { + "volumeId": "0024F" + }, + { + "volumeId": "00250" + }, + { + "volumeId": "00251" + }, + { + "volumeId": "00252" + }, + { + "volumeId": "00253" + }, + { + "volumeId": "00254" + }, + { + "volumeId": "00255" + }, + { + "volumeId": "00256" + }, + { + "volumeId": "00257" + }, + { + "volumeId": "00258" + }, + { + "volumeId": "00259" + }, + { + "volumeId": "0025A" + }, + { + "volumeId": "0025B" + }, + { + "volumeId": "0025C" + }, + { + "volumeId": "0025D" + }, + { + "volumeId": "0025E" + }, + { + "volumeId": "0025F" + }, + { + "volumeId": "00260" + }, + { + "volumeId": "00261" + }, + { + "volumeId": "00262" + }, + { + "volumeId": "00263" + }, + { + "volumeId": "00264" + }, + { + "volumeId": "00265" + }, + { + "volumeId": "00266" + }, + { + "volumeId": "00267" + }, + { + "volumeId": "00268" + }, + { + "volumeId": "00269" + }, + { + "volumeId": "0026A" + }, + { + "volumeId": "0026B" + }, + { + "volumeId": "0026C" + }, + { + "volumeId": "0026D" + }, + { + "volumeId": "0026E" + }, + { + "volumeId": "0026F" + }, + { + "volumeId": "00270" + }, + { + "volumeId": "00271" + }, + { + "volumeId": "00272" + }, + { + "volumeId": "00273" + }, + { + "volumeId": "00274" + }, + { + "volumeId": "00275" + }, + { + "volumeId": "00276" + }, + { + "volumeId": "00277" + }, + { + "volumeId": "00278" + }, + { + "volumeId": "00279" + }, + { + "volumeId": "0027A" + }, + { + "volumeId": "0027B" + }, + { + "volumeId": "0027C" + }, + { + "volumeId": "0027D" + }, + { + "volumeId": "0027E" + }, + { + "volumeId": "0027F" + }, + { + "volumeId": "00280" + }, + { + "volumeId": "00281" + }, + { + "volumeId": "00282" + }, + { + "volumeId": "00283" + }, + { + "volumeId": "00284" + }, + { + "volumeId": "00285" + }, + { + "volumeId": "00286" + }, + { + "volumeId": "00287" + }, + { + "volumeId": "00288" + }, + { + "volumeId": "00289" + }, + { + "volumeId": "0028A" + }, + { + "volumeId": "0028B" + }, + { + "volumeId": "0028C" + }, + { + "volumeId": "0028D" + }, + { + "volumeId": "0028E" + }, + { + "volumeId": "0028F" + }, + { + "volumeId": "00290" + }, + { + "volumeId": "00291" + }, + { + "volumeId": "00292" + }, + { + "volumeId": "00293" + }, + { + "volumeId": "00294" + }, + { + "volumeId": "00295" + }, + { + "volumeId": "00296" + }, + { + "volumeId": "00297" + }, + { + "volumeId": "00298" + }, + { + "volumeId": "00299" + }, + { + "volumeId": "0029A" + }, + { + "volumeId": "0029B" + }, + { + "volumeId": "0029C" + }, + { + "volumeId": "0029D" + }, + { + "volumeId": "0029E" + }, + { + "volumeId": "0029F" + }, + { + "volumeId": "002A0" + }, + { + "volumeId": "002A1" + }, + { + "volumeId": "002A2" + }, + { + "volumeId": "002A3" + }, + { + "volumeId": "002A4" + }, + { + "volumeId": "002A5" + }, + { + "volumeId": "002A6" + }, + { + "volumeId": "002A7" + }, + { + "volumeId": "002A8" + }, + { + "volumeId": "002A9" + }, + { + "volumeId": "002AA" + }, + { + "volumeId": "002AB" + }, + { + "volumeId": "002AC" + }, + { + "volumeId": "002AD" + }, + { + "volumeId": "002AE" + }, + { + "volumeId": "002AF" + }, + { + "volumeId": "002B0" + }, + { + "volumeId": "002B1" + }, + { + "volumeId": "002B2" + }, + { + "volumeId": "002B3" + }, + { + "volumeId": "002B4" + }, + { + "volumeId": "002B5" + }, + { + "volumeId": "002B6" + }, + { + "volumeId": "002B7" + }, + { + "volumeId": "002B8" + }, + { + "volumeId": "002B9" + }, + { + "volumeId": "002BA" + }, + { + "volumeId": "002BB" + }, + { + "volumeId": "002BC" + }, + { + "volumeId": "002BD" + }, + { + "volumeId": "002BE" + }, + { + "volumeId": "002BF" + }, + { + "volumeId": "002C0" + }, + { + "volumeId": "002C1" + }, + { + "volumeId": "002C2" + }, + { + "volumeId": "002C3" + }, + { + "volumeId": "002C4" + }, + { + "volumeId": "002C5" + }, + { + "volumeId": "002C6" + }, + { + "volumeId": "002C7" + }, + { + "volumeId": "002C8" + }, + { + "volumeId": "002C9" + }, + { + "volumeId": "002CA" + }, + { + "volumeId": "002CB" + }, + { + "volumeId": "002CC" + }, + { + "volumeId": "002CD" + }, + { + "volumeId": "002CE" + }, + { + "volumeId": "002CF" + }, + { + "volumeId": "002D0" + }, + { + "volumeId": "002D1" + }, + { + "volumeId": "002D2" + }, + { + "volumeId": "002D3" + }, + { + "volumeId": "002D4" + }, + { + "volumeId": "002D5" + }, + { + "volumeId": "002D6" + }, + { + "volumeId": "002D7" + }, + { + "volumeId": "002D8" + }, + { + "volumeId": "002D9" + }, + { + "volumeId": "002DA" + }, + { + "volumeId": "002DB" + }, + { + "volumeId": "002DC" + }, + { + "volumeId": "002DD" + }, + { + "volumeId": "002DE" + }, + { + "volumeId": "002DF" + }, + { + "volumeId": "002E0" + }, + { + "volumeId": "002E1" + }, + { + "volumeId": "002E2" + }, + { + "volumeId": "002E3" + }, + { + "volumeId": "002E4" + }, + { + "volumeId": "002E5" + }, + { + "volumeId": "002E6" + }, + { + "volumeId": "002E7" + }, + { + "volumeId": "002E8" + }, + { + "volumeId": "002E9" + }, + { + "volumeId": "002EA" + }, + { + "volumeId": "002EB" + }, + { + "volumeId": "002EC" + }, + { + "volumeId": "002ED" + }, + { + "volumeId": "002EE" + }, + { + "volumeId": "002EF" + }, + { + "volumeId": "002F0" + }, + { + "volumeId": "002F1" + }, + { + "volumeId": "002F2" + }, + { + "volumeId": "002F3" + }, + { + "volumeId": "002F4" + }, + { + "volumeId": "002F5" + }, + { + "volumeId": "002F6" + }, + { + "volumeId": "002F7" + }, + { + "volumeId": "002F8" + }, + { + "volumeId": "002F9" + }, + { + "volumeId": "002FA" + }, + { + "volumeId": "002FB" + }, + { + "volumeId": "002FC" + }, + { + "volumeId": "002FD" + }, + { + "volumeId": "002FE" + }, + { + "volumeId": "002FF" + }, + { + "volumeId": "00300" + }, + { + "volumeId": "00301" + }, + { + "volumeId": "00302" + }, + { + "volumeId": "00303" + }, + { + "volumeId": "00304" + }, + { + "volumeId": "00305" + }, + { + "volumeId": "00306" + }, + { + "volumeId": "00307" + }, + { + "volumeId": "00308" + }, + { + "volumeId": "00309" + }, + { + "volumeId": "0030A" + }, + { + "volumeId": "0030B" + }, + { + "volumeId": "0030C" + }, + { + "volumeId": "0030D" + }, + { + "volumeId": "0030E" + }, + { + "volumeId": "0030F" + }, + { + "volumeId": "00310" + }, + { + "volumeId": "00311" + }, + { + "volumeId": "00312" + }, + { + "volumeId": "00313" + }, + { + "volumeId": "00314" + }, + { + "volumeId": "00315" + }, + { + "volumeId": "00316" + }, + { + "volumeId": "00317" + }, + { + "volumeId": "00318" + }, + { + "volumeId": "00319" + }, + { + "volumeId": "0031A" + }, + { + "volumeId": "0031B" + }, + { + "volumeId": "0031C" + }, + { + "volumeId": "0031D" + }, + { + "volumeId": "0031E" + }, + { + "volumeId": "0031F" + }, + { + "volumeId": "00320" + }, + { + "volumeId": "00321" + }, + { + "volumeId": "00322" + }, + { + "volumeId": "00323" + }, + { + "volumeId": "00324" + }, + { + "volumeId": "00325" + }, + { + "volumeId": "00326" + }, + { + "volumeId": "00327" + }, + { + "volumeId": "00328" + }, + { + "volumeId": "00329" + }, + { + "volumeId": "0032A" + }, + { + "volumeId": "0032B" + }, + { + "volumeId": "0032C" + }, + { + "volumeId": "0032D" + }, + { + "volumeId": "0032E" + }, + { + "volumeId": "0032F" + }, + { + "volumeId": "00330" + }, + { + "volumeId": "00331" + }, + { + "volumeId": "00332" + }, + { + "volumeId": "00333" + }, + { + "volumeId": "00334" + }, + { + "volumeId": "00335" + }, + { + "volumeId": "00336" + }, + { + "volumeId": "00337" + }, + { + "volumeId": "00338" + }, + { + "volumeId": "00339" + }, + { + "volumeId": "0033A" + }, + { + "volumeId": "0033B" + }, + { + "volumeId": "0033C" + }, + { + "volumeId": "0033D" + }, + { + "volumeId": "0033E" + }, + { + "volumeId": "0033F" + }, + { + "volumeId": "00340" + }, + { + "volumeId": "00341" + }, + { + "volumeId": "00342" + }, + { + "volumeId": "00343" + }, + { + "volumeId": "00344" + }, + { + "volumeId": "00345" + }, + { + "volumeId": "00346" + }, + { + "volumeId": "00347" + }, + { + "volumeId": "00348" + }, + { + "volumeId": "00349" + }, + { + "volumeId": "0034A" + }, + { + "volumeId": "0034B" + }, + { + "volumeId": "0034C" + }, + { + "volumeId": "0034D" + }, + { + "volumeId": "0034E" + }, + { + "volumeId": "0034F" + }, + { + "volumeId": "00350" + }, + { + "volumeId": "00351" + }, + { + "volumeId": "00352" + }, + { + "volumeId": "00353" + }, + { + "volumeId": "00354" + }, + { + "volumeId": "00355" + }, + { + "volumeId": "00356" + }, + { + "volumeId": "00357" + }, + { + "volumeId": "00358" + }, + { + "volumeId": "00359" + }, + { + "volumeId": "0035A" + }, + { + "volumeId": "0035B" + }, + { + "volumeId": "0035C" + }, + { + "volumeId": "0035D" + }, + { + "volumeId": "0035E" + }, + { + "volumeId": "0035F" + }, + { + "volumeId": "00360" + }, + { + "volumeId": "00361" + }, + { + "volumeId": "00362" + }, + { + "volumeId": "00363" + }, + { + "volumeId": "00364" + }, + { + "volumeId": "00365" + }, + { + "volumeId": "00366" + }, + { + "volumeId": "00367" + }, + { + "volumeId": "00368" + }, + { + "volumeId": "00369" + }, + { + "volumeId": "0036A" + }, + { + "volumeId": "0036B" + }, + { + "volumeId": "0036C" + }, + { + "volumeId": "0036D" + }, + { + "volumeId": "0036E" + }, + { + "volumeId": "0036F" + }, + { + "volumeId": "00370" + }, + { + "volumeId": "00371" + }, + { + "volumeId": "00372" + }, + { + "volumeId": "00373" + }, + { + "volumeId": "00374" + }, + { + "volumeId": "00375" + }, + { + "volumeId": "00376" + }, + { + "volumeId": "00377" + }, + { + "volumeId": "00378" + }, + { + "volumeId": "00379" + }, + { + "volumeId": "0037A" + }, + { + "volumeId": "0037B" + }, + { + "volumeId": "0037C" + }, + { + "volumeId": "0037D" + }, + { + "volumeId": "0037E" + }, + { + "volumeId": "0037F" + }, + { + "volumeId": "00380" + }, + { + "volumeId": "00381" + }, + { + "volumeId": "00382" + }, + { + "volumeId": "00383" + }, + { + "volumeId": "00384" + }, + { + "volumeId": "00385" + }, + { + "volumeId": "00386" + }, + { + "volumeId": "00387" + }, + { + "volumeId": "00388" + }, + { + "volumeId": "00389" + }, + { + "volumeId": "0038A" + }, + { + "volumeId": "0038B" + }, + { + "volumeId": "0038C" + }, + { + "volumeId": "0038D" + }, + { + "volumeId": "0038E" + }, + { + "volumeId": "0038F" + }, + { + "volumeId": "00390" + }, + { + "volumeId": "00391" + }, + { + "volumeId": "00392" + }, + { + "volumeId": "00393" + }, + { + "volumeId": "00394" + }, + { + "volumeId": "00395" + }, + { + "volumeId": "FFF70" + }, + { + "volumeId": "FFF71" + }, + { + "volumeId": "FFF72" + }, + { + "volumeId": "FFF73" + }, + { + "volumeId": "FFF74" + }, + { + "volumeId": "FFF75" + }, + { + "volumeId": "FFF76" + }, + { + "volumeId": "FFF77" + }, + { + "volumeId": "FFF78" + }, + { + "volumeId": "FFF79" + }, + { + "volumeId": "FFF7A" + }, + { + "volumeId": "FFF7B" + }, + { + "volumeId": "FFF7C" + }, + { + "volumeId": "FFF7D" + }, + { + "volumeId": "FFF7E" + }, + { + "volumeId": "FFF7F" + }, + { + "volumeId": "FFF80" + }, + { + "volumeId": "FFF81" + }, + { + "volumeId": "FFF82" + }, + { + "volumeId": "FFF83" + }, + { + "volumeId": "FFF84" + }, + { + "volumeId": "FFF85" + }, + { + "volumeId": "FFF86" + }, + { + "volumeId": "FFF87" + }, + { + "volumeId": "FFF88" + }, + { + "volumeId": "FFF89" + }, + { + "volumeId": "FFF8A" + }, + { + "volumeId": "FFF8B" + }, + { + "volumeId": "FFF8C" + }, + { + "volumeId": "FFF8D" + }, + { + "volumeId": "FFF8E" + }, + { + "volumeId": "FFF8F" + }, + { + "volumeId": "FFF90" + }, + { + "volumeId": "FFF91" + }, + { + "volumeId": "FFF92" + }, + { + "volumeId": "FFF93" + }, + { + "volumeId": "FFF94" + }, + { + "volumeId": "FFF95" + }, + { + "volumeId": "FFF96" + }, + { + "volumeId": "FFF97" + }, + { + "volumeId": "FFF98" + }, + { + "volumeId": "FFF99" + }, + { + "volumeId": "FFF9A" + }, + { + "volumeId": "FFF9B" + }, + { + "volumeId": "FFF9C" + }, + { + "volumeId": "FFF9D" + }, + { + "volumeId": "FFF9E" + }, + { + "volumeId": "FFF9F" + }, + { + "volumeId": "FFFA0" + }, + { + "volumeId": "FFFA1" + }, + { + "volumeId": "FFFA2" + }, + { + "volumeId": "FFFA3" + }, + { + "volumeId": "FFFA4" + }, + { + "volumeId": "FFFA5" + }, + { + "volumeId": "FFFA6" + }, + { + "volumeId": "FFFA7" + }, + { + "volumeId": "FFFA8" + }, + { + "volumeId": "FFFA9" + }, + { + "volumeId": "FFFAA" + }, + { + "volumeId": "FFFAB" + }, + { + "volumeId": "FFFAC" + }, + { + "volumeId": "FFFAD" + }, + { + "volumeId": "FFFAE" + }, + { + "volumeId": "FFFAF" + }, + { + "volumeId": "FFFB0" + }, + { + "volumeId": "FFFB1" + }, + { + "volumeId": "FFFB2" + }, + { + "volumeId": "FFFB3" + }, + { + "volumeId": "FFFB4" + }, + { + "volumeId": "FFFB5" + }, + { + "volumeId": "FFFB6" + }, + { + "volumeId": "FFFB7" + }, + { + "volumeId": "FFFB8" + }, + { + "volumeId": "FFFB9" + }, + { + "volumeId": "FFFBA" + }, + { + "volumeId": "FFFBB" + }, + { + "volumeId": "FFFBC" + }, + { + "volumeId": "FFFBD" + }, + { + "volumeId": "FFFBE" + }, + { + "volumeId": "FFFBF" + }, + { + "volumeId": "FFFC0" + }, + { + "volumeId": "FFFC1" + }, + { + "volumeId": "FFFC2" + } + ], + "from": 1, + "to": 1000 + }, + "id": "95757414-0f59-4c67-bd88-55bc95bc6a2d_0", + "count": 1045, + "expirationTime": 1553715367507, + "maxPageSize": 1000 +} diff --git a/service/mock-data/volume_template.json b/service/mock-data/volume_template.json new file mode 100644 index 00000000..c880a0ee --- /dev/null +++ b/service/mock-data/volume_template.json @@ -0,0 +1,23 @@ +{ + "volumeId": "__VOLUME_ID__", + "type": "TDEV", + "emulation": "FBA", + "ssid": "FFFFFFFF", + "allocated_percent": 0, + "cap_gb": 1, + "cap_mb": 1026, + "cap_cyl": __CAPACITY_CYL__, + "status": "Ready", + "reserved": false, + "pinned": false, + "volume_identifier": "__VOLUME_IDENTIFIER__", + "wwn": "60000970000197900046533030324538", + "encapsulated": false, + "num_of_storage_groups": __NUMBER_OF_STORAGE_GROUPS__, + "num_of_front_end_paths": __NUMBER_OF_FRONT_END_PATHS__, + "storageGroupId": __STORAGE_GROUP_IDS__, + "snapvx_source": false, + "snapvx_target": false, + "has_effective_wwn": false, + "effective_wwn": "60000970000197900046533030324538" +} diff --git a/service/node_connectivity_checker_test.go b/service/node_connectivity_checker_test.go index 1271e011..35fe08d8 100644 --- a/service/node_connectivity_checker_test.go +++ b/service/node_connectivity_checker_test.go @@ -21,6 +21,7 @@ package service import ( "context" "net/http" + "net/http/httptest" "sync" "testing" "time" @@ -217,3 +218,54 @@ func TestQASWithDiffErr(t *testing.T) { } server.Shutdown(context.Background()) }*/ + +func TestConnectivityStatus(t *testing.T) { + // Initialize the probeStatus variable + probeStatus = new(sync.Map) + + // Create a valid ArrayConnectivityStatus instance + status := ArrayConnectivityStatus{ + LastSuccess: time.Now().Unix(), + LastAttempt: time.Now().Unix(), + } + + // Store valid data in probeStatus + probeStatus.Store("SymID", status) + + // Test cases + tests := []struct { + name string + probeStatus *sync.Map + expectedCode int + }{ + { + name: "Empty probeStatus", + probeStatus: nil, + expectedCode: http.StatusInternalServerError, + }, + { + name: "Valid probeStatus", + probeStatus: probeStatus, + expectedCode: http.StatusOK, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Set the global probeStatus for the test + probeStatus = tt.probeStatus + + // Create a response recorder + recorder := httptest.NewRecorder() + req := httptest.NewRequest("GET", "/connectivityStatus", nil) + + // Call the function + connectivityStatus(recorder, req) + + // Check the response code + if recorder.Code != tt.expectedCode { + t.Errorf("expected %d, got %d", tt.expectedCode, recorder.Code) + } + }) + } +} diff --git a/service/service_unit_test.go b/service/service_unit_test.go index 5d335269..b2cb7041 100644 --- a/service/service_unit_test.go +++ b/service/service_unit_test.go @@ -28,7 +28,9 @@ import ( csi "github.com/container-storage-interface/spec/lib/go/csi" log "github.com/sirupsen/logrus" + "github.com/spf13/viper" "github.com/stretchr/testify/assert" + "google.golang.org/grpc" ) const ( @@ -526,3 +528,110 @@ func TestEsnureISCSIDaemonIsStarted(t *testing.T) { errMsg = fmt.Sprintf("mock - unit is masked - failed to start the unit") assert.PanicsWithError(t, errMsg, func() { s.ensureISCSIDaemonStarted() }) } + +func TestUpdateDriverConfigParams(_ *testing.T) { + paramsViper := viper.New() + paramsViper.SetConfigFile("configFilePath") + paramsViper.SetConfigType("yaml") + paramsViper.Set(CSILogLevelParam, "debug") + paramsViper.Set(CSILogFormatParam, "JSON") + updateDriverConfigParams(paramsViper) + + paramsViper.Set(CSILogFormatParam, "TEXT") + updateDriverConfigParams(paramsViper) +} + +func TestGetProxySettingsFromEnv(t *testing.T) { + s := service{ + useIscsi: true, + } + _ = os.Setenv(EnvSidecarProxyPort, "8080") + ProxyServiceHost, _, _ := s.getProxySettingsFromEnv() + assert.Equal(t, "0.0.0.0", ProxyServiceHost) + + os.Unsetenv(EnvSidecarProxyPort) + _ = os.Setenv(EnvUnisphereProxyServiceName, "Service") + _ = os.Setenv("SERVICE_SERVICE_HOST", "") + _ = os.Setenv("SERVICE_SERVICE_PORT", "") + ProxyServiceHost, ProxyServicePort, _ := s.getProxySettingsFromEnv() + assert.Equal(t, "", ProxyServiceHost) + assert.Equal(t, "", ProxyServicePort) + + os.Unsetenv("SERVICE_SERVICE_HOST") + os.Unsetenv("SERVICE_SERVICE_PORT") + _ = os.Setenv("SERVICE_SERVICE_HOST", "SERVICE_SERVICE_HOST") + _ = os.Setenv("SERVICE_SERVICE_PORT", "1234") + ProxyServiceHost, ProxyServicePort, _ = s.getProxySettingsFromEnv() + assert.Equal(t, "SERVICE_SERVICE_HOST", ProxyServiceHost) + assert.Equal(t, "1234", ProxyServicePort) +} + +func TestGetTransportProtocolFromEnv(t *testing.T) { + s := service{ + useIscsi: true, + } + _ = os.Setenv(EnvPreferredTransportProtocol, "FIBRE") + output := s.getTransportProtocolFromEnv() + assert.Equal(t, "FC", output) + + os.Unsetenv(EnvPreferredTransportProtocol) + _ = os.Setenv(EnvPreferredTransportProtocol, "NVMETCP") + output = s.getTransportProtocolFromEnv() + assert.Equal(t, "NVMETCP", output) + + os.Unsetenv(EnvPreferredTransportProtocol) + _ = os.Setenv(EnvPreferredTransportProtocol, "") + output = s.getTransportProtocolFromEnv() + assert.Equal(t, "", output) + + os.Unsetenv(EnvPreferredTransportProtocol) + _ = os.Setenv(EnvPreferredTransportProtocol, "invalid") + output = s.getTransportProtocolFromEnv() + 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 TestRegisterAdditionalServers(_ *testing.T) { + o := Opts{ + DriverName: "powermax", + } + s := service{ + opts: o, + } + server := grpc.NewServer() + s.RegisterAdditionalServers(server) +} + +func TestSetArrayConfigEnvs(t *testing.T) { + ctx := context.Background() + _ = os.Setenv(EnvArrayConfigPath, "value") + paramsViper := viper.New() + paramsViper.Set(Protocol, "ICSCI") + paramsViper.Set(EnvEndpoint, "endpoint") + paramsViper.Set(PortGroups, "pg1, pg2, pg3") + paramsViper.Set(ManagedArrays, "000000000001,000000000002") + err := setArrayConfigEnvs(ctx) + assert.Equal(t, nil, err) +} diff --git a/service/step_defs_test.go b/service/step_defs_test.go index 9985a9f8..5ebfc0e3 100644 --- a/service/step_defs_test.go +++ b/service/step_defs_test.go @@ -31,8 +31,13 @@ import ( "time" "github.com/dell/gonvme" + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator" + "github.com/vmware/govmomi/vim25" "github.com/dell/csi-powermax/v2/k8smock" + "github.com/dell/csi-powermax/v2/pkg/migration" "github.com/dell/dell-csi-extensions/common" @@ -53,6 +58,8 @@ import ( log "github.com/sirupsen/logrus" "golang.org/x/net/context" "google.golang.org/grpc/metadata" + + csimgr "github.com/dell/dell-csi-extensions/migration" ) const ( @@ -88,6 +95,7 @@ const ( altSnapID = "555-555" defaultStorageGroup = "DefaultStorageGroup" defaultIscsiInitiator = "iqn.1993-08.org.debian:01:5ae293b352a2" + defaultNvmeInitiator = "nqn.2019-08.org.emc:sn.0x10000090fa6603b7" defaultFcInitiator = "0x10000090fa6603b7" defaultArrayTargetIQN = "iqn.1992-04.com.emc:600009700bcbb70e3287017400000001" defaultFcInitiatorWWN = "10000090fa6603b7" @@ -97,6 +105,7 @@ const ( defaultFCDirPort = "FA-1D:4" defaultISCSIDirPort1 = "SE1-E:6" defaultISCSIDirPort2 = "SE2-E:4" + defaultNVMEDirPort = "N:2" MaxRetries = 10 Namespace = "namespace-test" kubeconfig = "/etc/kubernetes/admin.conf" @@ -180,6 +189,7 @@ type feature struct { removeVolumeFromSGMVResponse2 chan removeVolumeFromSGMVResponse lockChan chan bool iscsiTargetInfo []ISCSITargetInfo + nvmetcpTargetInfo []NVMeTCPTargetInfo maxRetryCount int failedSnaps map[string]failedSnap doneChan chan bool @@ -188,6 +198,7 @@ type feature struct { nodeGetVolumeStatsResponse *csi.NodeGetVolumeStatsResponse setIOLimits bool validateVHCResp *podmon.ValidateVolumeHostConnectivityResponse + arrayMigrateResponse *csimgr.ArrayMigrateResponse } var inducedErrors struct { @@ -438,9 +449,11 @@ func (f *feature) getService() *service { } mock.Reset() // This is a temp fix and needs to be handled in a different way - mock.Data.JSONDir = "../../gopowermax/mock" + mock.Data.JSONDir = "mock-data" svc.loggedInArrays = map[string]bool{} svc.iscsiTargets = map[string][]string{} + svc.nvmeTargets = map[string][]string{} + svc.loggedInNVMeArrays = map[string]bool{} var opts Opts opts.User = "username" opts.Password = "password" @@ -476,6 +489,7 @@ ip6t_rpfilter 12595 1 svc.fcConnector = &mockFCGobrick{} svc.iscsiConnector = &mockISCSIGobrick{} svc.nvmetcpClient = &gonvme.MockNVMe{} + svc.nvmeTCPConnector = &mockNVMeTCPConnector{} svc.dBusConn = &mockDbusConnection{} svc.k8sUtils = k8smock.Init() mockGobrickReset() @@ -1359,6 +1373,38 @@ func (f *feature) iInduceError(errtype string) error { inducedErrors.invalidTopologyPathEnv = true case "GetRDFInfoFromSGIDError": inducedErrors.getRDFInfoFromSGIDError = true + case "StorageGroupMigrationNoError": + migration.StorageGroupMigration = func(_ context.Context, _, _, _ string, _ pmax.Pmax) (bool, error) { + return true, nil + } + case "StorageGroupMigrationError": + migration.StorageGroupMigration = func(_ context.Context, _, _, _ string, _ pmax.Pmax) (bool, error) { + return false, errors.New("failed to create array migration environment for target array") + } + case "GetOrCreateMigrationEnvironmentNoError": + migration.GetOrCreateMigrationEnvironment = func(_ context.Context, _, _ string, _ pmax.Pmax) (*types.MigrationEnv, error) { + return nil, nil + } + case "GetOrCreateMigrationEnvironmentError": + migration.GetOrCreateMigrationEnvironment = func(_ context.Context, _, _ string, _ pmax.Pmax) (*types.MigrationEnv, error) { + return nil, errors.New("GetOrCreateMigrationEnvironmentError") + } + case "StorageGroupCommitNoError": + migration.StorageGroupCommit = func(_ context.Context, _, _ string, _ pmax.Pmax) (bool, error) { + return true, nil + } + case "StorageGroupCommitError": + migration.StorageGroupCommit = func(_ context.Context, _, _ string, _ pmax.Pmax) (bool, error) { + return false, errors.New("StorageGroupCommitError") + } + case "AddVolumesToRemoteSGError": + migration.AddVolumesToRemoteSG = func(_ context.Context, _ string, _ pmax.Pmax) (bool, error) { + return false, errors.New("Not Found") + } + case "AddVolumesToRemoteSGNoError": + migration.AddVolumesToRemoteSG = func(_ context.Context, _ string, _ pmax.Pmax) (bool, error) { + return true, nil + } case "none": return nil default: @@ -1549,6 +1595,22 @@ func (f *feature) iHaveANodeWithMaskingView(nodeID string) error { } mock.AddPortGroup(portGroupID, "Fibre", []string{defaultFCDirPort}) mock.AddMaskingView(f.mvID, f.sgID, f.hostID, portGroupID) + } else if transportProtocol == "NVME" { + f.hostID, f.sgID, f.mvID = f.service.GetNVMETCPHostSGAndMVIDFromNodeID(nodeID) + initiator := defaultNvmeInitiator + initiators := []string{initiator} + initID := defaultISCSIDirPort1 + ":" + initiator + mock.AddInitiator(initID, initiator, "GigE", []string{defaultNVMEDirPort}, "") + mock.AddHost(f.hostID, "iSCSI", initiators) + mock.AddStorageGroup(f.sgID, "", "") + portGroupID := "" + if f.selectedPortGroup != "" { + portGroupID = f.selectedPortGroup + } else { + portGroupID = "iscsi_ports" + } + mock.AddPortGroup(portGroupID, "ISCSI", []string{defaultISCSIDirPort1, defaultISCSIDirPort2}) + mock.AddMaskingView(f.mvID, f.sgID, f.hostID, portGroupID) } else { f.hostID, f.sgID, f.mvID = f.service.GetISCSIHostSGAndMVIDFromNodeID(nodeID) initiator := defaultIscsiInitiator @@ -2675,6 +2737,34 @@ func (f *feature) iCallNodeStageVolume() error { return nil } +func (f *feature) iCallNodeStageVolumeWithSimulator() error { + simulator.Test(func(ctx context.Context, c *vim25.Client) { + mockVMHost := &VMHost{ + client: &govmomi.Client{ + Client: c, + }, + Ctx: context.Background(), + VM: object.NewVirtualMachine(c, simulator.Map.Any("VirtualMachine").Reference()), + } + vmHost = mockVMHost + _ = f.getNodePublishVolumeRequest() + header := metadata.New(map[string]string{"csi.requestid": "1"}) + ctx = metadata.NewIncomingContext(ctx, header) + req := new(csi.NodeStageVolumeRequest) + req.VolumeId = f.nodePublishVolumeRequest.VolumeId + req.PublishContext = f.nodePublishVolumeRequest.PublishContext + req.StagingTargetPath = f.nodePublishVolumeRequest.StagingTargetPath + req.VolumeCapability = f.nodePublishVolumeRequest.VolumeCapability + req.VolumeContext = f.nodePublishVolumeRequest.VolumeContext + if inducedErrors.badVolumeIdentifier { + req.VolumeId = "bad volume identifier" + } + fmt.Printf("calling NodeStageVolume %#v\n", req) + _, f.err = f.service.NodeStageVolume(ctx, req) + }) + return nil +} + func (f *feature) iCallControllerExpandVolume(nCYL int64) error { var req *csi.ControllerExpandVolumeRequest header := metadata.New(map[string]string{"csi.requestid": "1"}) @@ -2729,6 +2819,30 @@ func (f *feature) iCallNodeUnstageVolume() error { return nil } +func (f *feature) iCallNodeUnstageVolumeWithSimulator() error { + simulator.Test(func(ctx context.Context, c *vim25.Client) { + mockVMHost := &VMHost{ + client: &govmomi.Client{ + Client: c, + }, + Ctx: context.Background(), + VM: object.NewVirtualMachine(c, simulator.Map.Any("VirtualMachine").Reference()), + } + vmHost = mockVMHost + header := metadata.New(map[string]string{"csi.requestid": "1"}) + ctx = metadata.NewIncomingContext(ctx, header) + req := new(csi.NodeUnstageVolumeRequest) + req.VolumeId = f.nodePublishVolumeRequest.VolumeId + if inducedErrors.invalidVolumeID { + req.VolumeId = "badVolumeID" + } + req.StagingTargetPath = f.nodePublishVolumeRequest.StagingTargetPath + log.Printf("iCallNodeUnstageVolume %s %s", req.VolumeId, req.StagingTargetPath) + _, f.err = f.service.NodeUnstageVolume(ctx, req) + }) + return nil +} + func (f *feature) iCallNodeGetCapabilities() error { header := metadata.New(map[string]string{"csi.requestid": "1"}) ctx := metadata.NewIncomingContext(context.Background(), header) @@ -3564,6 +3678,10 @@ func (f *feature) iSetTransportProtocolTo(protocol string) error { f.service.useNVMeTCP = false f.service.useFC = false f.service.useIscsi = true + case "NVME": + f.service.useNVMeTCP = true + f.service.useFC = false + f.service.useIscsi = false } f.service.opts.TransportProtocol = protocol return nil @@ -4078,6 +4196,14 @@ func (f *feature) iCallGetAndConfigureArrayISCSITargets() error { return nil } +func (f *feature) iCallGetAndConfigureArrayNVMeTCPTargets() error { + arrayTargets := make([]string, 0) + arrayTargets = append(arrayTargets, defaultArrayTargetIQN) + f.nvmetcpTargetInfo = f.service.getAndConfigureArrayNVMeTCPTargets(context.Background(), arrayTargets, mock.DefaultRemoteSymID, f.service.adminClient) + fmt.Println(f.iscsiTargetInfo) + return nil +} + func (f *feature) targetsAreReturned(count int) error { if len(f.iscsiTargetInfo) != count { return fmt.Errorf("expected %d iscsi targets but found %d", count, len(f.iscsiTargetInfo)) @@ -4085,6 +4211,13 @@ func (f *feature) targetsAreReturned(count int) error { return nil } +func (f *feature) nvmetcptargetsAreReturned(count int) error { + if len(f.nvmetcpTargetInfo) != count { + return fmt.Errorf("expected %d nvmetcp targets but found %d", count, len(f.nvmetcpTargetInfo)) + } + return nil +} + func (f *feature) iInvalidateSymToMaskingViewTargetCache() error { f.service.InvalidateSymToMaskingViewTargets() return nil @@ -4751,6 +4884,34 @@ func (f *feature) iStartNodeAPIServer() { go http.ListenAndServe(f.service.opts.PodmonPort, nil) // #nosec G114 } +func (f *feature) iCallQueryArrayStatus(url string, statusType string) { + if len(url) != 0 { + var status ArrayConnectivityStatus + if statusType == "new" { + status.LastAttempt = time.Now().Unix() + status.LastSuccess = time.Now().Unix() + } else if statusType == "old" { + status.LastAttempt = time.Now().Add(-time.Hour).Unix() + status.LastSuccess = time.Now().Add(-time.Hour).Unix() + } + input, _ := json.Marshal(status) + if statusType == "invalid" { + input = nil + } + + // responding with some dummy response that is for the case when array is connected and LastSuccess check was just finished + http.HandleFunc(url, func(w http.ResponseWriter, _ *http.Request) { + w.Write(input) + }) + + f.service.opts.PodmonPort = ":9028" + fmt.Printf("Starting server at port %s\n", f.service.opts.PodmonPort) + go http.ListenAndServe(f.service.opts.PodmonPort, nil) // #nosec G114 + } + + _, f.err = f.service.QueryArrayStatus(context.TODO(), "http://localhost"+f.service.opts.PodmonPort+url) +} + func (f *feature) iCallIsIOInProgress() error { symID := f.symmetrixID if inducedErrors.invalidSymID { @@ -4769,6 +4930,46 @@ func (f *feature) theValidateVolumeHostMessageContains(msg string) error { return nil } +func iActionValue(actionvalue string) *csimgr.ArrayMigrateRequest_Action { + if actionvalue == "csimgr.ActionTypes_MG_MIGRATE" { + return &csimgr.ArrayMigrateRequest_Action{ + Action: &csimgr.Action{ + ActionTypes: csimgr.ActionTypes_MG_MIGRATE, + }, + } + } else if actionvalue == "csimgr.ActionTypes_MG_COMMIT" { + return &csimgr.ArrayMigrateRequest_Action{ + Action: &csimgr.Action{ + ActionTypes: csimgr.ActionTypes_MG_COMMIT, + }, + } + } + return &csimgr.ArrayMigrateRequest_Action{ + Action: &csimgr.Action{ + ActionTypes: csimgr.ActionTypes_UNKNOWN_ACTION, + }, + } +} + +func (f *feature) iCallArrayMigrate(actionvalue string) error { + header := metadata.New(map[string]string{"csi.requestid": "2"}) + ctx := metadata.NewIncomingContext(context.Background(), header) + + req := &csimgr.ArrayMigrateRequest{ + Parameters: map[string]string{ + SymmetrixIDParam: mock.DefaultSymmetrixID, + RemoteSymIDParam: mock.DefaultRemoteSymID, + }, + } + action := iActionValue(actionvalue) + if action != nil { + req.ActionTypes = action + } + + f.arrayMigrateResponse, f.err = f.service.ArrayMigrate(ctx, req) + return nil +} + func FeatureContext(s *godog.ScenarioContext) { f := &feature{} s.Step(`^a PowerMax service$`, f.aPowerMaxService) @@ -4847,6 +5048,8 @@ func FeatureContext(s *godog.ScenarioContext) { s.Step(`^I call BeforeServe with an invalid ClusterPrefix$`, f.iCallBeforeServeWithAnInvalidClusterPrefix) s.Step(`^I call NodeStageVolume$`, f.iCallNodeStageVolume) s.Step(`^I call NodeUnstageVolume$`, f.iCallNodeUnstageVolume) + s.Step(`^I call NodeStageVolume with simulator$`, f.iCallNodeStageVolumeWithSimulator) + s.Step(`^I call NodeUnstageVolume with simulator$`, f.iCallNodeUnstageVolumeWithSimulator) s.Step(`^I call NodeGetCapabilities$`, f.iCallNodeGetCapabilities) s.Step(`^a valid NodeGetCapabilitiesResponse is returned$`, f.aValidNodeGetCapabilitiesResponseIsReturned) s.Step(`^I call CreateSnapshot$`, f.iCallCreateSnapshot) @@ -4956,7 +5159,9 @@ func FeatureContext(s *godog.ScenarioContext) { s.Step(`^I enable ISCSI CHAP$`, f.iEnableISCSICHAP) s.Step(`^I wait for the execution to complete$`, f.iWaitForTheExecutionToComplete) s.Step(`^I call getAndConfigureArrayISCSITargets$`, f.iCallGetAndConfigureArrayISCSITargets) + s.Step(`^I call getAndConfigureArrayNVMeTCPTargets$`, f.iCallGetAndConfigureArrayNVMeTCPTargets) s.Step(`^(\d+) targets are returned$`, f.targetsAreReturned) + s.Step(`^(\d+) nvmetcp targets are returned$`, f.nvmetcptargetsAreReturned) s.Step(`^I invalidate symToMaskingViewTarget cache$`, f.iInvalidateSymToMaskingViewTargetCache) s.Step(`^I retry on failed snapshot to succeed$`, f.iRetryOnFailedSnapshotToSucceed) s.Step(`^I ensure the error is cleared$`, f.iEnsureTheErrorIsCleared) @@ -5011,4 +5216,6 @@ func FeatureContext(s *godog.ScenarioContext) { s.Step(`^the ValidateVolumeHost message contains "([^"]*)"$`, f.theValidateVolumeHostMessageContains) s.Step(`^I start node API server$`, f.iStartNodeAPIServer) s.Step(`^I call IsIOInProgress$`, f.iCallIsIOInProgress) + s.Step(`^I call QueryArrayStatus with "([^"]*)" and "([^"]*)"$`, f.iCallQueryArrayStatus) + s.Step(`^I call ArrayMigrate with "([^"]*)"$`, f.iCallArrayMigrate) } diff --git a/service/vsphere.go b/service/vsphere.go index ba7f7a07..9e34a0a6 100644 --- a/service/vsphere.go +++ b/service/vsphere.go @@ -38,6 +38,9 @@ import ( "golang.org/x/net/context" ) +// useHTTP - This variable should remain false by default. It was added specifically for unit testing purposes, as unit tests require HTTP instead of HTTPS. +var useHTTP = false + // VMHost - structure to hold the VM host type VMHost struct { client *govmomi.Client @@ -50,7 +53,11 @@ type VMHost struct { // This method is referenced from https://github.com/codedellemc/govmax/blob/master/api/v1/vmomi.go func NewVMHost(insecure bool, hostURLparam, user, pass string) (*VMHost, error) { ctx, _ := context.WithCancel(context.Background()) - hostURL, err := url.Parse("https://" + hostURLparam + "/sdk") + protocol := "https://" + if useHTTP { + protocol = "http://" + } + hostURL, err := url.Parse(protocol + hostURLparam + "/sdk") hostURL.User = url.UserPassword(user, pass) cli, err := govmomi.NewClient(ctx, hostURL, insecure) diff --git a/service/vsphere_test.go b/service/vsphere_test.go new file mode 100644 index 00000000..a0fb5e55 --- /dev/null +++ b/service/vsphere_test.go @@ -0,0 +1,186 @@ +package service + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/types" + + "golang.org/x/net/context" +) + +func TestNewVMHost(t *testing.T) { + t.Run("Could not find VM with specified MAC Address", func(t *testing.T) { + useHTTP = true + // Create the necessary objects + m := simulator.ESX() + defer m.Remove() + + err := m.Create() + if err != nil { + t.Errorf("Expected nil error, got %v", err) + } + + s := m.Service.NewServer() + defer s.Close() + + user := s.URL.User.Username() + pass, _ := s.URL.User.Password() + + _, err = NewVMHost(true, s.URL.Host, user, pass) + assert.ErrorContains(t, err, "Could not find VM with specified MAC Address") + }) + + t.Run("Error connecting", func(t *testing.T) { + insecure := true + hostURLparam := "localhost" + user := "" + pass := "" + + _, err := NewVMHost(insecure, hostURLparam, user, pass) + assert.Error(t, err) + }) +} + +func TestGetLocalMAC(t *testing.T) { + mac, err := getLocalMAC() + if mac != "" { + assert.NoError(t, err) + } +} + +func TestGetSCSILuns(t *testing.T) { + simulator.Test(func(_ context.Context, c *vim25.Client) { + mockVMHost := &VMHost{ + client: &govmomi.Client{ + Client: c, + }, + VM: object.NewVirtualMachine(c, simulator.Map.Any("VirtualMachine").Reference()), + Ctx: context.Background(), + } + + t.Run("Successful retrieval", func(t *testing.T) { + scsiLuns, err := mockVMHost.GetSCSILuns() + + assert.NoError(t, err) + assert.Equal(t, 2, len(scsiLuns)) + + for _, scsiLun := range scsiLuns { + expectedCanonicalName := map[string]any{"mpx.vmhba0:C0:T0:L0": nil, "mpx.vmhba1:C0:T0:L0": nil} + assert.Contains(t, expectedCanonicalName, scsiLun.CanonicalName) + } + }) + }) +} + +func TestAttachRDM(t *testing.T) { + simulator.Test(func(ctx context.Context, c *vim25.Client) { + mockVMHost := &VMHost{ + client: &govmomi.Client{ + Client: c, + }, + Ctx: context.Background(), + VM: object.NewVirtualMachine(c, simulator.Map.Any("VirtualMachine").Reference()), + } + + // Power on the VM + state, err := mockVMHost.VM.PowerState(ctx) + assert.NoError(t, err) + + if state != types.VirtualMachinePowerStatePoweredOn { + task, err := mockVMHost.VM.PowerOn(ctx) + assert.NoError(t, err) + + err = task.Wait(ctx) + assert.NoError(t, err) + } + + t.Run("no device detected on VM host to add", func(t *testing.T) { + deviceNAA := "deviceNAA" + err = mockVMHost.AttachRDM(mockVMHost.VM, deviceNAA) + assert.EqualError(t, err, "no device detected on VM host to add") + }) + + t.Run("no scsi disk on VM host but found scsi lun", func(t *testing.T) { + deviceNAA := "mpx.vmhba0:C0:T0:L0" + err = mockVMHost.AttachRDM(mockVMHost.VM, deviceNAA) + assert.NoError(t, err) + }) + }) +} + +func TestDetachRDM(t *testing.T) { + simulator.Test(func(_ context.Context, c *vim25.Client) { + mockVMHost := &VMHost{ + client: &govmomi.Client{ + Client: c, + }, + Ctx: context.Background(), + VM: object.NewVirtualMachine(c, simulator.Map.Any("VirtualMachine").Reference()), + } + t.Run("Device is not found in the list of available devices", func(t *testing.T) { + deviceNAA := "mpx.vmhba0:C0:T0:L0" + err := mockVMHost.DetachRDM(mockVMHost.VM, deviceNAA) + assert.NoError(t, err) + }) + }) +} + +func TestRescanAllHba(t *testing.T) { + simulator.Test(func(ctx context.Context, c *vim25.Client) { + mockVMHost := &VMHost{ + client: &govmomi.Client{ + Client: c, + }, + Ctx: context.Background(), + VM: object.NewVirtualMachine(c, simulator.Map.Any("VirtualMachine").Reference()), + } + t.Run("Successful rescan", func(t *testing.T) { + host, err := mockVMHost.VM.HostSystem(ctx) + assert.NoError(t, err) + + err = mockVMHost.RescanAllHba(host) + assert.NoError(t, err) + }) + }) +} + +func TestGetAvailableSCSIController(t *testing.T) { + simulator.Test(func(_ context.Context, c *vim25.Client) { + mockVMHost := &VMHost{ + client: &govmomi.Client{ + Client: c, + }, + Ctx: context.Background(), + VM: object.NewVirtualMachine(c, simulator.Map.Any("VirtualMachine").Reference()), + } + t.Run("Successful GetAvailableSCSIController", func(t *testing.T) { + _, err := mockVMHost.getAvailableSCSIController() + assert.NoError(t, err) + }) + }) +} + +func TestCreateController(t *testing.T) { + simulator.Test(func(_ context.Context, c *vim25.Client) { + mockVMHost := &VMHost{ + client: &govmomi.Client{ + Client: c, + }, + Ctx: context.Background(), + VM: object.NewVirtualMachine(c, simulator.Map.Any("VirtualMachine").Reference()), + } + + t.Run("Successful createController", func(t *testing.T) { + controllers, err := mockVMHost.getSCSIControllers() + assert.NoError(t, err) + + err = mockVMHost.createController(&controllers[0]) + assert.NoError(t, err) + }) + }) +} diff --git a/test/helm/10block/Chart.yaml b/test/helm/10block/Chart.yaml index 36e22b27..6142557e 100644 --- a/test/helm/10block/Chart.yaml +++ b/test/helm/10block/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/10block/templates/test.yaml b/test/helm/10block/templates/test.yaml index 006de6c5..377faebe 100644 --- a/test/helm/10block/templates/test.yaml +++ b/test/helm/10block/templates/test.yaml @@ -12,137 +12,137 @@ metadata: spec: selector: matchLabels: - app: powermaxtest + app: powermaxtest serviceName: test2vols template: - metadata: - labels: - app: powermaxtest - spec: - serviceAccount: powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeDevices: - - devicePath: "/dev/data0" - name: pvol0 - - devicePath: "/dev/data1" - name: pvol1 - - devicePath: "/dev/data2" - name: pvol2 - - devicePath: "/dev/data3" - name: pvol3 - - devicePath: "/dev/data4" - name: pvol4 - - devicePath: "/dev/data5" - name: pvol5 - - devicePath: "/dev/data6" - name: pvol6 - - devicePath: "/dev/data7" - name: pvol7 - - devicePath: "/dev/data8" - name: pvol8 - - devicePath: "/dev/data9" - name: pvol9 + metadata: + labels: + app: powermaxtest + spec: + serviceAccount: powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeDevices: + - devicePath: "/dev/data0" + name: pvol0 + - devicePath: "/dev/data1" + name: pvol1 + - devicePath: "/dev/data2" + name: pvol2 + - devicePath: "/dev/data3" + name: pvol3 + - devicePath: "/dev/data4" + name: pvol4 + - devicePath: "/dev/data5" + name: pvol5 + - devicePath: "/dev/data6" + name: pvol6 + - devicePath: "/dev/data7" + name: pvol7 + - devicePath: "/dev/data8" + name: pvol8 + - devicePath: "/dev/data9" + name: pvol9 volumeClaimTemplates: - - metadata: - name: pvol0 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi - - metadata: - name: pvol1 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi - - metadata: - name: pvol2 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi - - metadata: - name: pvol3 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi - - metadata: - name: pvol4 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi - - metadata: - name: pvol5 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi - - metadata: - name: pvol6 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi - - metadata: - name: pvol7 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi - - metadata: - name: pvol8 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi - - metadata: - name: pvol9 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi + - metadata: + name: pvol0 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi + - metadata: + name: pvol1 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi + - metadata: + name: pvol2 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi + - metadata: + name: pvol3 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi + - metadata: + name: pvol4 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi + - metadata: + name: pvol5 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi + - metadata: + name: pvol6 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi + - metadata: + name: pvol7 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi + - metadata: + name: pvol8 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi + - metadata: + name: pvol9 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi diff --git a/test/helm/10vols/Chart.yaml b/test/helm/10vols/Chart.yaml index 339fa72d..2a02146c 100644 --- a/test/helm/10vols/Chart.yaml +++ b/test/helm/10vols/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/10vols/templates/pvc.yaml b/test/helm/10vols/templates/pvc.yaml index de153575..6c1394ad 100644 --- a/test/helm/10vols/templates/pvc.yaml +++ b/test/helm/10vols/templates/pvc.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -19,7 +19,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -33,7 +33,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -47,7 +47,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -61,7 +61,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -75,7 +75,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -89,7 +89,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -103,7 +103,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -117,7 +117,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -131,7 +131,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/10vols/templates/test.yaml b/test/helm/10vols/templates/test.yaml index 51b7d4b4..02267327 100644 --- a/test/helm/10vols/templates/test.yaml +++ b/test/helm/10vols/templates/test.yaml @@ -12,67 +12,67 @@ metadata: spec: selector: matchLabels: - app: powermaxtest + app: powermaxtest serviceName: test2vols template: - metadata: - labels: - app: powermaxtest - spec: - serviceAccount: powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeMounts: - - mountPath: "/data0" - name: pvol0 - - mountPath: "/data1" - name: pvol1 - - mountPath: "/data2" - name: pvol2 - - mountPath: "/data3" - name: pvol3 - - mountPath: "/data4" - name: pvol4 - - mountPath: "/data5" - name: pvol5 - - mountPath: "/data6" - name: pvol6 - - mountPath: "/data7" - name: pvol7 - - mountPath: "/data8" - name: pvol8 - - mountPath: "/data9" - name: pvol9 - volumes: - - name: pvol0 - persistentVolumeClaim: - claimName: pvol0 - - name: pvol1 - persistentVolumeClaim: - claimName: pvol1 - - name: pvol2 - persistentVolumeClaim: - claimName: pvol2 - - name: pvol3 - persistentVolumeClaim: - claimName: pvol3 - - name: pvol4 - persistentVolumeClaim: - claimName: pvol4 - - name: pvol5 - persistentVolumeClaim: - claimName: pvol5 - - name: pvol6 - persistentVolumeClaim: - claimName: pvol6 - - name: pvol7 - persistentVolumeClaim: - claimName: pvol7 - - name: pvol8 - persistentVolumeClaim: - claimName: pvol8 - - name: pvol9 - persistentVolumeClaim: - claimName: pvol9 + metadata: + labels: + app: powermaxtest + spec: + serviceAccount: powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeMounts: + - mountPath: "/data0" + name: pvol0 + - mountPath: "/data1" + name: pvol1 + - mountPath: "/data2" + name: pvol2 + - mountPath: "/data3" + name: pvol3 + - mountPath: "/data4" + name: pvol4 + - mountPath: "/data5" + name: pvol5 + - mountPath: "/data6" + name: pvol6 + - mountPath: "/data7" + name: pvol7 + - mountPath: "/data8" + name: pvol8 + - mountPath: "/data9" + name: pvol9 + volumes: + - name: pvol0 + persistentVolumeClaim: + claimName: pvol0 + - name: pvol1 + persistentVolumeClaim: + claimName: pvol1 + - name: pvol2 + persistentVolumeClaim: + claimName: pvol2 + - name: pvol3 + persistentVolumeClaim: + claimName: pvol3 + - name: pvol4 + persistentVolumeClaim: + claimName: pvol4 + - name: pvol5 + persistentVolumeClaim: + claimName: pvol5 + - name: pvol6 + persistentVolumeClaim: + claimName: pvol6 + - name: pvol7 + persistentVolumeClaim: + claimName: pvol7 + - name: pvol8 + persistentVolumeClaim: + claimName: pvol8 + - name: pvol9 + persistentVolumeClaim: + claimName: pvol9 diff --git a/test/helm/1bigvol/Chart.yaml b/test/helm/1bigvol/Chart.yaml index a54f9759..206a6629 100644 --- a/test/helm/1bigvol/Chart.yaml +++ b/test/helm/1bigvol/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/1bigvol/templates/pvc0.yaml b/test/helm/1bigvol/templates/pvc0.yaml index 5b2a84af..e5661a57 100644 --- a/test/helm/1bigvol/templates/pvc0.yaml +++ b/test/helm/1bigvol/templates/pvc0.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/1bigvol/templates/test.yaml b/test/helm/1bigvol/templates/test.yaml index fe3107bc..4b8d3de6 100644 --- a/test/helm/1bigvol/templates/test.yaml +++ b/test/helm/1bigvol/templates/test.yaml @@ -12,22 +12,22 @@ metadata: spec: selector: matchLabels: - app: powermaxtest + app: powermaxtest serviceName: test2vols template: - metadata: - labels: - app: powermaxtest - spec: - serviceAccount: powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeMounts: - - mountPath: "/data0" - name: pvol0 - volumes: - - name: pvol0 - persistentVolumeClaim: - claimName: pvol0 + metadata: + labels: + app: powermaxtest + spec: + serviceAccount: powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeMounts: + - mountPath: "/data0" + name: pvol0 + volumes: + - name: pvol0 + persistentVolumeClaim: + claimName: pvol0 diff --git a/test/helm/1bigvol/values.yaml b/test/helm/1bigvol/values.yaml index d3e86dea..62190733 100644 --- a/test/helm/1bigvol/values.yaml +++ b/test/helm/1bigvol/values.yaml @@ -1,2 +1,2 @@ sc: "" -scxfs: "" \ No newline at end of file +scxfs: "" diff --git a/test/helm/1clonevol/Chart.yaml b/test/helm/1clonevol/Chart.yaml index a991e624..d75cc714 100644 --- a/test/helm/1clonevol/Chart.yaml +++ b/test/helm/1clonevol/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/1clonevol/templates/test.yaml b/test/helm/1clonevol/templates/test.yaml index 2531ccf8..33b6686c 100644 --- a/test/helm/1clonevol/templates/test.yaml +++ b/test/helm/1clonevol/templates/test.yaml @@ -12,32 +12,32 @@ metadata: spec: selector: matchLabels: - app: powermaxclonetest + app: powermaxclonetest serviceName: test1clonevol template: - metadata: - labels: - app: powermaxclonetest - spec: - affinity: - podAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - "powermaxtest" - topologyKey: kubernetes.io/hostname - serviceAccount: powermaxclonetest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeMounts: - - mountPath: "/data0" - name: restorepvol - volumes: - - name: restorepvol - persistentVolumeClaim: - claimName: restorepvc + metadata: + labels: + app: powermaxclonetest + spec: + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - "powermaxtest" + topologyKey: kubernetes.io/hostname + serviceAccount: powermaxclonetest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeMounts: + - mountPath: "/data0" + name: restorepvol + volumes: + - name: restorepvol + persistentVolumeClaim: + claimName: restorepvc diff --git a/test/helm/1vol-rep/Chart.yaml b/test/helm/1vol-rep/Chart.yaml index 9fee14ea..4e9e6d87 100644 --- a/test/helm/1vol-rep/Chart.yaml +++ b/test/helm/1vol-rep/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/1vol-rep/templates/pvc0.yaml b/test/helm/1vol-rep/templates/pvc0.yaml index ccc210db..a2e698b2 100644 --- a/test/helm/1vol-rep/templates/pvc0.yaml +++ b/test/helm/1vol-rep/templates/pvc0.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/1vol-rep/templates/test.yaml b/test/helm/1vol-rep/templates/test.yaml index 0b47053d..6b94cca4 100644 --- a/test/helm/1vol-rep/templates/test.yaml +++ b/test/helm/1vol-rep/templates/test.yaml @@ -12,22 +12,22 @@ metadata: spec: selector: matchLabels: - app: rep-powermaxtest + app: rep-powermaxtest serviceName: test2vols template: - metadata: - labels: - app: rep-powermaxtest - spec: - serviceAccount: rep-powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeMounts: - - mountPath: "/data0" - name: rep-pvol0 - volumes: - - name: rep-pvol0 - persistentVolumeClaim: - claimName: rep-pvol0 + metadata: + labels: + app: rep-powermaxtest + spec: + serviceAccount: rep-powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeMounts: + - mountPath: "/data0" + name: rep-pvol0 + volumes: + - name: rep-pvol0 + persistentVolumeClaim: + claimName: rep-pvol0 diff --git a/test/helm/1vol/Chart.yaml b/test/helm/1vol/Chart.yaml index 9809c1c4..3df3df1c 100644 --- a/test/helm/1vol/Chart.yaml +++ b/test/helm/1vol/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/1vol/templates/pvc0.yaml b/test/helm/1vol/templates/pvc0.yaml index d70369e2..db23909c 100644 --- a/test/helm/1vol/templates/pvc0.yaml +++ b/test/helm/1vol/templates/pvc0.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/1vol/templates/test.yaml b/test/helm/1vol/templates/test.yaml index fe3107bc..4b8d3de6 100644 --- a/test/helm/1vol/templates/test.yaml +++ b/test/helm/1vol/templates/test.yaml @@ -12,22 +12,22 @@ metadata: spec: selector: matchLabels: - app: powermaxtest + app: powermaxtest serviceName: test2vols template: - metadata: - labels: - app: powermaxtest - spec: - serviceAccount: powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeMounts: - - mountPath: "/data0" - name: pvol0 - volumes: - - name: pvol0 - persistentVolumeClaim: - claimName: pvol0 + metadata: + labels: + app: powermaxtest + spec: + serviceAccount: powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeMounts: + - mountPath: "/data0" + name: pvol0 + volumes: + - name: pvol0 + persistentVolumeClaim: + claimName: pvol0 diff --git a/test/helm/2block/Chart.yaml b/test/helm/2block/Chart.yaml index d4ecd762..1c87b72a 100644 --- a/test/helm/2block/Chart.yaml +++ b/test/helm/2block/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/2block/templates/test.yaml b/test/helm/2block/templates/test.yaml index e43db72b..252f153c 100644 --- a/test/helm/2block/templates/test.yaml +++ b/test/helm/2block/templates/test.yaml @@ -12,41 +12,41 @@ metadata: spec: selector: matchLabels: - app: powermaxtest + app: powermaxtest serviceName: test2vols template: - metadata: - labels: - app: powermaxtest - spec: - serviceAccount: powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeDevices: - - devicePath: "/dev/data0" - name: pvol0 - - devicePath: "/dev/data1" - name: pvol1 - volumeClaimTemplates: - - metadata: - name: pvol0 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi - - metadata: - name: pvol1 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 1Gi + metadata: + labels: + app: powermaxtest + spec: + serviceAccount: powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeDevices: + - devicePath: "/dev/data0" + name: pvol0 + - devicePath: "/dev/data1" + name: pvol1 + volumeClaimTemplates: + - metadata: + name: pvol0 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi + - metadata: + name: pvol1 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 1Gi diff --git a/test/helm/2vols+clone/Chart.yaml b/test/helm/2vols+clone/Chart.yaml index 5739ef10..7dca1668 100644 --- a/test/helm/2vols+clone/Chart.yaml +++ b/test/helm/2vols+clone/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/2vols+clone/templates/pvc0.yaml b/test/helm/2vols+clone/templates/pvc0.yaml index d70369e2..db23909c 100644 --- a/test/helm/2vols+clone/templates/pvc0.yaml +++ b/test/helm/2vols+clone/templates/pvc0.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/2vols+clone/templates/pvc1.yaml b/test/helm/2vols+clone/templates/pvc1.yaml index 6fdad66f..544a3877 100644 --- a/test/helm/2vols+clone/templates/pvc1.yaml +++ b/test/helm/2vols+clone/templates/pvc1.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/2vols+clone/templates/test.yaml b/test/helm/2vols+clone/templates/test.yaml index 6cfe2bbd..2525b263 100644 --- a/test/helm/2vols+clone/templates/test.yaml +++ b/test/helm/2vols+clone/templates/test.yaml @@ -12,32 +12,32 @@ metadata: spec: selector: matchLabels: - app: powermaxtest + app: powermaxtest serviceName: test2vols template: - metadata: - labels: - app: powermaxtest - spec: - serviceAccount: powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeMounts: - - mountPath: "/data0" - name: pvol0 - - mountPath: "/data1" - name: pvol1 - - mountPath: "/data2" - name: pvol2 - volumes: - - name: pvol0 - persistentVolumeClaim: - claimName: pvol0 - - name: pvol1 - persistentVolumeClaim: - claimName: pvol1 - - name: pvol2 - persistentVolumeClaim: - claimName: clonedpvc + metadata: + labels: + app: powermaxtest + spec: + serviceAccount: powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeMounts: + - mountPath: "/data0" + name: pvol0 + - mountPath: "/data1" + name: pvol1 + - mountPath: "/data2" + name: pvol2 + volumes: + - name: pvol0 + persistentVolumeClaim: + claimName: pvol0 + - name: pvol1 + persistentVolumeClaim: + claimName: pvol1 + - name: pvol2 + persistentVolumeClaim: + claimName: clonedpvc diff --git a/test/helm/2vols+restore/Chart.yaml b/test/helm/2vols+restore/Chart.yaml index a78c21b1..1076f600 100644 --- a/test/helm/2vols+restore/Chart.yaml +++ b/test/helm/2vols+restore/Chart.yaml @@ -4,6 +4,6 @@ appVersion: v1 description: Tests Powermax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/2vols+restore/templates/pvc0.yaml b/test/helm/2vols+restore/templates/pvc0.yaml index d70369e2..db23909c 100644 --- a/test/helm/2vols+restore/templates/pvc0.yaml +++ b/test/helm/2vols+restore/templates/pvc0.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/2vols+restore/templates/pvc1.yaml b/test/helm/2vols+restore/templates/pvc1.yaml index 6fdad66f..544a3877 100644 --- a/test/helm/2vols+restore/templates/pvc1.yaml +++ b/test/helm/2vols+restore/templates/pvc1.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/2vols+restore/templates/test.yaml b/test/helm/2vols+restore/templates/test.yaml index 1e2f3c33..ff659009 100644 --- a/test/helm/2vols+restore/templates/test.yaml +++ b/test/helm/2vols+restore/templates/test.yaml @@ -12,32 +12,32 @@ metadata: spec: selector: matchLabels: - app: powermaxtest + app: powermaxtest serviceName: test2vols template: - metadata: - labels: - app: powermaxtest - spec: - serviceAccount: powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeMounts: - - mountPath: "/data0" - name: pvol0 - - mountPath: "/data1" - name: pvol1 - - mountPath: "/data2" - name: pvol2 - volumes: - - name: pvol0 - persistentVolumeClaim: - claimName: pvol0 - - name: pvol1 - persistentVolumeClaim: - claimName: pvol1 - - name: pvol2 - persistentVolumeClaim: - claimName: restorepvc + metadata: + labels: + app: powermaxtest + spec: + serviceAccount: powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeMounts: + - mountPath: "/data0" + name: pvol0 + - mountPath: "/data1" + name: pvol1 + - mountPath: "/data2" + name: pvol2 + volumes: + - name: pvol0 + persistentVolumeClaim: + claimName: pvol0 + - name: pvol1 + persistentVolumeClaim: + claimName: pvol1 + - name: pvol2 + persistentVolumeClaim: + claimName: restorepvc diff --git a/test/helm/2vols/Chart.yaml b/test/helm/2vols/Chart.yaml index 3a86b94b..7a70befd 100644 --- a/test/helm/2vols/Chart.yaml +++ b/test/helm/2vols/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/2vols/templates/pvc0.yaml b/test/helm/2vols/templates/pvc0.yaml index d70369e2..db23909c 100644 --- a/test/helm/2vols/templates/pvc0.yaml +++ b/test/helm/2vols/templates/pvc0.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/2vols/templates/pvc1.yaml b/test/helm/2vols/templates/pvc1.yaml index 6fdad66f..544a3877 100644 --- a/test/helm/2vols/templates/pvc1.yaml +++ b/test/helm/2vols/templates/pvc1.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/2vols/templates/test.yaml b/test/helm/2vols/templates/test.yaml index 349e434b..d433b661 100644 --- a/test/helm/2vols/templates/test.yaml +++ b/test/helm/2vols/templates/test.yaml @@ -12,27 +12,27 @@ metadata: spec: selector: matchLabels: - app: powermaxtest + app: powermaxtest serviceName: test2vols template: - metadata: - labels: - app: powermaxtest - spec: - serviceAccount: powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeMounts: - - mountPath: "/data0" - name: pvol0 - - mountPath: "/data1" - name: pvol1 - volumes: - - name: pvol0 - persistentVolumeClaim: - claimName: pvol0 - - name: pvol1 - persistentVolumeClaim: - claimName: pvol1 + metadata: + labels: + app: powermaxtest + spec: + serviceAccount: powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeMounts: + - mountPath: "/data0" + name: pvol0 + - mountPath: "/data1" + name: pvol1 + volumes: + - name: pvol0 + persistentVolumeClaim: + claimName: pvol0 + - name: pvol1 + persistentVolumeClaim: + claimName: pvol1 diff --git a/test/helm/7vols/templates/pvc.yaml b/test/helm/7vols/templates/pvc.yaml index 81a49fac..7beae47e 100644 --- a/test/helm/7vols/templates/pvc.yaml +++ b/test/helm/7vols/templates/pvc.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -19,7 +19,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -33,7 +33,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -47,7 +47,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -61,7 +61,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -75,7 +75,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: @@ -89,7 +89,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem resources: requests: diff --git a/test/helm/block/Chart.yaml b/test/helm/block/Chart.yaml index f92772b3..28e5e65b 100644 --- a/test/helm/block/Chart.yaml +++ b/test/helm/block/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/block/templates/test.yaml b/test/helm/block/templates/test.yaml index 6f768ade..8395dba1 100644 --- a/test/helm/block/templates/test.yaml +++ b/test/helm/block/templates/test.yaml @@ -12,29 +12,29 @@ metadata: spec: selector: matchLabels: - app: powermaxtest + app: powermaxtest serviceName: test2vols template: - metadata: - labels: - app: powermaxtest - spec: - serviceAccount: powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeDevices: - - devicePath: "/dev/data0" - name: pvol0 + metadata: + labels: + app: powermaxtest + spec: + serviceAccount: powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeDevices: + - devicePath: "/dev/data0" + name: pvol0 volumeClaimTemplates: - - metadata: - name: pvol0 - spec: - accessModes: - - ReadWriteOnce - volumeMode: Block - storageClassName: {{ .Values.sc }} - resources: - requests: - storage: 8Gi + - metadata: + name: pvol0 + spec: + accessModes: + - ReadWriteOnce + volumeMode: Block + storageClassName: {{ .Values.sc }} + resources: + requests: + storage: 8Gi diff --git a/test/helm/xfspre/Chart.yaml b/test/helm/xfspre/Chart.yaml index 53ea4f79..e669600e 100644 --- a/test/helm/xfspre/Chart.yaml +++ b/test/helm/xfspre/Chart.yaml @@ -6,6 +6,6 @@ description: | Tests PowerMax CSI deployments. icon: https://avatars1.githubusercontent.com/u/20958494?s=200&v=4 keywords: -- csi-powermax -- storage + - csi-powermax + - storage engine: gotpl diff --git a/test/helm/xfspre/templates/pv.yaml b/test/helm/xfspre/templates/pv.yaml index b855dfdd..5d4e2f18 100644 --- a/test/helm/xfspre/templates/pv.yaml +++ b/test/helm/xfspre/templates/pv.yaml @@ -12,5 +12,5 @@ spec: volumeHandle: 72cebf0c00000001 volumeMode: Filesystem accessModes: - - ReadWriteOnce + - ReadWriteOnce storageClassName: {{ .Values.sc }} diff --git a/test/helm/xfspre/templates/pvc4.yaml b/test/helm/xfspre/templates/pvc4.yaml index 49d2e695..b04adac2 100644 --- a/test/helm/xfspre/templates/pvc4.yaml +++ b/test/helm/xfspre/templates/pvc4.yaml @@ -5,7 +5,7 @@ metadata: namespace: {{ .Values.namespace }} spec: accessModes: - - ReadWriteOnce + - ReadWriteOnce volumeMode: Filesystem volumeName: vol4 resources: diff --git a/test/helm/xfspre/templates/test.yaml b/test/helm/xfspre/templates/test.yaml index c4858e18..f7251e92 100644 --- a/test/helm/xfspre/templates/test.yaml +++ b/test/helm/xfspre/templates/test.yaml @@ -12,23 +12,22 @@ metadata: spec: selector: matchLabels: - app: powermaxtest + app: powermaxtest serviceName: test2vols template: - metadata: - labels: - app: powermaxtest - spec: - serviceAccount: powermaxtest - containers: - - name: test - image: docker.io/centos:latest - command: [ "/bin/sleep", "3600" ] - volumeMounts: - - mountPath: "/data4" - name: pvol4 - volumes: - - name: pvol4 - persistentVolumeClaim: - claimName: pvol4 - + metadata: + labels: + app: powermaxtest + spec: + serviceAccount: powermaxtest + containers: + - name: test + image: docker.io/centos:latest + command: [ "/bin/sleep", "3600" ] + volumeMounts: + - mountPath: "/data4" + name: pvol4 + volumes: + - name: pvol4 + persistentVolumeClaim: + claimName: pvol4 diff --git a/test/sanity/secrets.yaml b/test/sanity/secrets.yaml index c0654471..24cebdd3 100644 --- a/test/sanity/secrets.yaml +++ b/test/sanity/secrets.yaml @@ -16,4 +16,3 @@ NodePublishVolumeSecret: secretKey: secretval6 ControllerValidateVolumeCapabilitiesSecret: secretKey: secretval7 -