Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Update test plans to use secured connectivity with the operator #14

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# flotta-scale-tests
The purpose of this project is to test the scalability and performance of [project-flotta](https://github.com/project-flotta/flotta-operator) using [JMeter](https://jmeter.apache.org).

## Install OCP SNO cluster
Clone https://gitlab.cee.redhat.com/jgil/simple-openshift-cluster-provisioner
gabriel-farache marked this conversation as resolved.
Show resolved Hide resolved
Run `CLUSTER_NAME=<cluster name> SNO_MASTER_MEMORY=<amount of memory in Mib> SNO_MASTER_CPU=<amount of CPU> make create_sno_cluster`.

Ex: `CLUSTER_NAME=devicemgmt1 SNO_MASTER_MEMORY=64000 SNO_MASTER_CPU=16 make create_sno_cluster`
## Configure K8S/OCP cluster
Follow https://metallb.universe.tf/installation/ to avoid having to create NodePort service to expose the flotta operator
See https://metallb.universe.tf/configuration/#layer-2-configuration. Use `kubectl get nodes -o` or `oc get nodes -o wide` to get the IP adress.
gabriel-farache marked this conversation as resolved.
Show resolved Hide resolved

## Running the test plan
Use [./scripts/run_test_plan.sh](./scripts/run_test_plan.sh) to run the test plan.
The script will create the required resources on the cluster for running the test.
Expand Down
20 changes: 20 additions & 0 deletions scripts/run_test_plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,25 @@ fi
kubectl scale --replicas=$REPLICAS deployment flotta-operator-controller-manager -n flotta
kubectl wait --for=condition=available -n flotta deployment.apps/flotta-operator-controller-manager

PORT_FORWARDING_ALREADY_TAKEN=$(ps -eaf | grep "kubectl port-forward service/flotta-operator-controller-manager -n flotta $HTTP_SERVER_PORT --address 0.0.0.0" | wc -l)

if [ $PORT_FORWARDING_ALREADY_TAKEN -gt 2 ]; then
echo $'\n'"Target port ${HTTP_SERVER_PORT} for port-forward is already taken by another port-forward process"
exit 1
fi

echo "Forwarding port to 127.0.0.1"
kubectl port-forward service/flotta-operator-controller-manager -n flotta ${HTTP_SERVER_PORT} --address 0.0.0.0 &
export PORT_FORWARD_PID=$!
ps $PORT_FORWARD_PID
until [[ $? -eq 0 ]]
do
sleep 5
echo "Forwarding port to 127.0.0.1"
kubectl port-forward service/flotta-operator-controller-manager -n flotta ${HTTP_SERVER_PORT} --address 0.0.0.0 &
export PORT_FORWARD_PID=$!
ps $PORT_FORWARD_PID
done
count=0
export CERTS_FOLDER="${test_dir}/certs"
DEVICE_ID='default'
Expand Down Expand Up @@ -448,3 +467,4 @@ log_pods_details
run_test
log_pods_details
collect_results
kill $PORT_FORWARD_PID