2021-01-08 13:41:50 +01:00
|
|
|
From f5c9527aeee190a66a908037770c80a75e911d8c Mon Sep 17 00:00:00 2001
|
2019-01-17 10:18:02 +01:00
|
|
|
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
|
|
|
|
<psuarezhernandez@suse.com>
|
|
|
|
Date: Tue, 6 Nov 2018 16:38:54 +0000
|
|
|
|
Subject: [PATCH] Fix git_pillar merging across multiple __env__
|
|
|
|
repositories (bsc#1112874)
|
|
|
|
|
|
|
|
Resolve target branch when using __env__
|
|
|
|
|
|
|
|
Test git ext_pillar across multiple repos using __env__
|
|
|
|
|
|
|
|
Remove unicode references
|
|
|
|
---
|
2021-01-08 13:41:50 +01:00
|
|
|
tests/integration/pillar/test_git_pillar.py | 55 +++++++++++++++++++++
|
|
|
|
1 file changed, 55 insertions(+)
|
2019-01-17 10:18:02 +01:00
|
|
|
|
|
|
|
diff --git a/tests/integration/pillar/test_git_pillar.py b/tests/integration/pillar/test_git_pillar.py
|
2021-01-08 13:41:50 +01:00
|
|
|
index c0362127f6..979dfebb94 100644
|
2019-01-17 10:18:02 +01:00
|
|
|
--- a/tests/integration/pillar/test_git_pillar.py
|
|
|
|
+++ b/tests/integration/pillar/test_git_pillar.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -1600,6 +1600,61 @@ class TestPygit2SSH(GitPillarSSHTestBase):
|
|
|
|
},
|
2019-01-17 10:18:02 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
+
|
2019-04-12 11:57:21 +02:00
|
|
|
+@skipIf(NO_MOCK, NO_MOCK_REASON)
|
2021-01-08 13:41:50 +01:00
|
|
|
+@skipIf(_windows_or_mac(), "minion is windows or mac")
|
2019-04-12 11:57:21 +02:00
|
|
|
+@skip_if_not_root
|
2021-01-08 13:41:50 +01:00
|
|
|
+@skipIf(
|
|
|
|
+ not HAS_PYGIT2,
|
|
|
|
+ "pygit2 >= {} and libgit2 >= {} required".format(PYGIT2_MINVER, LIBGIT2_MINVER),
|
|
|
|
+)
|
|
|
|
+@skipIf(not HAS_NGINX, "nginx not present")
|
|
|
|
+@skipIf(not HAS_VIRTUALENV, "virtualenv not present")
|
2019-04-12 11:57:21 +02:00
|
|
|
+class TestPygit2HTTP(GitPillarHTTPTestBase):
|
2021-01-08 13:41:50 +01:00
|
|
|
+ """
|
2019-04-12 11:57:21 +02:00
|
|
|
+ Test git_pillar with pygit2 using SSH authentication
|
2021-01-08 13:41:50 +01:00
|
|
|
+ """
|
|
|
|
+
|
2019-04-12 11:57:21 +02:00
|
|
|
+ def test_single_source(self):
|
2021-01-08 13:41:50 +01:00
|
|
|
+ """
|
2019-01-17 10:18:02 +01:00
|
|
|
+ Test with git_pillar_includes enabled and using "__env__" as the branch
|
|
|
|
+ name for the configured repositories.
|
|
|
|
+ The "gitinfo" repository contains top.sls file with a local reference
|
|
|
|
+ and also referencing external "nowhere.foo" which is provided by "webinfo"
|
|
|
|
+ repository mounted as "nowhere".
|
2021-01-08 13:41:50 +01:00
|
|
|
+ """
|
|
|
|
+ ret = self.get_pillar(
|
|
|
|
+ """\
|
2019-01-17 10:18:02 +01:00
|
|
|
+ file_ignore_regex: []
|
|
|
|
+ file_ignore_glob: []
|
|
|
|
+ git_pillar_provider: pygit2
|
|
|
|
+ git_pillar_pubkey: {pubkey_nopass}
|
|
|
|
+ git_pillar_privkey: {privkey_nopass}
|
|
|
|
+ cachedir: {cachedir}
|
|
|
|
+ extension_modules: {extmods}
|
|
|
|
+ ext_pillar:
|
|
|
|
+ - git:
|
|
|
|
+ - __env__ {url_extra_repo}:
|
|
|
|
+ - name: gitinfo
|
|
|
|
+ - __env__ {url}:
|
|
|
|
+ - name: webinfo
|
|
|
|
+ - mountpoint: nowhere
|
2021-01-08 13:41:50 +01:00
|
|
|
+ """
|
|
|
|
+ )
|
2019-01-17 10:18:02 +01:00
|
|
|
+ self.assertEqual(
|
|
|
|
+ ret,
|
2021-01-08 13:41:50 +01:00
|
|
|
+ {
|
|
|
|
+ "branch": "master",
|
|
|
|
+ "motd": "The force will be with you. Always.",
|
|
|
|
+ "mylist": ["master"],
|
|
|
|
+ "mydict": {
|
|
|
|
+ "master": True,
|
|
|
|
+ "nested_list": ["master"],
|
|
|
|
+ "nested_dict": {"master": True},
|
|
|
|
+ },
|
|
|
|
+ },
|
2019-01-17 10:18:02 +01:00
|
|
|
+ )
|
|
|
|
+
|
2021-01-08 13:41:50 +01:00
|
|
|
@slowTest
|
|
|
|
def test_root_parameter(self):
|
|
|
|
"""
|
2019-01-17 10:18:02 +01:00
|
|
|
--
|
2021-01-08 13:41:50 +01:00
|
|
|
2.29.2
|
2019-01-17 10:18:02 +01:00
|
|
|
|
|
|
|
|