test/api: add checkEnvVSphere() to common/vsphere.sh
Add a common function to check for all environment variables needed to test VSphere image. Call the function from all S3 implementations of `checkEnv()` if testing the VSphere image type.
This commit is contained in:
parent
9e9aec5b53
commit
7e2d112783
3 changed files with 9 additions and 3 deletions
|
|
@ -8,9 +8,8 @@ source /usr/libexec/tests/osbuild-composer/api/common/s3.sh
|
|||
# Check that needed variables are set to access AWS.
|
||||
function checkEnv() {
|
||||
printenv AWS_REGION AWS_BUCKET V2_AWS_ACCESS_KEY_ID V2_AWS_SECRET_ACCESS_KEY AWS_API_TEST_SHARE_ACCOUNT > /dev/null
|
||||
|
||||
if [ "${IMAGE_TYPE}" = "${IMAGE_TYPE_VSPHERE}" ]; then
|
||||
printenv GOVMOMI_USERNAME GOVMOMI_PASSWORD GOVMOMI_URL GOVMOMI_CLUSTER GOVC_DATACENTER GOVMOMI_DATASTORE GOVMOMI_FOLDER GOVMOMI_NETWORK > /dev/null
|
||||
if [ "${IMAGE_TYPE}" == "${IMAGE_TYPE_VSPHERE}" ]; then
|
||||
checkEnvVSphere
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,3 +24,7 @@ function installClientVSphere() {
|
|||
$GOVC_CMD version
|
||||
}
|
||||
|
||||
function checkEnvVSphere() {
|
||||
printenv GOVMOMI_USERNAME GOVMOMI_PASSWORD GOVMOMI_URL GOVMOMI_CLUSTER GOVC_DATACENTER GOVMOMI_DATASTORE GOVMOMI_FOLDER GOVMOMI_NETWORK > /dev/null
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
|||
|
||||
function checkEnv() {
|
||||
printenv AWS_REGION > /dev/null
|
||||
if [ "${IMAGE_TYPE}" == "${IMAGE_TYPE_VSPHERE}" ]; then
|
||||
checkEnvVSphere
|
||||
fi
|
||||
}
|
||||
|
||||
# Global var for ostree ref
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue