Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Code Coverage #374

Merged
merged 56 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d1f334d
Update common-workflows.yaml
sakshi-garg1 Nov 18, 2024
ccf0ba7
Update common-workflows.yaml
sakshi-garg1 Nov 18, 2024
84c37a0
Update common-workflows.yaml
sakshi-garg1 Nov 18, 2024
cc6f2ff
Add mock data
AkshaySainiDell Nov 18, 2024
9827c72
Update service_unit_test.go
sakshi-garg1 Nov 18, 2024
de85c8d
Update service_unit_test.go
sakshi-garg1 Nov 18, 2024
d5e7cb5
Add @v2.11.0 tag to csi_extension.feature
AkshaySainiDell Nov 19, 2024
7c60703
Create vsphere_test.go
sakshi-garg1 Nov 19, 2024
d6cccc7
Update node_connectivity_checker_test.go
KshitijaKakde Nov 19, 2024
a062da2
Increase coverage of csi_ctrl_to_node_connectivity
AkshaySainiDell Nov 19, 2024
756f524
Increase coverage of csi_ctrl_to_node_connectivity
AkshaySainiDell Nov 20, 2024
857a6f5
Add UT for GetSCSILuns in vsphere.go
AkshaySainiDell Nov 21, 2024
c2fc4c7
Update go.mod
AkshaySainiDell Nov 21, 2024
3fa7220
Update csi_extension.feature
AkshaySainiDell Nov 21, 2024
e133049
Create deletion_worker_test.go
sakshi-garg1 Nov 21, 2024
45e765d
Update deletion_worker_test.go
sakshi-garg1 Nov 21, 2024
5b136ec
Update deletion_worker_test.go
sakshi-garg1 Nov 21, 2024
2733859
Update deletion_worker_test.go
sakshi-garg1 Nov 21, 2024
a6debb3
Add UT for AttachRDM in vsphere.go
AkshaySainiDell Nov 21, 2024
38c54db
Add UT for DetachRDM in vsphere.go
AkshaySainiDell Nov 21, 2024
06df609
Add UT for NewVMHost in vsphere.go
AkshaySainiDell Nov 21, 2024
5a5c392
Fix failure in TestNewVMHost
AkshaySainiDell Nov 21, 2024
aa9640a
Add UT for RescanAllHba in vsphere.go
AkshaySainiDell Nov 22, 2024
9efcc7c
Update name of test case in vsphere.go
AkshaySainiDell Nov 22, 2024
073d72c
Adding Test for UpdateDriverConfigParams
sakshi-garg1 Nov 22, 2024
a6ca8a3
Add more unit tests for vsphere.go
AkshaySainiDell Nov 22, 2024
06afadd
Added UT for ArrayMigrate
Nov 22, 2024
4cf0e4c
Merge branch 'update-ut' of https://github.com/dell/csi-powermax into…
Nov 22, 2024
b125564
yaml lint updates
mbasha-dell Nov 22, 2024
4e68144
additional yaml lint fixes
mbasha-dell Nov 22, 2024
e26a4e4
yaml lint fixes
mbasha-dell Nov 22, 2024
43e6c7f
Adding test for SetArrayConfigEnvs
sakshi-garg1 Nov 25, 2024
46314a0
Adding test for getProxySettingsFromEnv function
sakshi-garg1 Nov 25, 2024
fe7b84e
Adding test for GetTransportProtocolFromEnv function
sakshi-garg1 Nov 25, 2024
b86d2b9
Adding Test for SetPollingFrequency and GetDriverName
sakshi-garg1 Nov 25, 2024
0a7aad3
Updating TestUpdateDriverConfigParams to increase coverage
sakshi-garg1 Nov 25, 2024
8823d2e
Adding test for RegisterAdditionalServers
sakshi-garg1 Nov 25, 2024
c8d62f7
Updating TestRegisterAdditionalServers
sakshi-garg1 Nov 25, 2024
80b0c52
Update service_unit_test.go
sakshi-garg1 Nov 25, 2024
2d09de2
Add UT for nvmetcp in node.go
AkshaySainiDell Nov 25, 2024
0875003
Add UT for nvmetcp in node.go
AkshaySainiDell Nov 25, 2024
84d7f67
Update UT coverage
WilsonRadadia20 Nov 25, 2024
0e29736
Fix UT
AkshaySainiDell Nov 25, 2024
28c7e47
fixed helm test files yamllint issues
mbasha-dell Nov 25, 2024
b20277b
Add UT for vsphere in node.go
AkshaySainiDell Nov 26, 2024
ce36f6f
Update migration UT
WilsonRadadia20 Nov 26, 2024
7a4a0ae
Adding test for getNVMeTCPTargetsForMaskingView
sakshi-garg1 Nov 26, 2024
4b9be92
Update service.feature
sakshi-garg1 Nov 26, 2024
012aa2d
Add UT for node.go
AkshaySainiDell Nov 26, 2024
312868e
Update UT for migration.go
WilsonRadadia20 Nov 26, 2024
79270bc
Add UT for node.go
AkshaySainiDell Nov 26, 2024
5a17d4f
Update changes
WilsonRadadia20 Nov 26, 2024
b95807d
Merge branch 'update-ut' of https://github.com/dell/csi-powermax into…
WilsonRadadia20 Nov 26, 2024
fb6cba4
fixed golint issues
mbasha-dell Nov 26, 2024
8b970c5
gofumpt run for erroring files
mbasha-dell Nov 26, 2024
448c529
further gofumpt runs for subsequent erroring files
mbasha-dell Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./... )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sakshi-garg1 Removing this -skip TestGoDog will result in running BDD tests as well as a part of unit-tests and it may fail

( 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
Expand Down
2 changes: 1 addition & 1 deletion csireverseproxy/manifests/revproxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
- 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

Check warning on line 76 in csireverseproxy/manifests/revproxy.yaml

View workflow job for this annotation

GitHub Actions / Golang Validation / Yaml Lint

76:31 [comments] too few spaces before comment
volumeMounts:
- name: configmap-volume
mountPath: /etc/config/configmap
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
8 changes: 4 additions & 4 deletions pkg/migration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion samples/configmap/powermax-array-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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,"
8 changes: 4 additions & 4 deletions samples/storageclass/powermax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 4 additions & 5 deletions samples/storageclass/powermax_fc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -88,4 +88,3 @@ allowedTopologies:
- key: csi-powermax.dellemc.com/<SYMID>.fc
values:
- csi-powermax.dellemc.com

8 changes: 4 additions & 4 deletions samples/storageclass/powermax_iscsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions samples/storageclass/powermax_nfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions samples/storageclass/powermax_nvmetcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions samples/storageclass/powermax_srdf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
# ######################
Expand Down
8 changes: 4 additions & 4 deletions samples/storageclass/powermax_vsphere.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions samples/storageclass/powermax_xfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading
Loading