Skip to content

Commit

Permalink
e2e: Allow testing custom cni and dp image
Browse files Browse the repository at this point in the history
Let `run-e2e-conformance-virtual-ocp.sh` and
`run-e2e-conformance-virtual-cluster.sh` deploy clusters
with specific SRIOV CNI and Device Plugin images. This will
enable other projects to have full end-to-end test CI with
operator's suite.

Signed-off-by: Andrea Panattoni <[email protected]>
  • Loading branch information
zeeke committed Oct 12, 2023
1 parent 44afc00 commit ce2003f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hack/run-e2e-conformance-common
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

podman_tag_and_push() {
local_image=$1
cluster_image=$2

echo "## Pushing ${local_image} to cluster registry ${cluster_image}"
podman tag ${local_image} ${cluster_image}
podman push --tls-verify=false ${cluster_image}
}
14 changes: 14 additions & 0 deletions hack/run-e2e-conformance-virtual-cluster.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

set -xeo pipefail


cluster_name=${CLUSTER_NAME:-virtual}
domain_name=$cluster_name.lab

Expand All @@ -11,6 +13,8 @@ HOME="/root"
here="$(dirname "$(readlink --canonicalize "${BASH_SOURCE[0]}")")"
root="$(readlink --canonicalize "$here/..")"

source $here/run-e2e-conformance-common

check_requirements() {
for cmd in kcli virsh virt-edit podman make go; do
if ! command -v "$cmd" &> /dev/null; then
Expand Down Expand Up @@ -254,6 +258,16 @@ podman push --tls-verify=false "${SRIOV_NETWORK_OPERATOR_IMAGE}"
podman push --tls-verify=false "${SRIOV_NETWORK_CONFIG_DAEMON_IMAGE}"
podman push --tls-verify=false "${SRIOV_NETWORK_WEBHOOK_IMAGE}"


if [[ -v LOCAL_SRIOV_CNI_IMAGE ]]; then
podman_tag_and_push ${LOCAL_SRIOV_CNI_IMAGE} "$controller_ip:5000/sriov-cni:latest"
fi

if [[ -v LOCAL_SRIOV_DEVICE_PLUGIN_IMAGE ]]; then
podman_tag_and_push ${LOCAL_SRIOV_DEVICE_PLUGIN_IMAGE} "$controller_ip:5000/sriov-network-device-plugin:latest"
fi


# remove the crio bridge and let flannel to recreate
kcli ssh $cluster_name-ctlplane-0 << EOF
sudo su
Expand Down
12 changes: 12 additions & 0 deletions hack/run-e2e-conformance-virtual-ocp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ HOME="/root"
here="$(dirname "$(readlink --canonicalize "${BASH_SOURCE[0]}")")"
root="$(readlink --canonicalize "$here/..")"

source $here/run-e2e-conformance-common

check_requirements() {
for cmd in kcli virsh podman make go jq base64 tar; do
if ! command -v "$cmd" &> /dev/null; then
Expand Down Expand Up @@ -204,6 +206,16 @@ podman push --tls-verify=false "${SRIOV_NETWORK_OPERATOR_IMAGE}"
podman push --tls-verify=false "${SRIOV_NETWORK_CONFIG_DAEMON_IMAGE}"
podman push --tls-verify=false "${SRIOV_NETWORK_WEBHOOK_IMAGE}"


if [[ -v LOCAL_SRIOV_CNI_IMAGE ]]; then
podman_tag_and_push ${LOCAL_SRIOV_CNI_IMAGE} "$registry/$NAMESPACE/sriov-cni:latest"
fi

if [[ -v LOCAL_SRIOV_DEVICE_PLUGIN_IMAGE ]]; then
podman_tag_and_push ${LOCAL_SRIOV_DEVICE_PLUGIN_IMAGE} "$registry/$NAMESPACE/sriov-network-device-plugin:latest"
fi


podman logout $registry

echo "## apply CRDs"
Expand Down

0 comments on commit ce2003f

Please sign in to comment.