-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (111 loc) · 4.01 KB
/
e2e_libvirt.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# (C) Copyright Confidential Containers Contributors 2023.
# SPDX-License-Identifier: Apache-2.0
#
# Run libvirt e2e tests.
name: (Callable) libvirt e2e tests
on:
workflow_call:
inputs:
podvm_image:
required: true
type: string
install_directory_artifact:
description: The archive name of the install directory
default: ''
required: false
type: string
git_ref:
default: 'main'
description: Git ref to checkout the cloud-api-adaptor repository. Defaults to main.
required: false
type: string
env:
CLOUD_PROVIDER: libvirt
DEBIAN_FRONTEND: noninteractive
jobs:
test:
runs-on: az-ubuntu-2204
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- name: Rebase the code
if: github.event_name == 'pull_request_target'
run: |
./hack/ci-helper.sh rebase-atop-of-the-latest-target-branch
- name: Read properties from versions.yaml
run: |
sudo snap install yq
go_version="$(yq '.tools.golang' versions.yaml)"
[ -n "$go_version" ]
echo "GO_VERSION=${go_version}" >> "$GITHUB_ENV"
- name: Setup Golang version ${{ env.GO_VERSION }}
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup docker
run: |
sudo apt-get install -y docker.io
sudo usermod -aG docker "$USER"
- name: Extract qcow2 from ${{ inputs.podvm_image }}
run: |
qcow2=$(echo ${{ inputs.podvm_image }} | sed -e "s#.*/\(.*\):.*#\1.qcow2#")
./hack/download-image.sh ${{ inputs.podvm_image }} . -o ${qcow2}
echo "PODVM_QCOW2=$(pwd)/${qcow2}" >> "$GITHUB_ENV"
working-directory: podvm
- name: Get the install directory
if: ${{ inputs.install_directory_artifact != '' }}
uses: actions/download-artifact@v3
with:
name: ${{ inputs.install_directory_artifact }}
path: install
- name: Config Libvirt
run: |
./libvirt/config_libvirt.sh
# For debugging
cat libvirt.properties
- name: run tests
id: runTests
run: |
export CLOUD_PROVIDER=libvirt
export TEST_PROVISION="yes"
export TEST_TEARDOWN="no"
export TEST_PROVISION_FILE="$PWD/libvirt.properties"
export TEST_PODVM_IMAGE="${{ env.PODVM_QCOW2 }}"
export TEST_E2E_TIMEOUT="50m"
make test-e2e
- name: Debug tests failure
if: failure() && steps.runTests.outcome == 'failure'
run: |
export KUBECONFIG="${HOME}/.kcli/clusters/peer-pods/auth/kubeconfig"
echo "::group::CoCo and Peer Pods installation"
kubectl get pods -n confidential-containers-system
echo "::endgroup::"
echo "::group::cloud-api-adaptor logs"
kubectl logs -l app=cloud-api-adaptor -n confidential-containers-system
echo "::endgroup::"
for pod in $(kubectl get pods -o name 2>/dev/null); do
echo "::group::Describe $pod"
kubectl describe "$pod"
echo "::endgroup::"
done
echo "::group::Libvirt domains"
sudo virsh list
echo "::endgroup::"
for podvm in $(sudo virsh list --name | grep "podvm-"); do
echo "::group::podvm $podvm"
sudo virsh dominfo "$podvm"
sudo virsh domifaddr "$podvm"
echo "::endgroup::"
done
echo "::group::podvm base volume"
sudo virsh vol-info --pool default podvm-base.qcow2
ls -lh /var/lib/libvirt/images/podvm-base.qcow2
echo "::endgroup::"
echo "::group::Check podvm base volume integrity"
sudo qemu-img check /var/lib/libvirt/images/podvm-base.qcow2
echo "::endgroup::"
# Avoid running with `set -e` as command fails should be allowed
shell: bash {0}