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

Tests all the whereabouts versions #14

Merged
merged 1 commit into from
Jul 24, 2024
Merged
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
22 changes: 13 additions & 9 deletions tests/integration/test_whereabouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
from pathlib import Path

import pytest
from k8s_test_harness import harness
from k8s_test_harness.util import env_util, k8s_util

Expand All @@ -14,9 +15,9 @@
MANIFESTS_DIR = DIR / ".." / "templates"


def _get_whereabouts_helm_cmd():
def _get_whereabouts_helm_cmd(whereabouts_version):
whereabouts_rock = env_util.get_build_meta_info_for_rock_version(
"whereabouts", "0.6.3", "amd64"
"whereabouts", whereabouts_version, "amd64"
)
rock_image = whereabouts_rock.image

Expand All @@ -40,24 +41,27 @@ def _get_whereabouts_helm_cmd():
)


def test_integration_whereabouts(module_instance: harness.Instance):
@pytest.mark.parametrize("whereabouts_version", ("0.6.3", "0.6.1", "0.5.4"))
def test_integration_whereabouts(
function_instance: harness.Instance, whereabouts_version: str
):
# We also need multus in order to test out whereabouts.
# It should become Available if everything is fine with it.
helm_cmd = k8s_util.get_helm_install_command(
"multus", "oci://registry-1.docker.io/bitnamicharts/multus-cni"
)
module_instance.exec(helm_cmd)
k8s_util.wait_for_daemonset(module_instance, "multus-multus-cni", "kube-system")
function_instance.exec(helm_cmd)
k8s_util.wait_for_daemonset(function_instance, "multus-multus-cni", "kube-system")

module_instance.exec(_get_whereabouts_helm_cmd())
k8s_util.wait_for_daemonset(module_instance, "whereabouts", "whereabouts")
function_instance.exec(_get_whereabouts_helm_cmd(whereabouts_version))
k8s_util.wait_for_daemonset(function_instance, "whereabouts", "whereabouts")

# Create a NetworkAttachmentDefinition and a deployment requiring it.
for filename in ["whereabouts-net-definition.yaml", "deployment.yaml"]:
manifest = MANIFESTS_DIR / filename
module_instance.exec(
function_instance.exec(
["k8s", "kubectl", "apply", "-f", "-"],
input=Path(manifest).read_bytes(),
)

k8s_util.wait_for_deployment(module_instance, "netshoot-deployment")
k8s_util.wait_for_deployment(function_instance, "netshoot-deployment")
Loading