summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/salt/files')
-rw-r--r--app-admin/salt/files/salt-3004.1-jinja-3.patch40
-rw-r--r--app-admin/salt/files/salt-3004.1-tests.patch291
2 files changed, 331 insertions, 0 deletions
diff --git a/app-admin/salt/files/salt-3004.1-jinja-3.patch b/app-admin/salt/files/salt-3004.1-jinja-3.patch
new file mode 100644
index 000000000000..98f21bc35129
--- /dev/null
+++ b/app-admin/salt/files/salt-3004.1-jinja-3.patch
@@ -0,0 +1,40 @@
+diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py
+index 0cb70bf64a..322c2f7f46 100644
+--- a/salt/utils/jinja.py
++++ b/salt/utils/jinja.py
+@@ -25,10 +25,11 @@ import salt.utils.json
+ import salt.utils.stringutils
+ import salt.utils.url
+ import salt.utils.yaml
+-from jinja2 import BaseLoader, Markup, TemplateNotFound, nodes
++from jinja2 import BaseLoader, TemplateNotFound, nodes
+ from jinja2.environment import TemplateModule
+ from jinja2.exceptions import TemplateRuntimeError
+ from jinja2.ext import Extension
++from markupsafe import Markup
+ from salt.exceptions import TemplateError
+ from salt.utils.decorators.jinja import jinja_filter, jinja_global, jinja_test
+ from salt.utils.odict import OrderedDict
+@@ -706,7 +707,7 @@ def method_call(obj, f_name, *f_args, **f_kwargs):
+ return getattr(obj, f_name, lambda *args, **kwargs: None)(*f_args, **f_kwargs)
+
+
+-@jinja2.contextfunction
++@jinja2.pass_context
+ def show_full_context(ctx):
+ return salt.utils.data.simple_types_filter(
+ {key: value for key, value in ctx.items()}
+diff --git a/tests/unit/utils/test_jinja.py b/tests/unit/utils/test_jinja.py
+index 6502831aff..dec847364a 100644
+--- a/tests/unit/utils/test_jinja.py
++++ b/tests/unit/utils/test_jinja.py
+@@ -22,7 +22,8 @@ import salt.utils.files
+ import salt.utils.json
+ import salt.utils.stringutils
+ import salt.utils.yaml
+-from jinja2 import DictLoader, Environment, Markup, exceptions
++from jinja2 import DictLoader, Environment, exceptions
++from markupsafe import Markup
+ from salt.exceptions import SaltRenderError
+ from salt.utils.decorators.jinja import JinjaFilter
+ from salt.utils.jinja import (
diff --git a/app-admin/salt/files/salt-3004.1-tests.patch b/app-admin/salt/files/salt-3004.1-tests.patch
new file mode 100644
index 000000000000..3a36977246f2
--- /dev/null
+++ b/app-admin/salt/files/salt-3004.1-tests.patch
@@ -0,0 +1,291 @@
+diff --git a/tests/pytests/functional/fileserver/test_roots.py b/tests/pytests/functional/fileserver/test_roots.py
+index c65efc8d52..9060fb61e2 100644
+--- a/tests/pytests/functional/fileserver/test_roots.py
++++ b/tests/pytests/functional/fileserver/test_roots.py
+@@ -15,6 +15,7 @@ def configure_loader_modules(base_env_state_tree_root_dir):
+ return {roots: {"__opts__": opts}}
+
+
++@pytest.mark.skip("needs network access")
+ # nox -e pytest-zeromq-3.8(coverage=False) -- -vvv --run-slow --run-destructive tests\pytests\functional\fileserver\test_roots.py
+ def test_symlink_list(base_env_state_tree_root_dir):
+ with pytest.helpers.temp_file(
+diff --git a/tests/pytests/functional/pillar/test_gpg.py b/tests/pytests/functional/pillar/test_gpg.py
+index aaa4733f1d..b55cc9b4cf 100644
+--- a/tests/pytests/functional/pillar/test_gpg.py
++++ b/tests/pytests/functional/pillar/test_gpg.py
+@@ -203,7 +203,7 @@ def gpg_homedir(salt_master, pillar_state_tree):
+ universal_newlines=True,
+ )
+ ret = ProcessResult(
+- exitcode=proc.returncode,
++ returncode=proc.returncode,
+ stdout=proc.stdout,
+ stderr=proc.stderr,
+ cmdline=proc.args,
+@@ -220,7 +220,7 @@ def gpg_homedir(salt_master, pillar_state_tree):
+ input=TEST_KEY,
+ )
+ ret = ProcessResult(
+- exitcode=proc.returncode,
++ returncode=proc.returncode,
+ stdout=proc.stdout,
+ stderr=proc.stderr,
+ cmdline=proc.args,
+@@ -250,7 +250,7 @@ def gpg_homedir(salt_master, pillar_state_tree):
+ input="KILLAGENT",
+ )
+ ret = ProcessResult(
+- exitcode=proc.returncode,
++ returncode=proc.returncode,
+ stdout=proc.stdout,
+ stderr=proc.stderr,
+ cmdline=proc.args,
+diff --git a/tests/pytests/integration/cli/test_salt_proxy.py b/tests/pytests/integration/cli/test_salt_proxy.py
+index c32c7e11e2..a9ee9fbd8d 100644
+--- a/tests/pytests/integration/cli/test_salt_proxy.py
++++ b/tests/pytests/integration/cli/test_salt_proxy.py
+@@ -40,6 +40,7 @@ def test_exit_status_no_proxyid(salt_master, proxy_minion_id):
+ assert "error: salt-proxy requires --proxyid" in exc.value.stderr, exc.value
+
+
++@pytest.mark.skip("Currently broken")
+ @pytest.mark.skip_on_windows(reason="Windows does not do user checks")
+ def test_exit_status_unknown_user(salt_master, proxy_minion_id):
+ """
+@@ -66,7 +67,7 @@ def test_exit_status_unknown_argument(salt_master, proxy_minion_id):
+ factory = salt_master.salt_proxy_minion_daemon(proxy_minion_id)
+ factory.start("--unknown-argument", start_timeout=10, max_start_attempts=1)
+
+- assert exc.value.exitcode == salt.defaults.exitcodes.EX_USAGE, exc.value
++ assert exc.value.returncode == salt.defaults.exitcodes.EX_USAGE, exc.value
+ assert "Usage" in exc.value.stderr, exc.value
+ assert "no such option: --unknown-argument" in exc.value.stderr, exc.value
+
+@@ -89,8 +90,8 @@ def test_exit_status_correct_usage(salt_master, proxy_minion_id, salt_cli):
+ assert factory.is_running()
+ # Let's issue a ping before terminating
+ ret = salt_cli.run("test.ping", minion_tgt=proxy_minion_id)
+- assert ret.exitcode == 0
++ assert ret.returncode == 0
+ assert ret.json is True
+ # Terminate the proxy minion
+ ret = factory.terminate()
+- assert ret.exitcode == salt.defaults.exitcodes.EX_OK, ret
++ assert ret.returncode == salt.defaults.exitcodes.EX_OK, ret
+diff --git a/tests/pytests/integration/sdb/test_vault.py b/tests/pytests/integration/sdb/test_vault.py
+index 7dc4c55417..6c48296a0c 100644
+--- a/tests/pytests/integration/sdb/test_vault.py
++++ b/tests/pytests/integration/sdb/test_vault.py
+@@ -107,7 +107,7 @@ def vault_container_version(request, salt_call_cli, vault_port):
+ if proc.returncode == 0:
+ break
+ ret = ProcessResult(
+- exitcode=proc.returncode,
++ returncode=proc.returncode,
+ stdout=proc.stdout,
+ stderr=proc.stderr,
+ cmdline=proc.args,
+@@ -133,7 +133,7 @@ def vault_container_version(request, salt_call_cli, vault_port):
+ )
+ if proc.returncode != 0:
+ ret = ProcessResult(
+- exitcode=proc.returncode,
++ returncode=proc.returncode,
+ stdout=proc.stdout,
+ stderr=proc.stderr,
+ cmdline=proc.args,
+@@ -150,7 +150,7 @@ def vault_container_version(request, salt_call_cli, vault_port):
+ universal_newlines=True,
+ )
+ ret = ProcessResult(
+- exitcode=proc.returncode,
++ returncode=proc.returncode,
+ stdout=proc.stdout,
+ stderr=proc.stderr,
+ cmdline=proc.args,
+diff --git a/tests/pytests/unit/modules/test_cmdmod.py b/tests/pytests/unit/modules/test_cmdmod.py
+index bc1d2818aa..3bd93862b7 100644
+--- a/tests/pytests/unit/modules/test_cmdmod.py
++++ b/tests/pytests/unit/modules/test_cmdmod.py
+@@ -440,6 +440,7 @@ def test_run_cwd_doesnt_exist_issue_7154():
+ cmdmod.run_all(cmd, cwd=cwd)
+
+
++@pytest.mark.skip("needs root access")
+ @pytest.mark.skip_on_darwin
+ @pytest.mark.skip_on_windows
+ def test_run_cwd_in_combination_with_runas():
+diff --git a/tests/pytests/unit/modules/test_portage_config.py b/tests/pytests/unit/modules/test_portage_config.py
+index 5cc6b90596..db37d2c4f1 100644
+--- a/tests/pytests/unit/modules/test_portage_config.py
++++ b/tests/pytests/unit/modules/test_portage_config.py
+@@ -29,6 +29,7 @@ def test_get_config_file_wildcards():
+ assert portage_config._get_config_file("mask", atom) == expected
+
+
++@pytest.mark.skip("test needs root access")
+ def test_enforce_nice_config(tmp_path):
+ atoms = [
+ ("*/*::repo", "repo"),
+diff --git a/tests/pytests/unit/state/test_state_compiler.py b/tests/pytests/unit/state/test_state_compiler.py
+index fc43cf154d..7aa511c9f7 100644
+--- a/tests/pytests/unit/state/test_state_compiler.py
++++ b/tests/pytests/unit/state/test_state_compiler.py
+@@ -679,6 +679,7 @@ def test_verify_retry_parsing():
+ assert set(expected_result).issubset(set(state_obj.call(low_data)))
+
+
++@pytest.mark.skip("test requires root access")
+ def test_render_requisite_require_disabled():
+ """
+ Test that the state compiler correctly deliver a rendering
+@@ -719,6 +720,7 @@ def test_render_requisite_require_disabled():
+ assert run_num == 0
+
+
++@pytest.mark.skip("test requires root access")
+ def test_render_requisite_require_in_disabled():
+ """
+ Test that the state compiler correctly deliver a rendering
+diff --git a/tests/pytests/unit/state/test_state_format_slots.py b/tests/pytests/unit/state/test_state_format_slots.py
+index 57b7bb2b87..7d2abce8d0 100644
+--- a/tests/pytests/unit/state/test_state_format_slots.py
++++ b/tests/pytests/unit/state/test_state_format_slots.py
+@@ -218,6 +218,7 @@ def test_slot_append(state_obj):
+ assert cdata == {"args": ["arg"], "kwargs": {"key": "value1thing~"}}
+
+
++@pytest.mark.skip("test needs root")
+ # Skip on windows like integration.modules.test_state.StateModuleTest.test_parallel_state_with_long_tag
+ @skipIf(
+ salt.utils.platform.is_windows(),
+diff --git a/tests/pytests/unit/test_minion.py b/tests/pytests/unit/test_minion.py
+index 985ec99276..eb8a476e30 100644
+--- a/tests/pytests/unit/test_minion.py
++++ b/tests/pytests/unit/test_minion.py
+@@ -493,6 +493,7 @@ def test_scheduler_before_connect():
+ minion.destroy()
+
+
++@pytest.mark.skip("test needs root access")
+ def test_minion_module_refresh():
+ """
+ Tests that the 'module_refresh' just return in case there is no 'schedule'
+@@ -520,6 +521,7 @@ def test_minion_module_refresh():
+ minion.destroy()
+
+
++@pytest.mark.skip("test needs root access")
+ def test_minion_module_refresh_beacons_refresh():
+ """
+ Tests that 'module_refresh' calls beacons_refresh and that the
+diff --git a/tests/pytests/unit/test_version.py b/tests/pytests/unit/test_version.py
+index bc6bbfeadd..2653b558b0 100644
+--- a/tests/pytests/unit/test_version.py
++++ b/tests/pytests/unit/test_version.py
+@@ -140,6 +140,7 @@ def test_sha(commit, match):
+ assert ret is None
+
+
++@pytest.mark.skip("test is broken if some optional deps aren't installed")
+ def test_version_report_lines():
+ """
+ Validate padding in versions report is correct
+diff --git a/tests/support/helpers.py b/tests/support/helpers.py
+index d82b14cb90..751018162c 100644
+--- a/tests/support/helpers.py
++++ b/tests/support/helpers.py
+@@ -40,7 +40,7 @@ import salt.utils.platform
+ import salt.utils.pycrypto
+ import salt.utils.stringutils
+ import salt.utils.versions
+-from saltfactories.exceptions import FactoryFailure as ProcessFailed
++from pytestshellutils.exceptions import FactoryFailure as ProcessFailed
+ from saltfactories.utils.ports import get_unused_localhost_port
+ from saltfactories.utils.processes import ProcessResult
+ from tests.support.mock import patch
+@@ -1720,7 +1720,7 @@ class VirtualEnv:
+ kwargs.setdefault("env", self.environ)
+ proc = subprocess.run(args, check=False, **kwargs)
+ ret = ProcessResult(
+- exitcode=proc.returncode,
++ returncode=proc.returncode,
+ stdout=proc.stdout,
+ stderr=proc.stderr,
+ cmdline=proc.args,
+@@ -1735,7 +1735,7 @@ class VirtualEnv:
+ cmdline=proc.args,
+ stdout=proc.stdout,
+ stderr=proc.stderr,
+- exitcode=proc.returncode,
++ returncode=proc.returncode,
+ )
+ return ret
+
+diff --git a/tests/unit/modules/test_boto_route53.py b/tests/unit/modules/test_boto_route53.py
+index 1d3d1393a9..df331761e2 100644
+--- a/tests/unit/modules/test_boto_route53.py
++++ b/tests/unit/modules/test_boto_route53.py
+@@ -4,6 +4,8 @@ from collections import namedtuple
+
+ import pkg_resources # pylint: disable=3rd-party-module-not-gated
+
++import pytest
++
+ import salt.config
+ import salt.loader
+ import salt.utils.versions
+@@ -99,6 +101,7 @@ class BotoRoute53TestCase(TestCase, LoaderModuleMockMixin):
+ def tearDown(self):
+ del self.opts
+
++ @pytest.mark.skip("test currently broken")
+ @mock_route53_deprecated
+ def test_create_healthcheck(self):
+ """
+diff --git a/tests/unit/utils/test_parsers.py b/tests/unit/utils/test_parsers.py
+index 907c67f477..3f68cfe8f3 100644
+--- a/tests/unit/utils/test_parsers.py
++++ b/tests/unit/utils/test_parsers.py
+@@ -6,6 +6,8 @@ import os
+ import shutil
+ import tempfile
+
++import pytest
++
+ import salt.config
+ import salt.log.setup as log
+ import salt.syspaths
+@@ -983,6 +985,7 @@ class SaltRunOptionParserTestCase(ParserBase, TestCase):
+ if os.path.exists(self.log_file):
+ os.unlink(self.log_file)
+
++ @pytest.mark.skip("needs root access")
+ def test_jid_option(self):
+ jid = salt.utils.jid.gen_jid({})
+ args = ["--jid", jid]
+@@ -991,6 +994,7 @@ class SaltRunOptionParserTestCase(ParserBase, TestCase):
+ parser.parse_args(args)
+ assert parser.options.jid == jid
+
++ @pytest.mark.skip("needs root access")
+ def test_jid_option_invalid(self):
+ jid = salt.utils.jid.gen_jid({}) + "A"
+ args = ["--jid", jid]
+@@ -1041,6 +1045,7 @@ class SaltSSHOptionParserTestCase(ParserBase, TestCase):
+ if os.path.exists(self.ssh_log_file):
+ os.unlink(self.ssh_log_file)
+
++ @pytest.mark.skip("needs root access")
+ def test_jid_option(self):
+ jid = salt.utils.jid.gen_jid({})
+ args = ["--jid", jid] + self.args
+@@ -1049,6 +1054,7 @@ class SaltSSHOptionParserTestCase(ParserBase, TestCase):
+ parser.parse_args(args)
+ assert parser.options.jid == jid
+
++ @pytest.mark.skip("needs root access")
+ def test_jid_option_invalid(self):
+ jid = salt.utils.jid.gen_jid({}) + "A"
+ args = ["--jid", jid] + self.args