Skip to content

Commit

Permalink
e2e: Move tests to gh action using azure workers
Browse files Browse the repository at this point in the history
use the azure runners provided by "confidential-containers/infra" to run
the kata-clh and kata-qemu workflows.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
  • Loading branch information
ldoktor committed Dec 1, 2023
1 parent a27d7f3 commit 4d5465e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ccruntime_e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: ccruntime e2e tests
on:
pull_request:
branches:
- main

permissions:
contents: read

jobs:
e2e:
name: operator tests
runs-on:
- az-ubuntu-2004
- az-ubuntu-2204

strategy:
matrix:
runtimeclass: ["kata-qemu", "kata-clh"]

steps:
- uses: actions/checkout@v4

- name: Install deps
run: |
sudo apt-get update -y
sudo apt-get install -y ansible python-is-python3
- name: Run e2e tests
run: |
cd tests/e2e
export PATH="$PATH:/usr/local/bin"
./run-local.sh -r "${{ matrix.runtimeclass }}" -u
4 changes: 2 additions & 2 deletions tests/e2e/cluster/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ main() {

# Untaint the node so that pods can be scheduled on it.
for role in master control-plane; do
kubectl taint nodes "$(hostname)" \
kubectl taint nodes "$SAFE_HOST_NAME" \
"node-role.kubernetes.io/$role:NoSchedule-"
done

kubectl label node "$(hostname)" node.kubernetes.io/worker=
kubectl label node "$SAFE_HOST_NAME" node.kubernetes.io/worker=
}

main "$@"
3 changes: 3 additions & 0 deletions tests/e2e/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# SPDX-License-Identifier: Apache-2.0
#

# Normalize system hostname to the usual kubectl node name
export SAFE_HOST_NAME=$(hostname | tr '[:upper:]' '[:lower:]')

# Wait until the node is ready. It is set a timeout of 180 seconds.
#
check_node_is_ready() {
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ install_operator() {

# The node should be 'worker' labeled
local label="node.kubernetes.io/worker"
if ! kubectl get node "$(hostname)" -o jsonpath='{.metadata.labels}' \
if ! kubectl get node "$SAFE_HOST_NAME" -o jsonpath='{.metadata.labels}' \
| grep -q "$label"; then
kubectl label node "$(hostname)" "$label="
kubectl label node "$SAFE_HOST_NAME" "$label="
fi

handle_older_containerd
Expand Down

0 comments on commit 4d5465e

Please sign in to comment.