]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
regress: Fix k8s tests
authorfrancisco.garcia <francisco.garcia@baculasystems.com>
Fri, 7 Jul 2023 12:23:53 +0000 (14:23 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:01 +0000 (13:57 +0200)
regress/scripts/kubernetes-plugintest.yaml [new file with mode: 0644]
regress/tests/kubernetes-plugin-tests

diff --git a/regress/scripts/kubernetes-plugintest.yaml b/regress/scripts/kubernetes-plugintest.yaml
new file mode 100644 (file)
index 0000000..80941a2
--- /dev/null
@@ -0,0 +1,203 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: plugintest
+---
+apiVersion: v1
+kind: Secret
+metadata:
+  name: plugintest-secrets
+  namespace: plugintest
+  labels:
+    app: plugintest
+data:
+  # username: bacula
+  # password: plugintest
+  # secretkey: 5bAoV2CpzBvhBQZaYUX1qYawC00qhrx8cEW0fK1zYkTxVdbxfvWMyi0h5QbweJkq
+  username: YmFjdWxhCg==
+  password: cGx1Z2ludGVzdAo=
+  secretkey: NWJBb1YyQ3B6QnZoQlFaYVlVWDFxWWF3QzAwcWhyeDhjRVcwZksxellrVHhWZGJ4ZnZXTXlpMGg1UWJ3ZUprcQo=
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: plugintest-configmap
+  namespace: plugintest
+  labels:
+    app: plugintest
+data:
+  database: bacula
+  database_host: 127.0.0.1
+  database_port: '5432'
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: plugintest-subdomain
+  namespace: plugintest
+  labels:
+    app: plugintest
+spec:
+  selector:
+    name: plugintest
+  # clusterIP: None
+  ports:
+  - name: foo # Actually, no port is needed.
+    port: 1234
+    targetPort: 1234
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: plugintest-nginx-service
+  namespace: plugintest
+  labels:
+    app: plugintest-nginx-service
+    tier: backend
+spec:
+  ports:
+  - port: 80
+    name: web
+  clusterIP: None
+  selector:
+    app: plugintest-nginx-web
+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: plugintest-persistent-volume-claim
+  namespace: plugintest
+  labels:
+    app: plugintest
+spec:
+  accessModes:
+    - ReadWriteOnce
+  resources:
+    requests:
+      storage: 1Gi
+---
+apiVersion: v1
+kind: Pod
+metadata:
+  name: plugintest1
+  namespace: plugintest
+  labels:
+    app: plugintest
+    environment: production
+    # tier: frontend
+spec:
+  hostname: plugintest-1
+  subdomain: plugintest-subdomain
+  containers:
+  - image: busybox:1.28
+    command:
+      - sleep
+      - "3600"
+    name: plugintest
+    volumeMounts:
+      - name: plugintest-persistent-storage
+        mountPath: /data
+  volumes:
+    - name: plugintest-persistent-storage
+      persistentVolumeClaim:
+        claimName: plugintest-persistent-volume-claim
+---
+apiVersion: v1
+kind: Pod
+metadata:
+  name: plugintest2
+  namespace: plugintest
+  labels:
+    app: plugintest
+spec:
+  hostname: plugintest-2
+  subdomain: plugintest-subdomain
+  containers:
+  - image: busybox:1.28
+    command:
+      - sleep
+      - "3600"
+    name: plugintest
+---
+apiVersion: apps/v1
+kind: ReplicaSet
+metadata:
+  name: plugintest-frontend
+  namespace: plugintest
+  labels:
+    app: plugintest-replica
+    tier: frontend
+spec:
+  replicas: 3
+  selector:
+    matchLabels:
+      tier: frontend
+  template:
+    metadata:
+      labels:
+        tier: frontend
+    spec:
+      containers:
+      - name: plugintest-frontend-test
+        image: gcr.io/google_samples/gb-frontend:v3
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: plugintest-nginx-deployment
+  namespace: plugintest
+  labels:
+    app: plugintest-deployment
+spec:
+  replicas: 3
+  selector:
+    matchLabels:
+      app: plugintest-deployment
+  template:
+    metadata:
+      labels:
+        app: plugintest-deployment
+    spec:
+      containers:
+      - name: plugintest-nginx
+        image: nginx:latest
+        ports:
+        - containerPort: 8080
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+  name: plugintest-nginx-web
+  namespace: plugintest
+spec:
+  selector:
+    matchLabels:
+      app: plugintest-nginx-web
+  serviceName: "nginx"
+  replicas: 3
+  template:
+    metadata:
+      namespace: plugintest
+      labels:
+        app: plugintest-nginx-web
+        tier: backend
+    spec:
+      terminationGracePeriodSeconds: 10
+      containers:
+      - name: plugintest-nginx-web
+        image: k8s.gcr.io/nginx-slim:0.8
+        ports:
+        - containerPort: 80
+          name: web
+        volumeMounts:
+        - name: plugintest-www-data
+          mountPath: /usr/share/nginx/html
+  volumeClaimTemplates:
+  - metadata:
+      name: plugintest-www-data
+      namespace: plugintest
+    spec:
+      accessModes: [ "ReadWriteOnce" ]
+      resources:
+        requests:
+          storage: 1Gi
index 613f3030d9d2d6f5b51aeebb615982e22398878a..da9920ad6c5fcbdc9091ae28c9c689c042fc7eae 100755 (executable)
@@ -61,7 +61,7 @@ FileSetName="TestPluginKubernetesSet"
 . scripts/functions
 . scripts/regress-utils.sh
 
-export debug=1
+export debug=1
 scripts/cleanup
 scripts/copy-kubernetes-plugin-confs
 printf "Preparing ... "
@@ -71,7 +71,7 @@ setup_plugin_param "kubernetes:"
 if [ "x$KUBECONFIG" != "x" ]
 then
    export KUBECONFIG
-   LPLUG="${LPLUG} config=\"$KUBECONFIG\""
+   LPLUG="${LPLUG} config='$KUBECONFIG'"
 fi
 
 mkdir -p ${tmp}