Skip to content

Commit 116fdcc

Browse files
committed
git actions: Add kubevirt ipam controller e2e lane
Signed-off-by: Or Shoval <[email protected]>
1 parent bf03a45 commit 116fdcc

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Kubevirt IPAM controller Tests
2+
on:
3+
push:
4+
branches: [ "main" ]
5+
pull_request:
6+
branches: [ "main" ]
7+
8+
jobs:
9+
e2e:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v3
17+
with:
18+
go-version-file: 'go.mod'
19+
20+
- name: Run e2e tests
21+
env:
22+
KIND_ALLOW_SYSTEM_WRITES: true
23+
run: automation/check-patch.e2e-kubevirt-ipam-controller-functests.sh
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env bash
2+
3+
set -xeuE
4+
5+
# automation/check-patch.e2e-kubevirt-ipam-controller-functests.sh
6+
7+
GITHUB_ACTIONS=${GITHUB_ACTIONS:-false}
8+
9+
teardown() {
10+
cd ${TMP_COMPONENT_PATH}
11+
make cluster-down || true
12+
rm -rf "${TMP_COMPONENT_PATH}"
13+
}
14+
15+
main() {
16+
if [ "$GITHUB_ACTIONS" == "true" ]; then
17+
ARCH="amd64"
18+
OS_TYPE="linux"
19+
kubevirt_version="$(curl -L https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirt/stable.txt)"
20+
kubevirt_release_url="https://github.com/kubevirt/kubevirt/releases/download/${kubevirt_version}"
21+
cli_name="virtctl-${kubevirt_version}-${OS_TYPE}-${ARCH}"
22+
curl -LO "${kubevirt_release_url}/${cli_name}"
23+
mv ${cli_name} virtctl
24+
chmod +x virtctl
25+
mv virtctl /usr/local/bin
26+
fi
27+
28+
# Setup CNAO and artifacts temp directory
29+
source automation/check-patch.setup.sh
30+
cd ${TMP_PROJECT_PATH}
31+
32+
export USE_KUBEVIRTCI=false
33+
COMPONENT="kubevirt-ipam-controller" source automation/components-functests.setup.sh
34+
35+
cd ${TMP_COMPONENT_PATH}
36+
export KIND_ARGS="-ic -i6 -mne"
37+
make cluster-up
38+
export KUBECONFIG=${TMP_COMPONENT_PATH}/.output/kubeconfig
39+
40+
trap teardown EXIT
41+
42+
cd ${TMP_PROJECT_PATH}
43+
export KUBEVIRT_PROVIDER=external
44+
export DEV_IMAGE_REGISTRY=localhost:5000
45+
deploy_cnao
46+
deploy_cnao_cr
47+
./hack/deploy-kubevirt.sh
48+
49+
cd ${TMP_COMPONENT_PATH}
50+
echo "Run kubevirt-ipam-controller functional tests"
51+
make test-e2e
52+
}
53+
54+
[[ "${BASH_SOURCE[0]}" == "$0" ]] && main "$@"

0 commit comments

Comments
 (0)