Skip to content

Commit

Permalink
Fix registry mirror log collection (#839)
Browse files Browse the repository at this point in the history
The registry mirror instance doesn't currently include the k8s snap,
which is why the log collection script is missing.

This commit will install the k8s snap on the mirror instance
and also capture the "inspect.sh" stderr output.
  • Loading branch information
petrutlucian94 authored Nov 25, 2024
1 parent 8e6ef1f commit c416c51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions tests/integration/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ def _generate_inspection_report(h: harness.Harness, instance_id: str):
)

(inspection_path / instance_id).mkdir(parents=True, exist_ok=True)
(inspection_path / instance_id / "inspection_report_logs.txt").write_text(
result.stdout
)
report_log = inspection_path / instance_id / "inspection_report_logs.txt"
with report_log.open("w") as f:
f.write("stdout:\n")
f.write(result.stdout)
f.write("stderr:\n")
f.write(result.stderr)

try:
h.pull_file(
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/tests/test_util/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
# Copyright 2024 Canonical, Ltd.
#
import logging
from pathlib import Path
from string import Template
from typing import List, Optional

from test_util import config
from test_util.harness import Harness, Instance
from test_util.util import get_default_ip
from test_util.util import get_default_ip, setup_k8s_snap

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -80,6 +81,8 @@ def __init__(self, h: Harness):

self.add_mirrors()

setup_k8s_snap(self.instance, Path("/"))

def get_configured_mirrors(self) -> List[Mirror]:
mirrors: List[Mirror] = []
for mirror_dict in config.MIRROR_LIST:
Expand Down

0 comments on commit c416c51

Please sign in to comment.