Skip to content

Commit

Permalink
Merge pull request #881 from mdujava/tmpdir_and_persistence
Browse files Browse the repository at this point in the history
tmpdir and persistence
  • Loading branch information
mdujava authored Oct 14, 2024
2 parents ed4a447 + 536c45f commit 6b1cc87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion testsuite/certificates/persist.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self) -> None:
@property
def _directory(self):
if not self._dir:
self._dir = tempfile.mkdtemp(prefix="tls_certs", dir=os.environ.get("resultsdir"))
self._dir = tempfile.mkdtemp(prefix="tls_certs_", dir=os.environ.get("resultsdir"))
return self._dir

@abstractmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import re
import tempfile
from typing import Tuple
from urllib.parse import urlparse

Expand Down Expand Up @@ -50,7 +51,7 @@ def run(hits):


@pytest.fixture
def read_log(staging_gateway, tmpdir):
def read_log(staging_gateway):
"""Read log from gateway by copying it to a local directory.
Returns a tuple containing the content of the file and also the
Expand All @@ -60,6 +61,11 @@ def read_log(staging_gateway, tmpdir):
def read(filename) -> Tuple[str, int]:
source = f"/tmp/{filename}"

# tmpdir is used as destination for files to rsync, file is only read
# into string, since file is only used in this function it does not
# need to be in $resultsdir, also dir needs to be created every time,
# e.g in case --load is used and tmpdir does no longer exists
tmpdir = tempfile.mkdtemp(prefix="apicast_logs_")
dest = f"{tmpdir}/{filename}"

# copy log file from apicast to local
Expand Down

0 comments on commit 6b1cc87

Please sign in to comment.