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

Add e2e test for csi-unity #203

Merged
merged 1 commit into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 tests/e2e/cleanup-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ while getopts ":h-:" optchar; do
esac
done

rm -f cert-csi isilon.db vxflexos.db powerstore.db
rm -f cert-csi isilon.db vxflexos.db powerstore.db unity.db

if [ -z "$KEEPLOGS" ]; then
rm -f error.log fatal.log info.log report.path
Expand Down
101 changes: 101 additions & 0 deletions tests/e2e/testfiles/storage_csm_unity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
apiVersion: storage.dell.com/v1
kind: ContainerStorageModule
metadata:
name: test-unity
namespace: test-unity
spec:
driver:
csiDriverType: "unity"
csiDriverSpec:
# fsGroupPolicy: Defines if the underlying volume supports changing ownership and permission of the volume before being mounted.
# Allowed values: ReadWriteOnceWithFSType, File , None
# Default value: ReadWriteOnceWithFSType
fSGroupPolicy: "ReadWriteOnceWithFSType"
# Config version for CSI Unity v2.6.0 driver
configVersion: v2.6.0
# authSecret: This is the secret used to validate the default Unity secret used for installation
# Allowed values: <metadataName specified in the Manifest>-config
# For example: If the metadataName is set to test-unity, authSecret value should be set to test-unity-config
authSecret: test-unity-creds
# Controller count
replicas: 2
dnsPolicy: ClusterFirstWithHostNet
forceUpdate: false
forceRemoveDriver: true
common:
# Image for CSI Unity driver v2.6.0
image: "dellemc/csi-unity:v2.6.0"
imagePullPolicy: IfNotPresent
envs:
- name: X_CSI_UNITY_NODENAME_PREFIX
value: "csi-node"
- name: X_CSI_UNITY_ALLOW_MULTI_POD_ACCESS
value: "false"
- name: X_CSI_EPHEMERAL_STAGING_PATH
value: "/var/lib/kubelet/plugins/kubernetes.io/csi/pv/"
- name: X_CSI_ISCSI_CHROOT
value: "/noderoot"
- name: X_CSI_UNITY_SYNC_NODEINFO_INTERVAL
value: "15"
- name: KUBELET_CONFIG_DIR
value: /var/lib/kubelet
- name: CSI_LOG_LEVEL
value: debug
- name: TENANT_NAME
value: ""

sideCars:
# health monitor is disabled by default, refer to driver documentation before enabling it
- name: external-health-monitor
enabled: false
args: ["--monitor-interval=60s"]
controller:
envs:
# X_CSI_HEALTH_MONITOR_ENABLED: Enable/Disable health monitor of CSI volumes from Controller plugin - volume condition.
# Install the 'external-health-monitor' sidecar accordingly.
# Allowed values:
# true: enable checking of health condition of CSI volumes
# false: disable checking of health condition of CSI volumes
# Default value: false
- name: X_CSI_HEALTH_MONITOR_ENABLED
value: "false"
nodeSelector:
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# node-role.kubernetes.io/control-plane: ""

# tolerations: Define tolerations for the controllers, if required.
# Leave as blank to install controller on worker nodes
# Default value: None
tolerations:
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# - key: "node-role.kubernetes.io/control-plane"
# operator: "Exists"
# effect: "NoSchedule"
node:
envs:
# X_CSI_HEALTH_MONITOR_ENABLED: Enable/Disable health monitor of CSI volumes from node plugin - volume usage
# Allowed values:
# true: enable checking of health condition of CSI volumes
# false: disable checking of health condition of CSI volumes
# Default value: false
- name: X_CSI_HEALTH_MONITOR_ENABLED
value: "false"

# nodeSelector: Define node selection constraints for node pods.
# For the pod to be eligible to run on a node, the node must have each
# of the indicated key-value pairs as labels.
# Leave as blank to consider all nodes
# Allowed values: map of key-value pairs
# Default value: None
nodeSelector:
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# node-role.kubernetes.io/control-plane: ""

# tolerations: Define tolerations for the controllers, if required.
# Leave as blank to install controller on worker nodes
# Default value: None
tolerations:
# Uncomment if nodes you wish to use have the node-role.kubernetes.io/control-plane taint
# - key: "node-role.kubernetes.io/control-plane"
# operator: "Exists"
# effect: "NoSchedule"
23 changes: 23 additions & 0 deletions tests/e2e/testfiles/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -643,3 +643,26 @@
# ./hello_world.sh
# cert-csi test vio --sc <storage class> --chainNumber 2 --chainLength 2
run: ./cert-csi test vio --sc powerstore --chainNumber 2 --chainLength 2

- scenario: "Install Unity Driver(Standalone)"
paths:
- "testfiles/storage_csm_unity.yaml"
modules:
steps:
- "Given an environment with k8s or openshift, and CSM operator installed"
- "Apply custom resource [1]"
- "Validate custom resource [1]"
- "Validate [unity] driver from CR [1] is installed"
- "Run custom test"
# Last two steps perform Clean Up
- "Enable forceRemoveDriver on CR [1]"
- "Delete custom resource [1]"
customTest:
# name of custom test to run
name: Cert CSI
# Provide command-line argument to run. Ginkgo will run the command and return output
# The command should be accessible from e2e_test repo. The cert-csi path is supplied in the values file.
# Example:
# ./hello_world.sh
# cert-csi test vio --sc <storage class> --chainNumber 2 --chainLength 2
run: ./cert-csi test vio --sc unity --chainNumber 2 --chainLength 2