From 2e1ff957a14dc495b7f10a6b9590cc50cb5992aa Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 24 Nov 2022 15:45:03 +0100 Subject: tests: Allow file protocol for submodule test Closes: #1023379 --- tests/04_test_submodules.py | 3 +++ tests/component/deb/test_import_orig.py | 2 ++ tests/component/rpm/test_buildpackage_rpm.py | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/tests/04_test_submodules.py b/tests/04_test_submodules.py index 52e15ddb..5e097694 100644 --- a/tests/04_test_submodules.py +++ b/tests/04_test_submodules.py @@ -46,6 +46,7 @@ def setup(): REPODIR = TMPDIR.join('test_repo') REPO = DebianGitRepository.create(REPODIR) + os.environ['GIT_ALLOW_PROTOCOL'] = 'file' for name in SUBMODULE_NAMES: SUBMODULES.append(Submodule(name, str(TMPDIR))) @@ -54,7 +55,9 @@ def setup(): def teardown(): """Test module teardown""" + context.teardown() + del os.environ['GIT_ALLOW_PROTOCOL'] def test_empty_has_submodules(): diff --git a/tests/component/deb/test_import_orig.py b/tests/component/deb/test_import_orig.py index 745024e4..2a949fbd 100644 --- a/tests/component/deb/test_import_orig.py +++ b/tests/component/deb/test_import_orig.py @@ -505,7 +505,9 @@ class TestImportOrig(ComponentTestBase): Test that importing works if repo is a git submodule (#674015) """ parent_repo = GitRepository.create('../parent') + os.environ['GIT_ALLOW_PROTOCOL'] = 'file' parent_repo.add_submodule(repo.path) + del os.environ['GIT_ALLOW_PROTOCOL'] parent_repo.update_submodules(init=True, recursive=True) submodule = GitRepository(os.path.join(parent_repo.path, 'hello-debhelper')) diff --git a/tests/component/rpm/test_buildpackage_rpm.py b/tests/component/rpm/test_buildpackage_rpm.py index 51c76cb1..fe3cb7b3 100644 --- a/tests/component/rpm/test_buildpackage_rpm.py +++ b/tests/component/rpm/test_buildpackage_rpm.py @@ -367,7 +367,9 @@ class TestGbpRpm(RpmRepoTestBase): pkg_branch = repo.get_branch() upstr_branch = 'upstream' repo.set_branch(upstr_branch) + os.environ['GIT_ALLOW_PROTOCOL'] = 'file' repo.add_submodule(sub_repo.path) + del os.environ['GIT_ALLOW_PROTOCOL'] repo.commit_all('Add submodule') repo.set_branch(pkg_branch) @@ -407,7 +409,9 @@ class TestGbpRpm(RpmRepoTestBase): # Create submodule sub_repo = self.orig_repos['gbp-test-native2'] + os.environ['GIT_ALLOW_PROTOCOL'] = 'file' repo.add_submodule(sub_repo.path) + del os.environ['GIT_ALLOW_PROTOCOL'] repo.commit_all('Add submodule') sub_files = sub_repo.ls_tree('HEAD') -- cgit v1.2.3