Skip to content

Commit

Permalink
Cnfcert 30 changes (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaak Dorfman committed Aug 19, 2021
1 parent 7604d7e commit 357b529
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 45 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
.PHONY: install \
clean

install:
bash ./deploy-all.sh
install: install-partner-pods
bash ./deploy-test-pods.sh

install-partner-pods:
bash ./deploy-partner-pods.sh

clean:
bash ./clean-all.sh
43 changes: 0 additions & 43 deletions deploy-all.sh

This file was deleted.

31 changes: 31 additions & 0 deletions deploy-partner-pods.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
mkdir -p ./temp

if [[ -z "${NAMESPACE_TO_GENERATE}" ]]; then
export NAMESPACE_TO_GENERATE="tnf"
fi

export res=$(oc get namespace $NAMESPACE_TO_GENERATE 2>&1)
if [[ ${res#Error from server (NotFound)} != ${res} ]] || [[ ${res#No resources found} != ${res} ]]; then
cat ./local-test-infra/namespace.yaml | ./script/mo > ./temp/rendered-namespace.yaml
oc apply -f ./temp/rendered-namespace.yaml
rm ./temp/rendered-namespace.yaml
else
echo "namespace ${NAMESPACE_TO_GENERATE} already exists, no reason to recreate"
fi

if [[ -n "${TNF_MINIKUBE_ONLY}" ]] && [[ ${TNF_MINIKUBE_ONLY} = "true" ]]; then
echo "Running with Minikube, no FsDiff pod created"
else
cat ./local-test-infra/fsdiff-deployment.yaml | ./script/mo > ./temp/rendered-fsdiff-template.yaml
oc apply -f ./temp/rendered-fsdiff-template.yaml
rm ./temp/rendered-fsdiff-template.yaml
sleep 3
oc wait pod -n $NAMESPACE_TO_GENERATE --for=condition=ready -l "app=node-master" --timeout=30s
fi


cat ./local-test-infra/local-partner-deployment.yaml | ./script/mo > ./temp/rendered-partner-template.yaml
oc apply -f ./temp/rendered-partner-template.yaml
rm ./temp/rendered-partner-template.yaml
sleep 3
oc wait pod -n $NAMESPACE_TO_GENERATE --for=condition=ready -l "app=partner" --timeout=30s
12 changes: 12 additions & 0 deletions deploy-test-pods.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mkdir -p ./temp

if [[ -z "${NAMESPACE_TO_GENERATE}" ]]; then
export NAMESPACE_TO_GENERATE="tnf"
fi


cat ./local-test-infra/local-pod-under-test.yaml | ./script/mo > ./temp/rendered-local-pod-under-test-template.yaml
oc apply -f ./temp/rendered-local-pod-under-test-template.yaml
rm ./temp/rendered-local-pod-under-test-template.yaml
sleep 3
oc wait pod -n $NAMESPACE_TO_GENERATE --for=condition=ready -l "app=test" --timeout=30s
63 changes: 63 additions & 0 deletions local-test-infra/fsdiff-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node-master
namespace: {{ NAMESPACE_TO_GENERATE }}
test-network-function.com/generic: fs_diff_master
spec:
replicas: 1
selector:
matchLabels:
app: node-master
template:
metadata:
labels:
app: node-master
test-network-function.com/generic: fs_diff_master
test-network-function.com/container: fs_diff_master
annotations:
test-network-function.com/defaultnetworkinterface: '"eth0"' # optional
name: node-master
spec:
# hostPID: true
containers:
- command:
- tail
- -f
- /dev/null
image: quay.io/testnetworkfunction/cnf-test-partner:latest # quay.io/testnetworkfunction/test-network-function
name: master
resources:
limits:
memory: 512Mi
cpu: 0.25
volumeMounts:
- mountPath: /var/lib/containers
name: var-lib-containers
- mountPath: /var/run/containers
name: var-run-containers
- mountPath: /run/runc
name: runc-dir
- mountPath: /var/run/containers/storage/overlay-containers
name: overlay-containers
securityContext:
privileged: true
restartPolicy: Always
volumes:
- name: var-lib-containers
hostPath:
path: /var/lib/containers
type: Directory
- name: var-run-containers
hostPath:
path: /var/run/containers
type: Directory
- name: runc-dir
hostPath:
path: /run/runc
type: Directory
- name: overlay-containers
hostPath:
path: /var/run/containers/storage/overlay-containers
type: Directory
File renamed without changes.

0 comments on commit 357b529

Please sign in to comment.