Run AWS test using osbuild worker code
The `osbuild-image-tests` code does a good job testing image builds for AWS, but it doesn't use the same code paths that a customer would when using `composer-cli`. Add a test that builds a compose and uploads the image using osbuild-composer and its worker. Also, build an instance in AWS based on the image we imported and check to see if the smoke test file is present. Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
parent
540ca29c0a
commit
5903cc42fe
8 changed files with 324 additions and 28 deletions
6
schutzbot/Jenkinsfile
vendored
6
schutzbot/Jenkinsfile
vendored
|
|
@ -68,7 +68,7 @@ pipeline {
|
|||
// NOTE(mhayden): Disabling this for now since we don't have
|
||||
// access to these repositories in AWS.
|
||||
// stage('RHEL 8.3 Nightly') {
|
||||
// agent { label "rhel83" }
|
||||
// agent { label "rhel83 && psi" }
|
||||
// environment {
|
||||
// AWS_CREDS = credentials('aws-credentials-osbuildci')
|
||||
// }
|
||||
|
|
@ -196,12 +196,12 @@ void run_tests() {
|
|||
void preserve_logs(test_slug) {
|
||||
|
||||
// Make a directory for the log files and move the logs there.
|
||||
sh "mkdir ${test_slug} && mv *.log ${test_slug}/"
|
||||
sh "mkdir ${test_slug} && mv *.log *.jpg ${test_slug}/ || true"
|
||||
|
||||
// Artifact the logs.
|
||||
archiveArtifacts (
|
||||
allowEmptyArchive: true,
|
||||
artifacts: "${test_slug}/*.log"
|
||||
artifacts: "${test_slug}/*.log,${test_slug}/*.jpg"
|
||||
)
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,12 @@ ansible-playbook \
|
|||
-e install_source=os \
|
||||
ansible-osbuild/playbook.yml
|
||||
|
||||
# Run the AWS test.
|
||||
if [[ ${TEST_TYPE:-} == image ]]; then
|
||||
test/image-tests/aws.sh
|
||||
fi
|
||||
|
||||
# Run the tests.
|
||||
echo "The AWS_BUCKET env var is set to: ${AWS_BUCKET:-}"
|
||||
ansible-playbook \
|
||||
-e workspace=${WORKSPACE} \
|
||||
-e test_type=${TEST_TYPE:-base} \
|
||||
|
|
|
|||
|
|
@ -33,18 +33,6 @@
|
|||
when:
|
||||
- test_type == 'image'
|
||||
|
||||
- name: Run osbuild-composer AWS tests
|
||||
include_tasks: test_runner_image.yml
|
||||
loop: "{{ osbuild_composer_aws_test_cases }}"
|
||||
vars:
|
||||
env_vars: "{{ osbuild_composer_aws_env_vars }}"
|
||||
loop_control:
|
||||
loop_var: test_case
|
||||
when:
|
||||
- test_type == 'image'
|
||||
# Don't run the AWS test if the bucket env var is not set.
|
||||
- lookup('env', 'AWS_BUCKET') | length > 0
|
||||
|
||||
- name: Show failed and passed tests
|
||||
debug:
|
||||
msg: |
|
||||
|
|
|
|||
|
|
@ -33,15 +33,4 @@ osbuild_composer_image_test_cases:
|
|||
- vmdk-boot.json
|
||||
|
||||
# Environment variables for image tests.
|
||||
osbuild_composer_image_env_vars: {}
|
||||
|
||||
# List of AWS test cases
|
||||
osbuild_composer_aws_test_cases:
|
||||
- ami-boot.json
|
||||
|
||||
# Environment variables for AWS tests.
|
||||
osbuild_composer_aws_env_vars:
|
||||
AWS_BUCKET: "{{ lookup('env', 'AWS_BUCKET') }}"
|
||||
AWS_REGION: "{{ lookup('env', 'AWS_REGION') }}"
|
||||
AWS_ACCESS_KEY_ID: "{{ lookup('env', 'AWS_ACCESS_KEY_ID') }}"
|
||||
AWS_SECRET_ACCESS_KEY: "{{ lookup('env', 'AWS_SECRET_ACCESS_KEY') }}"
|
||||
osbuild_composer_image_env_vars: {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue