This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test plans to use secured connectivity with the operator and
rename edgedeployment in edgeworkload
- Loading branch information
1 parent
2c001d2
commit 8328a4a
Showing
15 changed files
with
969 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"content": { | ||
"certificate_request": "$CERTIFICATE_REQUEST", | ||
"hardware": { | ||
"cpu": { | ||
"architecture": "x86_64", | ||
"flags": [], | ||
"model_name": "Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz" | ||
}, | ||
"hostname": "$HOSTNAME", | ||
"system_vendor": { | ||
"manufacturer": "LENOVO", | ||
"product_name": "${PRODUCT_NAME}", | ||
"serial_number": "${SERIAL_NAME}" | ||
} | ||
}, | ||
"os_image_id": "unknown" | ||
}, | ||
"directive": "registration", | ||
"message_id": "$UUID", | ||
"sent": "2021-11-21T14:45:25.271+02:00", | ||
"type": "data", | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
touch ${TEST_DIR}/${DEVICE_ID}_register.out | ||
touch ${TEST_DIR}/${DEVICE_ID}_register.err | ||
touch ${TEST_DIR}/${DEVICE_ID}_get_updates.err | ||
touch ${TEST_DIR}/${DEVICE_ID}_get_updates.out | ||
touch ${TEST_DIR}/${DEVICE_ID}_hearthbeat.out | ||
touch ${TEST_DIR}/${DEVICE_ID}_hearthbeat.err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# make get-certs | ||
kubectl -n flotta get secrets flotta-ca --template="{{index .data \"ca.crt\" | base64decode}}" >${test_dir}/${DEVICE_ID}_ca.pem | ||
export REG_SECRET_NAME=$(kubectl get secrets -n flotta -l reg-client-ca=true --sort-by=.metadata.creationTimestamp | tail -1 | awk '{print $1}') | ||
kubectl -n flotta get secret ${REG_SECRET_NAME} --template="{{index .data \"client.crt\" | base64decode}}" > ${test_dir}/${DEVICE_ID}_cert.pem | ||
kubectl -n flotta get secret ${REG_SECRET_NAME} --template="{{index .data \"client.key\" | base64decode}}" > ${test_dir}/${DEVICE_ID}_key.pem | ||
# make get-certs END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
echo "curl -XGET \\ | ||
--cacert ${test_dir}/default_ca.pem \\ | ||
--cert ${test_dir}/${DEVICE_ID}.pem \\ | ||
--key ${test_dir}/${DEVICE_ID}.key -v \\ | ||
-H \"Content-Type: application/json\" \\ | ||
-H \"Cache-Control: no-cache\" \\ | ||
https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH}" | ||
|
||
curl -XGET \ | ||
--cacert ${test_dir}/default_ca.pem \ | ||
--cert ${test_dir}/${DEVICE_ID}.pem \ | ||
--key ${test_dir}/${DEVICE_ID}.key -v \ | ||
-H "Content-Type: application/json" \ | ||
-H "Cache-Control: no-cache" \ | ||
https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH} | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Error getting device updates" | ||
exit -1 | ||
fi; | ||
|
||
exit 0 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
openssl ecparam -name prime256v1 -genkey -noout -out ${test_dir}/${DEVICE_ID}.key | ||
openssl req -new -subj '/CN=${DEVICE_ID}' -key ${test_dir}/${DEVICE_ID}.key -out ${test_dir}/${DEVICE_ID}.csr | ||
export CERTIFICATE_REQUEST=$(cat ${test_dir}/${DEVICE_ID}.csr | sed 's/$/\\n/' | tr -d '\n') | ||
UUID=$(uuidgen) | ||
echo "${PAYLOAD}" | sed -e 's/"content": {/"content": {\n "certificate_request": "$CERTIFICATE_REQUEST",/g' | envsubst > ${test_dir}/${DEVICE_ID}_payload.json | ||
|
||
#Verify! | ||
cat ${test_dir}/${DEVICE_ID}_payload.json | jq . | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Error when checking ${test_dir}/${DEVICE_ID}_payload.json" | ||
exit -1 | ||
fi | ||
echo "curl \ | ||
--cacert ${test_dir}/default_ca.pem \\ | ||
--cert ${test_dir}/default_cert.pem \\ | ||
--key ${test_dir}/default_key.pem -v \\ | ||
-d @${test_dir}/${DEVICE_ID}_payload.json \\ | ||
-X POST \\ | ||
-H \"Content-Type: application/json\" \ | ||
-o ${test_dir}/${DEVICE_ID}_response.json \\ | ||
https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/api/flotta-management/v1/data/${DEVICE_ID}/out" | ||
|
||
curl \ | ||
--cacert ${test_dir}/default_ca.pem \ | ||
--cert ${test_dir}/default_cert.pem \ | ||
--key ${test_dir}/default_key.pem -v \ | ||
-d @${test_dir}/${DEVICE_ID}_payload.json \ | ||
-X POST \ | ||
-H "Content-Type: application/json" \ | ||
-o ${test_dir}/${DEVICE_ID}_response.json \ | ||
https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/api/flotta-management/v1/data/${DEVICE_ID}/out | ||
if [ $? -ne 0 ]; then | ||
echo "Error when sending registration request, see ${test_dir}/${DEVICE_ID}_register.out" | ||
exit -1 | ||
fi | ||
|
||
cat ${test_dir}/${DEVICE_ID}_response.json | jq '.content.certificate' | sed -e 's/\\n/\n/g' | sed -e 's/"//g' > ${test_dir}/${DEVICE_ID}.pem | ||
|
||
|
||
#openssl x509 -in ${test_dir}/${DEVICE_ID}.pem --text | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Error when extracting ${test_dir}/${DEVICE_ID}_response.json to ${test_dir}/${DEVICE_ID}.pem" | ||
exit -1 | ||
fi | ||
|
||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
echo "curl -XPOST \\ | ||
--cacert ${test_dir}/default_ca.pem \\ | ||
--cert ${test_dir}/${DEVICE_ID}.pem \\ | ||
--key ${test_dir}/${DEVICE_ID}.key -v \\ | ||
-H \"Content-Type: application/json\" \\ | ||
--data ${POST_BODY} \\ | ||
https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH}" | ||
|
||
curl -XPOST \ | ||
--cacert ${test_dir}/default_ca.pem \ | ||
--cert ${test_dir}/${DEVICE_ID}.pem \ | ||
--key ${test_dir}/${DEVICE_ID}.key -v \ | ||
-H "Content-Type: application/json" \ | ||
--data ${POST_BODY} \ | ||
https://${HTTP_SERVER}:${HTTP_SERVER_PORT}/${REQUEST_PATH} | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Error posting device" | ||
exit -1 | ||
fi; | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: flotta-svc | ||
namespace: flotta | ||
spec: | ||
type: NodePort | ||
selector: | ||
control-plane: controller-manager | ||
ports: | ||
# By default and for convenience, the `targetPort` is set to the same value as the `port` field. | ||
- port: 8043 | ||
targetPort: 8043 | ||
# Optional field | ||
# By default and for convenience, the Kubernetes control plane will allocate a port from a range (default: 30000-32767) | ||
nodePort: 30043 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
sysctl -w net.core.somaxconn=50000 | ||
sysctl -w net.core.netdev_max_backlog=50000 | ||
sysctl -w net.ipv4.tcp_max_syn_backlog=50000 | ||
sysctl -w net.ipv4.ip_local_port_range="15000 65000" | ||
sysctl -w net.ipv4.tcp_fin_timeout=10 | ||
sysctl -w vm.max_map_count=999999 | ||
sysctl -w kernel.threads-max=4113992 | ||
|
||
if [ -z $(grep "* soft nofile 999999" "/etc/security/limits.conf") ]; then | ||
cat "* soft nofile 999999" >> /etc/security/limits.conf | ||
fi | ||
|
||
if [ -z $(grep "* hard nofile 999999" "/etc/security/limits.conf") ]; then | ||
cat "* hard nofile 999999" >> /etc/security/limits.conf | ||
fi | ||
|
||
|
||
ifconfig br-ex txqueuelen 5000 | ||
ifconfig cni-podman0 txqueuelen 5000 | ||
ifconfig ens3 txqueuelen 5000 | ||
ifconfig ens4 txqueuelen 5000 | ||
ifconfig ovn-k8s-mp0 txqueuelen 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.