Skip to content

Commit

Permalink
Bug 1389 cert persister 017 (#646)
Browse files Browse the repository at this point in the history
* Update cert-persister and install scripts.
* Some updates to the e2e tests.
* update env to apex-client type
* Fix e2e tests

---------

Co-authored-by: nitesh3108 <nitesh_rewatkar@dell.com>
  • Loading branch information
ChristianAtDell and nitesh3108 committed Oct 15, 2024
1 parent a987815 commit 920de18
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 47 deletions.
4 changes: 2 additions & 2 deletions samples/connectivity_client_v110.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ spec:
image: bitnami/kubectl:1.29
imagePullPolicy: IfNotPresent
- name: cert-persister
image: dellemc/connectivity-cert-persister-k8s:0.11.0
imagePullPolicy: IfNotPresent
image: dellemc/connectivity-cert-persister-k8s:0.17.0
imagePullPolicy: IfNotPresent
6 changes: 3 additions & 3 deletions scripts/install_connectivity_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

if [[ $# -ne 1 ]]; then
echo "Incorrect input parameters provided to script $0."
echo "Script Usage:"
echo "Script usage:"
echo "$0 <connectivityclient-version>"
echo "Example:- connectivityclient-version => v100 , v110"
echo "Example: $0 v110"
exit 1
fi

Expand Down Expand Up @@ -60,7 +60,7 @@ if [[ $(echo "$secret_check" | wc -l) -gt 1 ]]; then
echo "Dell Connectivity Client ${connectivity_ver} installed."
else
echo "No secrets found"
$CMD apply -f $ROOTDIR/samples/connectivity_client_secret.yaml
$CMD apply -f $ROOTDIR/samples/connectivity_client_${connectivity_ver}.yaml
$CMD apply -f $ROOTDIR/samples/conn_secret_test.yaml
echo "Dell Connectivity Client ${connectivity_ver} installed."
fi
8 changes: 4 additions & 4 deletions scripts/uninstall_connectivity_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

if [[ $# -ne 1 ]]; then
echo "Incorrect input parameters provided to script $0."
echo "Script Usage:"
echo "Script usage:"
echo "$0 <connectivityclient-version>"
echo "Example:- connectivityclient-version => v100 , v110"
echo "Example: $0 v110"
exit 1
fi

Expand All @@ -40,7 +40,7 @@ if [ -z "$CMD" ]; then
exit 1
fi

$CMD apply -f $ROOTDIR/samples/connectivity_client_${connectivity_ver}.yaml
$CMD apply -f $ROOTDIR/samples/conn_secret_test.yaml
$CMD delete -f $ROOTDIR/samples/connectivity_client_${connectivity_ver}.yaml
$CMD delete -f $ROOTDIR/samples/connectivity_client_secret.yaml

echo "Dell Connectivity Client ${connectivity_ver} uninstalled."
2 changes: 1 addition & 1 deletion tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestE2E(t *testing.T) {
}

var _ = BeforeSuite(func() {
tagEnvVars := []string{"AUTHORIZATION", "REPLICATION", "OBSERVABILITY", "AUTHORIZATIONPROXYSERVER", "RESILIENCY", "APPLICATIONMOBILITY", "POWERFLEX", "POWERSCALE", "POWERMAX", "POWERSTORE", "UNITY", "SANITY"}
tagEnvVars := []string{"AUTHORIZATION", "REPLICATION", "OBSERVABILITY", "AUTHORIZATIONPROXYSERVER", "RESILIENCY", "APPLICATIONMOBILITY", "POWERFLEX", "POWERSCALE", "POWERMAX", "POWERSTORE", "UNITY", "SANITY", "CLIENT"}
By("Getting test environment variables")
valuesFile := os.Getenv(valuesFileEnvVar)
Expect(valuesFile).NotTo(BeEmpty(), "Missing environment variable required for tests. E2E_SCENARIOS_FILE must be set.")
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/run-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ function usage() {
echo " --pstore use to run e2e powerstore suite"
echo " --unity use to run e2e unity suite"
echo " --pmax use to run e2e powermax suite"
echo " --client use to run e2e connectivity client suite"
echo

exit 0
Expand Down Expand Up @@ -190,6 +191,8 @@ while getopts ":h-:" optchar; do
export UNITY=true ;;
pmax)
export POWERMAX=true ;;
client)
export CLIENT=true ;;
cert-csi)
CERT_CSI="${!OPTIND}"
OPTIND=$((OPTIND + 1))
Expand Down
7 changes: 4 additions & 3 deletions tests/e2e/steps/steps_def.go
Original file line number Diff line number Diff line change
Expand Up @@ -1676,12 +1676,13 @@ func (step *Step) applyClientCustomResource(res ResourceApex, crNumStr string, s
return fmt.Errorf("failed to read secret testdata: %v", err)
}

if _, err := kubectl.RunKubectlInput(cr.Namespace, string(crBuff), "apply", "--validate=true", "-f", "-"); err != nil {
return fmt.Errorf("failed to apply connecivity client CR %s in namespace %s: %v", cr.Name, cr.Namespace, err)
}
if _, err := kubectl.RunKubectlInput(scr.Namespace, string(scrBuff), "apply", "--validate=true", "-f", "-"); err != nil {
return fmt.Errorf("failed to apply secret CR %s in namespace %s: %v", scr.Name, scr.Namespace, err)
}
if _, err := kubectl.RunKubectlInput(scr.Namespace, string(crBuff), "apply", "--validate=true", "-f", "-"); err != nil {
return fmt.Errorf("failed to apply connecivity client CR %s in namespace %s: %v", cr.Name, cr.Namespace, err)
}

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/steps/steps_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func StepRunnerInit(runner *Runner, ctrlClient client.Client, clientSet *kuberne
runner.addStep(`^Set up application mobility CR \[([^"]*)\]$`, step.configureAMInstall)

// Connectivity Client steps
runner.addStep(`^Given an client environment with k8s or openshift, and CSM operator installed$`, step.validateClientTestEnvironment)
runner.addStep(`^Given a client environment with k8s or openshift, and CSM operator installed$`, step.validateClientTestEnvironment)
runner.addStep(`^Install connectivity client from CR \[(\d+)\] and create secret \[(\d+)\]$`, step.applyClientCustomResource)
runner.addStep(`^Validate connectivity client from CR \[(\d+)\] is installed$`, step.validateConnectivityClientInstalled)
runner.addStep(`^Validate connectivity client from CR \[(\d+)\] is not installed$`, step.validateConnectivityClientNotInstalled)
Expand Down
20 changes: 12 additions & 8 deletions tests/e2e/testfiles/connectivity-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
- "testfiles/connectivity_client_secret.yaml"
tags:
- "sanity"
- "client"
steps:
- "Given an environment with k8s or openshift, and CSM operator installed"
- "Given a client environment with k8s or openshift, and CSM operator installed"
- "Install connectivity client from CR [1] and create secret [2]"
- "Validate connectivity client from CR [1] is installed"
- "Uninstall connectivity client from CR [1]"
Expand All @@ -19,8 +20,9 @@
- "testfiles/connectivity_client_secret.yaml"
tags:
- "sanity"
- "client"
steps:
- "Given an client environment with k8s or openshift, and CSM operator installed"
- "Given a client environment with k8s or openshift, and CSM operator installed"
- "Install connectivity client from CR [1] and create secret [3]"
- "Validate connectivity client from CR [1] is installed"
- "Upgrade client from custom resource [1] to [2]"
Expand All @@ -30,13 +32,14 @@
- "Validate connectivity client from CR [2] is not installed"

- scenario: "Validate role/rolebindings created for brownfield-onboard scenario"
paths:
paths:
- "testfiles/connectivity_client.yaml"
- "testfiles/storage_csm_powerflex.yaml"
tags:
tags:
- "sanity"
steps:
- "Given an environment with k8s or openshift, and CSM operator installed"
- "client"
steps:
- "Given a client environment with k8s or openshift, and CSM operator installed"
- "Set up secret with template [testfiles/powerflex-templates/powerflex-secret-template.yaml] name [test-vxflexos-config] in namespace [test-vxflexos] for [pflex]"
- "Apply custom resource [2]"
- "Validate custom resource [2]"
Expand All @@ -51,15 +54,16 @@
- "Delete custom resource [2]"
- "Restore template [testfiles/powerflex-templates/powerflex-secret-template.yaml] for [pflex]"
- "Restore template [testfiles/powerflex-templates/powerflex-storageclass-template.yaml] for [pflex]"

- scenario: "Validate rbac objects created for brownfield scenario when the client is running and CSM is created"
paths:
- "testfiles/connectivity_client.yaml"
- "testfiles/storage_csm_powerflex.yaml"
tags:
- "sanity"
- "client"
steps:
- "Given an environment with k8s or openshift, and CSM operator installed"
- "Given a client environment with k8s or openshift, and CSM operator installed"
- "Install connectivity client from CR [1]"
- "Validate connectivity client from CR [1] is installed"
- "Set up secret with template [testfiles/powerflex-templates/powerflex-secret-template.yaml] name [test-vxflexos-config] in namespace [test-vxflexos] for [pflex]"
Expand Down
5 changes: 2 additions & 3 deletions tests/e2e/testfiles/connectivity_client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ spec:
csmClientType: "apexConnectivityClient"
configVersion: v1.0.0
forceRemoveClient: true
connectionTarget: connect-p3.dell.com
usePrivateCaCerts: true
connectionTarget: connect-into.dell.com
common:
name: connectivity-client-docker-k8s
image: dellemc/connectivity-client-docker-k8s:1.2.3
Expand All @@ -20,7 +19,7 @@ spec:
imagePullPolicy: IfNotPresent
sideCars:
- name: kubernetes-proxy
image: bitnami/kubectl:latest
image: bitnami/kubectl:1.29
imagePullPolicy: IfNotPresent
- name: cert-persister
image: dellemc/connectivity-cert-persister-k8s:0.11.0
Expand Down
7 changes: 3 additions & 4 deletions tests/e2e/testfiles/connectivity_client_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ spec:
csmClientType: "apexConnectivityClient"
configVersion: v1.1.0
forceRemoveClient: true
connectionTarget: connect-p3.dell.com
usePrivateCaCerts: true
connectionTarget: connect-into.dell.com
common:
name: connectivity-client-docker-k8s
image: dellemc/connectivity-client-docker-k8s:1.19.0
Expand All @@ -23,5 +22,5 @@ spec:
image: bitnami/kubectl:latest
imagePullPolicy: IfNotPresent
- name: cert-persister
image: dellemc/connectivity-cert-persister-k8s:0.11.0
imagePullPolicy: IfNotPresent
image: dellemc/connectivity-cert-persister-k8s:0.17.0
imagePullPolicy: Always
18 changes: 0 additions & 18 deletions tests/e2e/testfiles/connectivity_client_secret.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
apiVersion: v1
kind: Secret
metadata:
name: connectivity-client-docker-k8s-loadbalancer-ca-cert
namespace: dell-connectivity-client
type: Opaque
data:
loadbalancer_root_ca_cert.crt: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM5ekNDQWQrZ0F3SUJBZ0lKQU0xYThtb0UzaldhTUEwR0NTcUdTSWIzRFFFQkN3VUFNQkl4RURBT0JnTlYKQkFNTUIzUmxjM1F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SNEN3bzE0OFphNDhEclVzc1ArNjZhSVRteExXY1dzOVczWgpmSVNDbDJIMmxvTXg1RzU2My9TTWgzS0ZXL3JCTkgyUnpxUHNUWkhockd4OEVYYjVFdkpJT0M3bHpBb1A0eUs4CldBZUpXd3dTRldUVkM0Z2Z5bHR6RnFOSGlqNENITkVxRTBrbXprRDN4K3MxTnUxTWtESDF5SFhpcXc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="
---
apiVersion: v1
kind: Secret
metadata:
name: connectivity-client-docker-k8s-aggregator-internal-ca-cert
namespace: dell-connectivity-client
type: Opaque
data:
aggregator_internal_root_ca_cert.crt: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM5ekNDQWQrZ0F3SUJBZ0lKQU5Mcm1ZZUlKTW5hTUEwR0NTcUdTSWIzRFFFQkN3VUFNQkl4RURBT0JnTlYKQkFNTUIzUmxjM1F0WTJFd0hoY05NalF3TVRFeU1UTTFNREF5V2hjTk16UXdNVEE1TVRNMU1EQXlXakFTTVJBdwpEZ1lEVlFRRERBZDBaWE4wTFdOaE1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBCnI4WUZZR2dlTXhrNU5xQzN5bm1PRUgvT0xuZ1dmQ3RtbkhZSkNidFBiRmFMRnJrVkJYcG9HTWFpS1NTK2F1UG0Ka3kwOGVBWFhlZWFTdUI0SXQ3TWFnTFNsOCt4MERMUXRhNFpsVDdvQjVCS2Q1L3JxTitGa2NZaGFOSjR3VFVqUgpndDE1UE40L2RFQ2F1dWJGaFpESXZ5MzRrRnZNZHk2eEcrTTJZMUcwUXhHcERaRGROMDF1a3NOMXM5YkJCNkZwCjBXRER0aG9sWmxVT29pTk1GdmRaaytsVHpzMksvaS8vSDArckZiRXJhRE5mN2JqUmRQRWFRMnd6TDRPTjN4ZFQKSHhha1A0MkVScmxJZ0pDaTJjMTJiTXd0NUp0R3AzRVhyUTNQSnNnQ2dZSjdCelZGYUpEcGI3bms0Qm1yY3ZpTgpkREs3YXNZdVBkK3FKcm5KSzEyTFp3SURBUUFCbzFBd1RqQWRCZ05WSFE0RUZnUVVJL3pMeGw5SW5EUXZUMVoyCnpodWR0OUg0Wldrd0h3WURWUjBqQkJnd0ZvQVVJL3pMeGw5SW5EUXZUMVoyemh1ZHQ5SDRaV2t3REFZRFZSMFQKQkFVd0F3RUIvekFOQmdrcWhraUc5dzBCQVFzRkFBT0NBUUVBcnB1VE5xTW41RUk2a2NtN2V2SnBFMHordUxadwoxRi9lOG84Q0h6emNnQVgzUlJrR2Z0blcxSkduYXZzQlVvL0I2VWVEdkxMT0N6bjVSZS9JMWdSUTdxOHoyY2tCCjJiWGlpaDJYZERtSUlEbEx2dkNlMkRONytHSSt2WjFocXFOSTRUZFFuOS9XcUkwZDdiZVBId2RyRTl2WGUvcEsKSUUzcEk5eDA2SXJwV3pGRjJOcHQ5S1pLL1djeThPN3gyRGlGQWRpaE5tUUxMNHZUTUkvZW03VllFZ0hRSGRuZApXcnkySlFIcHBiVzcxN2VKUWJERDFTbnptemdCOWdUTXE2bDhObEE2NE5kYnFHaHNTMk91cFNoeHlFNHVtZ2poCk1NaElZaksvUmQ4eVllcnRBQVpoYUdoTzhIakpUYXJRak9TeUpHbHI0M1N3QWZVSXBwblJzVzMxSXc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="
---
apiVersion: v1
kind: Secret
metadata:
name: connectivity-client-docker-k8s-cert
namespace: dell-connectivity-client
Expand Down

0 comments on commit 920de18

Please sign in to comment.