Skip to content

Commit

Permalink
Fixes the integration test
Browse files Browse the repository at this point in the history
During the integration test, we're cloning the SRIOV Network Device
Plugin repository in order to deploy it.

However, it currently fails in the CI because we're cloning it in the
test instance, rather than cloning it locally. This results in
FileNotFoundErrors because the files we're trying to read to not exist
locally.

This updates the integration test to clone the git repository locally,
rather than in the test instance.
  • Loading branch information
claudiubelu committed Jul 24, 2024
1 parent d90da0f commit ab326d6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/integration/test_sriov_net_device_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

import logging
from pathlib import Path
import subprocess

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

LOG = logging.getLogger(__name__)


def _clone_git_repo(location: Path, repo: str, branch: str, instance: harness.Instance):
location.mkdir()

def _clone_git_repo(location: Path, repo: str, branch: str):
clone_command = [
"git",
"clone",
Expand All @@ -25,7 +24,7 @@ def _clone_git_repo(location: Path, repo: str, branch: str, instance: harness.In
str(location.absolute()),
]

instance.exec(clone_command)
subprocess.run(clone_command, check=True)


def _deploy_sriov_ndp(temp_path: Path, instance: harness.Instance):
Expand All @@ -35,7 +34,7 @@ def _deploy_sriov_ndp(temp_path: Path, instance: harness.Instance):

clone_path = temp_path / "sriov-ndp"
repo = "https://github.com/k8snetworkplumbingwg/sriov-network-device-plugin"
_clone_git_repo(clone_path, repo, "v3.6.2", instance)
_clone_git_repo(clone_path, repo, "v3.6.2")
deployments_path = clone_path / "deployments"

# Create a NetworkAttachmentDefinition and a deployment requiring it.
Expand Down

0 comments on commit ab326d6

Please sign in to comment.