diff --git a/.github/workflows/e2e_libvirt.yaml b/.github/workflows/e2e_libvirt.yaml index d44a3d08f..942324950 100644 --- a/.github/workflows/e2e_libvirt.yaml +++ b/.github/workflows/e2e_libvirt.yaml @@ -23,7 +23,11 @@ on: description: Git ref to checkout the cloud-api-adaptor repository. Defaults to main. required: false type: string - + secure_comms: + default: 'none' + description: SecureComms configuration. Defaults to none. + required: false + type: string env: CLOUD_PROVIDER: libvirt DEBIAN_FRONTEND: noninteractive @@ -83,6 +87,7 @@ jobs: - name: Config Libvirt run: | + export TEST_E2E_SECURE_COMMS="${{ inputs.secure_comms }}" ./libvirt/config_libvirt.sh echo "CAA_IMAGE=\"${{ inputs.caa_image }}\"" >> libvirt.properties # For debugging @@ -121,6 +126,7 @@ jobs: export TEST_PROVISION_FILE="$PWD/libvirt.properties" export TEST_PODVM_IMAGE="${{ env.PODVM_QCOW2 }}" export TEST_E2E_TIMEOUT="75m" + export TEST_E2E_SECURE_COMMS="${{ inputs.secure_comms }}" make test-e2e diff --git a/.github/workflows/e2e_run_all.yaml b/.github/workflows/e2e_run_all.yaml index 35ae34698..61018ef9f 100644 --- a/.github/workflows/e2e_run_all.yaml +++ b/.github/workflows/e2e_run_all.yaml @@ -99,6 +99,8 @@ jobs: prep_install: needs: [image] runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} env: PROVIDERS: "libvirt" steps: @@ -148,6 +150,11 @@ jobs: path: src/cloud-api-adaptor/install/ retention-days: 7 + - name: Define Test Matrix + id: matrix + run: | + echo "matrix=$(jq -c . < ./libvirt/e2e_matrix_libvirt.json)" >> "$GITHUB_OUTPUT" + # Run libvirt e2e tests if pull request labeled 'test_e2e_libvirt' libvirt: name: libvirt @@ -158,17 +165,12 @@ jobs: needs: [podvm, image, prep_install] strategy: fail-fast: false - matrix: - os: - - ubuntu - provider: - - generic - arch: - - amd64 + matrix: ${{ fromJSON(needs.prep_install.outputs.matrix) }} uses: ./.github/workflows/e2e_libvirt.yaml with: caa_image: ${{ inputs.registry }}/cloud-api-adaptor:${{ inputs.caa_image_tag }}-dev podvm_image: ${{ inputs.registry }}/podvm-${{ matrix.provider }}-${{ matrix.os }}-${{ matrix.arch }}:${{ inputs.podvm_image_tag }} install_directory_artifact: install_directory git_ref: ${{ inputs.git_ref }} + secure_comms: ${{ matrix.secure_comms }} secrets: inherit diff --git a/src/cloud-api-adaptor/libvirt/config_libvirt.sh b/src/cloud-api-adaptor/libvirt/config_libvirt.sh index a3d33aacb..5ad41be22 100755 --- a/src/cloud-api-adaptor/libvirt/config_libvirt.sh +++ b/src/cloud-api-adaptor/libvirt/config_libvirt.sh @@ -92,6 +92,9 @@ installK8sclis() { fi } +TEST_E2E_SECURE_COMMS=${TEST_E2E_SECURE_COMMS:-none}. +echo "SECURE_COMMS is ${TEST_E2E_SECURE_COMMS}" + echo "Installing Go..." installGolang echo "Installing Libvirt..." @@ -118,3 +121,12 @@ rm -f libvirt.properties echo "libvirt_uri=\"qemu+ssh://${USER}@${IP}/system?no_verify=1\"" >> libvirt.properties echo "libvirt_ssh_key_file=\"id_rsa\"" >> libvirt.properties echo "CLUSTER_NAME=\"peer-pods\"" >> libvirt.properties + +# switch to the appropriate e2e test and add configs to libvirt.properties as needed +case $TEST_E2E_SECURE_COMMS in + + *) + echo "processing none" + echo "SECURE_COMMS=\"false\"" >> libvirt.properties + ;; +esac diff --git a/src/cloud-api-adaptor/libvirt/e2e_matrix_libvirt.json b/src/cloud-api-adaptor/libvirt/e2e_matrix_libvirt.json new file mode 100644 index 000000000..994063519 --- /dev/null +++ b/src/cloud-api-adaptor/libvirt/e2e_matrix_libvirt.json @@ -0,0 +1,6 @@ +{ + "secure_comms": ["none"], + "os": ["ubuntu"], + "provider": ["generic"], + "arch": ["amd64"] +} \ No newline at end of file