From b765ca30dba4ecc2bf4e9207df8c9c78055d9aa3 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 28 Jul 2025 08:43:24 -0400 Subject: [PATCH] MT#58458 tests: remove duplicate .git extract The process_pool function already extracts the provided tarball to initialise an empty git repo. Doing it again when creating the directories is redundant. Use the appropriate /etc path for config file output. Change-Id: I3c598a4b1ddf3a65f7f1759c9b29f1f7d1c098bf --- t/fixtures/programs.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/t/fixtures/programs.py b/t/fixtures/programs.py index c2f93193..bcbe7df8 100644 --- a/t/fixtures/programs.py +++ b/t/fixtures/programs.py @@ -94,10 +94,9 @@ def copy_tree(base, src, dst_dir): @pytest.fixture() def ngcpcfg(gitrepo, tmpdir, *args): fakehome = Path(tmpdir.mkdir("fakehome")).resolve() - outdir = Path( - gitrepo.extract_archive(str(EMPTY_GIT), - tmpdir.mkdir("ngcp-pytest-output")) - ) + outdir = Path(tmpdir.mkdir("ngcp-pytest-output")) + basedir = outdir.joinpath("etc") + basedir.mkdir() rundir = Path(tmpdir.mkdir("ngcp-pytest-rundir")) statedir = Path(tmpdir.mkdir("var-lib-ngcpcfg-state")) ngcpctl_dir = Path( @@ -207,7 +206,7 @@ def ngcpcfg(gitrepo, tmpdir, *args): return testenv, config["ngcpcfg"] config = read_cfg(testenv["NGCPCFG"], env) - testenv["NGCPCTL_BASE"] = outdir + testenv["NGCPCTL_BASE"] = basedir testenv["NGCPCTL_MAIN"] = ngcpctl_dir for key in CFG_EXTRA: if not isinstance(testenv[key], Path):