Skip to content

Commit

Permalink
Add test scripts for OpenStack.
Browse files Browse the repository at this point in the history
Can't just use AWS for everything after all.

Signed-off-by: Matthew Arnold <[email protected]>
  • Loading branch information
mrnold committed Sep 10, 2024
1 parent 05053cc commit 693442e
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ ifeq ($(CLUSTER_TYPE), ibmcloud)
endif

ifeq ($(CLUSTER_TYPE), openstack)
CLUSTER_TYPE = aws
VELERO_PLUGIN = aws
KVM_EMULATION = false
endif

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/backup_restore_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func prepareBackupAndRestore(brCase BackupRestoreCase, updateLastInstallTime fun
gomega.Eventually(dpaCR.BSLsAreAvailable(), time.Minute*3, time.Second*5).Should(gomega.BeTrue())

if brCase.BackupRestoreType == lib.CSI || brCase.BackupRestoreType == lib.CSIDataMover {
if provider == "aws" || provider == "ibmcloud" || provider == "gcp" || provider == "azure" {
if provider == "aws" || provider == "ibmcloud" || provider == "gcp" || provider == "azure" || provider == "openstack" {
log.Printf("Creating VolumeSnapshotClass for CSI backuprestore of %s", brCase.Name)
snapshotClassPath := fmt.Sprintf("./sample-applications/snapclass-csi/%s.yaml", provider)
err = lib.InstallApplication(dpaCR.Client, snapshotClassPath)
Expand Down
17 changes: 17 additions & 0 deletions tests/e2e/sample-applications/mongo-persistent/pvc/openstack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongo
namespace: mongo-persistent
labels:
app: mongo
spec:
accessModes:
- ReadWriteOnce
storageClassName: ocs-storagecluster-ceph-rbd
resources:
requests:
storage: 1Gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql
namespace: mysql-persistent
labels:
app: mysql
spec:
accessModes:
- ReadWriteOnce
storageClassName: ocs-storagecluster-ceph-rbd
resources:
requests:
storage: 1Gi
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: applog
namespace: mysql-persistent
labels:
app: todolist
spec:
accessModes:
- ReadWriteOnce
storageClassName: ocs-storagecluster-ceph-rbd
resources:
requests:
storage: 1Gi
17 changes: 17 additions & 0 deletions tests/e2e/sample-applications/mysql-persistent/pvc/openstack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql
namespace: mysql-persistent
labels:
app: mysql
spec:
accessModes:
- ReadWriteOnce
storageClassName: ocs-storagecluster-ceph-rbd
resources:
requests:
storage: 1Gi
15 changes: 15 additions & 0 deletions tests/e2e/sample-applications/snapclass-csi/openstack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: List
items:
- apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: oadp-example-snapclass
labels:
velero.io/csi-volumesnapshot-class: 'true'
driver: openshift-storage.rbd.csi.ceph.com
deletionPolicy: Retain
parameters:
clusterID: openshift-storage
csi.storage.k8s.io/snapshotter-secret-name: rook-csi-rbd-provisioner
csi.storage.k8s.io/snapshotter-secret-namespace: openshift-storage
46 changes: 46 additions & 0 deletions tests/e2e/scripts/openstack_settings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

cat > $TMP_DIR/oadpcreds <<EOF
{
"spec": {
"configuration":{
"velero":{
"defaultPlugins": [
"openshift", "aws"
]
}
},
"backupLocations": [
{
"velero": {
"provider": "aws",
"config": {
"profile": "$BSL_AWS_PROFILE",
"region": "$BSL_REGION"
},
"objectStorage":{
"bucket": "$BUCKET"
}
}
}
],
"credential":{
"name": "$SECRET",
"key": "cloud"
},
"snapshotLocations": [
{
"velero": {
"provider": "aws",
"config": {
"profile": "default",
"region": "$VSL_REGION"
}
}
}
]
}
}
EOF

x=$(cat $TMP_DIR/oadpcreds); echo "$x" | grep -o '^[^#]*' > $TMP_DIR/oadpcreds

0 comments on commit 693442e

Please sign in to comment.