Skip to content
Snippets Groups Projects
Commit b0f711aa authored by Steven Murray's avatar Steven Murray
Browse files

Added oracleunittests pod to the system test

parent df6d8f2c
Branches
Tags
No related merge requests found
#!/bin/bash
set -e
. /opt/run/bin/init_pod.sh
if [ ! -e /etc/buildtreeRunner ]; then
yum-config-manager --enable cta-artifacts
yum-config-manager --enable ceph
yum-config-manager --enable castor
# Install missing RPMs
yum -y install mt-st lsscsi sg3_utils cta-taped cta-tape-label cta-debuginfo ceph-common
fi
echo "Configuring database"
/opt/run/bin/init_database.sh
. /tmp/database-rc.sh
echo ${DATABASEURL} > /etc/cta/cta-catalogue.conf
yum -y install cta-catalogueutils cta-systemtests
/usr/bin/cta-rdbmsUnitTests /etc/cta/cta-catalogue.conf
echo 'yes' | /usr/bin/cta-catalogue-schema-drop /etc/cta/cta-catalogue.conf
/usr/bin/cta-catalogue-schema-create /etc/cta/cta-catalogue.conf
......@@ -255,6 +255,28 @@ fi
kubectl get pod init -a --namespace=${instance} | grep -q Completed || die "TIMED OUT"
echo OK
echo "Running database unit-tests"
kubectl create -f ${poddir}/pod-oracleunittests.yaml --namespace=${instance}
echo -n "Waiting for oracleunittests"
for ((i=0; i<400; i++)); do
echo -n "."
kubectl get pod oracleunittests -a --namespace=${instance} | egrep -q 'Completed|Error' && break
sleep 1
done
kubectl --namespace=${instance} logs oracleunittests
# database unit-tests went wrong => exit now with error
if $(kubectl get pod oracleunittests -a --namespace=${instance} | grep -q Error); then
echo "init pod in Error status here are its last log lines:"
kubectl --namespace=${instance} logs oracleunittests --tail 10
die "ERROR: init pod in ErERROR: oracleunittests pod in Error state. Initialization failed."
fi
kubectl get pod init -a --namespace=${instance} | grep -q Completed || die "TIMED OUT"
echo OK
echo "Launching pods"
for podname in client ctacli tpsrv01 tpsrv02 ctaeos ctafrontend kdc; do
......
apiVersion: v1
kind: Pod
metadata:
name: oracleunittests
spec:
restartPolicy: Never
containers:
- name: oracleunittests
image: gitlab-registry.cern.ch/cta/ctageneric:78673git921a9300
stdin: true
env:
- name: MY_CONTAINER
value: "oracleunittests"
- name: MY_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: INSTANCE_NAME
value: "$(MY_NAMESPACE)"
- name: BUILDTREE_BASE
valueFrom:
configMapKeyRef:
name: buildtree
key: base
- name: CTA_BUILDTREE_SUBDIR
valueFrom:
configMapKeyRef:
name: buildtree
key: cta_subdir
- name: EOS_BUILDTREE_SUBDIR
valueFrom:
configMapKeyRef:
name: buildtree
key: eos_subdir
- name: TERM
value: "xterm"
- name: driveslot
value: "0"
command: ['/opt/run/bin/oracleunittests.sh']
args: ["none"]
volumeMounts:
- mountPath: /shared
name: shared
- mountPath: /etc/config/objectstore
name: myobjectstore
- mountPath: /etc/config/database
name: mydatabase
- mountPath: /etc/config/library
name: mylibrary
- mountPath: /mnt/logs
name: logstorage
securityContext:
privileged: true
volumes:
- name: shared
hostPath:
path: /opt/cta
- name: myobjectstore
configMap:
name: objectstore-config
- name: mydatabase
configMap:
name: database-config
- name: mylibrary
configMap:
name: library-config
- name: logstorage
persistentVolumeClaim:
claimName: claimlogs
imagePullSecrets:
- name: ctaregsecret
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment