Sfoglia il codice sorgente

HPCC-24370 Add some regression tests for Helm charts

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 5 anni fa
parent
commit
94b8672642

+ 1 - 0
testing/helm/errtests/nodali.yaml

@@ -0,0 +1 @@
+dali: []

+ 7 - 0
testing/helm/errtests/secrets.yaml

@@ -0,0 +1,7 @@
+secrets:
+  ecl:
+    azure-magic: mymagic-secret
+  all:
+    something-secret: another-secret
+  unknown:
+    this-will-not-be-used: at-all

+ 29 - 0
testing/helm/run.sh

@@ -0,0 +1,29 @@
+#!/bin/bash
+scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+options="--set global.image.version=latest"
+hpccchart=$scriptdir/../../helm/hpcc
+
+echo Running valid tests...
+for file in $scriptdir/tests/*.yaml
+do
+   helm lint $hpccchart ${options} --values $file > results.txt 2> errors.txt
+   if [ $? -ne 0 ]
+   then
+      echo $file failed
+      cat errors.txt
+      cat results.txt
+   fi
+done
+
+echo Running invalid tests...
+for file in $scriptdir/errtests/*.yaml
+do
+   helm lint $hpccchart ${options} --values $file > results.txt 2> errors.txt
+   if [ $? -eq 0 ]
+   then
+      echo $file should have failed
+   else
+      echo $file failed
+      cat results.txt
+   fi
+done

+ 45 - 0
testing/helm/tests/baremetal.yaml

@@ -0,0 +1,45 @@
+hostgroups:
+  thor400: [ node1, node2, node3, node4, node5, node6, node400 ]
+  thor400m:
+    group: thor400
+    delta: 1
+  thor20_1:
+    group: thor400
+    count: 20
+    offset: 0 }
+  thor20_2:
+    group: thor400
+    count: 20
+    offset: 20
+  thor100_4:
+    group: thor400
+    count: 100
+    offset: 300
+
+storage:
+  planes:
+  #Bare metal system with attached storage
+  - name: thor400
+    prefix: /var/lib/hpccsystems/hpcc-data       # only used if the local host matches the host for the device
+    hosts: thor400
+    replication: attachedThor400MirrorPlane
+    speed: 2000
+    remoteSpeed: 1000
+    #numDevices: count(hosts)
+  - name: thor400mirror
+    prefix: /var/lib/hpccsystems/hpcc-mirror       # only used if the local host matches the host for the device
+    hosts: thor400mirror
+    #Does any other information about the replication policy need to be included?  I don't think it does....
+    speed: 2000
+    remoteSpeed: 1000
+
+  - name: thor100_4
+    prefix: /var/lib/hpccsystems/hpcc-data       # only used if the local host matches the host for the device
+    hosts: thor100_4
+    replication: azureBlobPlane
+    remoteSpeed: 2000
+
+  - name: azureBlobPlane
+    prefix: azure://ghallidaystorage      # Not sure if this should be different from the mount.
+    secret: azure-ghallidaystorage
+    speed: 500

+ 45 - 0
testing/helm/tests/complex.yaml

@@ -0,0 +1,45 @@
+storage:
+  planes:
+  #Some examples of the different kinds of storage planes that are supported
+  #Store data on azure blobs
+  - name: azureBlobPlane
+    prefix: azure://ghallidaystorage      # Not sure if this should be different from the mount.
+    secret: azure-ghallidaystorage
+    speed: 500
+
+  #Store data on aws s3 buckets
+  - name: s3BucketPlane
+    prefix: s3://...
+    speed: 400
+
+  #Single node with data mounted, and mirror mounted at a different locations (could be a different disk)
+  - name: localDataPlane
+    prefix: /var/lib/hpccsystems/hpcc-data
+    replication: [ localMirrorPlane, localMirror2Plane ]
+    pvc: local-data-pvc
+  - name: localMirrorPlane
+    prefix: /var/lib/hpccsystems/hpcc-mirror
+    pvc: local-mirror-pvc
+  - name: localMirror2Plane
+    prefix: /var/lib/hpccsystems/hpcc-mirror2
+    pvc: local-mirror2-pvc
+
+  #Multiple nodes, data on a local mounts (all nodes mount the same logical file system).
+  #Essentially identical to localDataPlane above
+  - name: nasPlane
+    prefix: /var/lib/hpccsystems/hpcc-data
+    replication: nasMirrorPlane
+    pvc: nas-data-pvc
+  - name: nasMirrorPlane
+    prefix: /var/lib/hpccsystems/hpcc-mirror
+    pvc: nas-mirror-pvc
+
+  #Multiple nodes, data on multiple local mounts (all nodes mount the same logical file system).
+  #Allows an array of NFS servers to be used to store the data.  Would also potentially work for
+  #local case with large numbers of local disks.
+  #Mount point is /var/lib/hpccsystems/hpcc-data/d<device-number>
+  - name: nasArrayPlane
+    prefix: /var/lib/hpccsystems/hpcc-data
+    pvc: nas-array-data-pvc
+    numDevices: 100
+    includeDeviceInPath: true

+ 5 - 0
testing/helm/tests/secrets.yaml

@@ -0,0 +1,5 @@
+secrets:
+  ecl:
+    azure-magic: mymagic-secret
+  all:
+    something-secret: another-secret