Upload to HTTPS S3 - Support self signed certificate
API --- Allow the user to pass the CA public certification or skip the verification AWSCloud -------- Restore the old version of newAwsFromCreds for access to AWS Create a new method newAwsFromCredsWithEndpoint for Generic S3 which sets the endpoint and optionally overrides the CA Bundle or skips the SSL certificate verification jobimpl-osbuild --------------- Update with the new parameters osbuild-upload-generic-s3 ------------------------- Add ca-bunlde and skip-ssl-verification flags tests ----- Split the tests into http, https with certificate and https skip certificate check Create a new base test for S3 over HTTPS for secure and insecure Move the generic S3 test to tools to reuse for secure and insecure connections All S3 tests now use the aws cli tool Update the libvirt test to be able to download over HTTPS Update the RPM spec Kill container with sudo
This commit is contained in:
parent
cd49c932a2
commit
8407c97d96
15 changed files with 331 additions and 38 deletions
|
|
@ -5,9 +5,9 @@ source /usr/libexec/osbuild-composer-test/set-env-variables.sh
|
|||
|
||||
TEST_ID=${1}
|
||||
S3_PROVIDER_CONFIG_FILE=${2}
|
||||
S3_CHECK_CMD=${3}
|
||||
S3_GET_URL_CMD=${4}
|
||||
S3_DELETE_CMD=${5:-""}
|
||||
S3_CMD=${3}
|
||||
IMAGE_OBJECT_KEY=${4}
|
||||
S3_CA_BUNDLE=${5:-""}
|
||||
|
||||
# Colorful output.
|
||||
function greenprint {
|
||||
|
|
@ -126,20 +126,18 @@ sudo composer-cli compose delete "${COMPOSE_ID}" > /dev/null
|
|||
|
||||
# Find the image that we made in the AWS Bucket
|
||||
greenprint "🔍 Search for created image"
|
||||
if ! bash -c "${S3_CHECK_CMD}"; then
|
||||
if ! bash -c "${S3_CMD} ls ${IMAGE_OBJECT_KEY}"; then
|
||||
echo "Failed to find the image in the S3 Bucket"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function removeImageFromS3() {
|
||||
bash -c "${S3_DELETE_CMD}"
|
||||
bash -c "${S3_CMD} rm s3://${IMAGE_OBJECT_KEY}"
|
||||
}
|
||||
if [ -n "${S3_DELETE_CMD}" ]; then
|
||||
trap removeImageFromS3 EXIT
|
||||
fi
|
||||
trap removeImageFromS3 EXIT
|
||||
|
||||
# Generate a URL for the image
|
||||
QCOW2_IMAGE_URL=$(bash -c "${S3_GET_URL_CMD}")
|
||||
QCOW2_IMAGE_URL=$(bash -c "${S3_CMD} presign ${IMAGE_OBJECT_KEY}")
|
||||
|
||||
# Run the image on KVM
|
||||
/usr/libexec/osbuild-composer-test/libvirt_test.sh qcow2 bios "${QCOW2_IMAGE_URL}"
|
||||
/usr/libexec/osbuild-composer-test/libvirt_test.sh qcow2 bios "${QCOW2_IMAGE_URL}" "${S3_CA_BUNDLE}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue