Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecureComms: Add testing facility for e2e tests #2124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/e2e_libvirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/e2e_run_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ jobs:
prep_install:
needs: [image]
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
env:
PROVIDERS: "libvirt"
steps:
Expand Down Expand Up @@ -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
Expand All @@ -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
12 changes: 12 additions & 0 deletions src/cloud-api-adaptor/libvirt/config_libvirt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand All @@ -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
6 changes: 6 additions & 0 deletions src/cloud-api-adaptor/libvirt/e2e_matrix_libvirt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"secure_comms": ["none"],
"os": ["ubuntu"],
"provider": ["generic"],
"arch": ["amd64"]
}
Loading