2019-11-01 16:48:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-03-10 00:19:02 +00:00
|
|
|
all_services=(
|
|
|
|
coredns
|
|
|
|
local-path-provisioner
|
|
|
|
metrics-server
|
2020-03-10 23:54:12 +00:00
|
|
|
traefik
|
2020-03-10 00:19:02 +00:00
|
|
|
)
|
|
|
|
|
2019-11-01 16:48:28 +00:00
|
|
|
export NUM_SERVERS=1
|
|
|
|
export NUM_AGENTS=1
|
2020-03-10 00:19:02 +00:00
|
|
|
export WAIT_SERVICES="${all_services[@]}"
|
2019-11-01 16:48:28 +00:00
|
|
|
|
|
|
|
start-test() {
|
2020-09-16 01:02:51 +00:00
|
|
|
use-local-storage-volume
|
2019-11-01 16:48:28 +00:00
|
|
|
docker exec $(cat $TEST_DIR/servers/1/metadata/name) check-config || true
|
|
|
|
verify-valid-versions $(cat $TEST_DIR/servers/1/metadata/name)
|
2020-03-10 00:19:02 +00:00
|
|
|
verify-airgap-images $(cat $TEST_DIR/{servers,agents}/*/metadata/name)
|
2019-11-01 16:48:28 +00:00
|
|
|
}
|
|
|
|
export -f start-test
|
|
|
|
|
2020-03-10 00:19:02 +00:00
|
|
|
# -- check for changes to the airgap image list
|
|
|
|
verify-airgap-images() {
|
|
|
|
local airgap_image_list='scripts/airgap/image-list.txt'
|
|
|
|
|
|
|
|
for name in $@; do
|
|
|
|
docker exec $name crictl images -o json \
|
|
|
|
| jq -r '.images[].repoTags[0] | select(. != null)'
|
|
|
|
done | sort -u >$airgap_image_list.tmp
|
|
|
|
|
|
|
|
if ! diff $airgap_image_list{,.tmp}; then
|
|
|
|
echo '[ERROR] Failed airgap image check'
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
export -f verify-airgap-images
|
|
|
|
|
2020-09-16 01:02:51 +00:00
|
|
|
# -- create a pod that uses local-storage to ensure that the local-path-provisioner
|
|
|
|
# -- helper image gets used
|
|
|
|
use-local-storage-volume() {
|
|
|
|
local volume_test_manifest='scripts/airgap/volume-test.yaml'
|
|
|
|
kubectl apply -f $volume_test_manifest
|
|
|
|
wait-for-services volume-test
|
|
|
|
}
|
|
|
|
export -f use-local-storage-volume
|
|
|
|
|
2019-11-01 16:48:28 +00:00
|
|
|
# --- create a basic cluster and check for valid versions
|
|
|
|
LABEL=BASICS run-test
|