commit:     4c5df443a39ee9626525f3f23798eb883b70c3db
Author:     Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Sat Apr  3 04:19:09 2021 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Sat Apr  3 04:20:04 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c5df443

app-admin/salt-3003: Version bump

Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 app-admin/salt/Manifest                            |   1 +
 .../salt/files/salt-3003-gentoolkit-revdep.patch   |  13 ++
 .../salt-3003-skip-tests-that-oom-machine.patch    |  20 +++
 app-admin/salt/files/salt-3003-tests.patch         | 139 +++++++++++++++
 app-admin/salt/salt-3003.ebuild                    | 194 +++++++++++++++++++++
 5 files changed, 367 insertions(+)

diff --git a/app-admin/salt/Manifest b/app-admin/salt/Manifest
index b7e31231a67..f47131ca6e5 100644
--- a/app-admin/salt/Manifest
+++ b/app-admin/salt/Manifest
@@ -2,3 +2,4 @@ DIST salt-3000.2-py38-misc.patch.gz 6250 BLAKE2B 
68fff80a042e6bf208ea2d9692da7a7
 DIST salt-3000.8.tar.gz 15249139 BLAKE2B 
df306669ba11dd650621222ff9c69f5a6e16b6f431e9d93e6712ee95da43091bfe28416fe0d71988ed9ee70cb347755b779a356c50fa59c63c67a874ed1906f4
 SHA512 
a18d5bea3b3835f83d5b1e5315990d83f6c58c36df5589d5de0f8cc3a46db4c960b58032e29d56841a160b9b170cdbb81bca38dbbd72ccb5866ccc8a7da6e800
 DIST salt-3001.6.tar.gz 15736056 BLAKE2B 
00e7674452e9d61c3cd487d27a3a1f3435c6b12dcc89008aa63c96814957b6ce8654f4d4d51dbce7b14027f0cee66fd2ea9602f6be18bf2f4beac11ae164f89f
 SHA512 
e45c9cfddb64ab1c9d66b6b6b3e5ff8d9010c01307161e5013140b4362ee630cf912ab153d1afa72f56d18fc5353293b2f4b449caf8ee384d1e93204d490bf4c
 DIST salt-3002.5.tar.gz 15784880 BLAKE2B 
baa90bb0caea572dfbe12d92fb488ee0c4adef9a07221f394009cd43a62ffef18c57f2e7cdcfcd923807c7a3d02ce6833480f74d70250c29d311420f30514300
 SHA512 
dda2caa338f646ec51d2de6b0df10fbb27eceddbe8c797ae192b9ef1312d566ae71a243a3a95918fa375b125089aa29a73b1b908c5cc1b0451dccb582a4978a1
+DIST salt-3003.tar.gz 15830910 BLAKE2B 
ea4f02eece951c3fb4fcc480d00f7b531ac549b2e23ff9a210b73f749f9ba83e0402e02a59028f41f94958d17512e417b7c1b7015e8ee3aeac55be9b1374fe6f
 SHA512 
7f631466372f303c03f2852a5cfba1ee5c6ba1636a6fe1e1622e90d0b1376ef9f670aa1b4754f3d9c8c7fe1b99fe1b4c49e140dc86d90d157a1ec1e73ba43c38

diff --git a/app-admin/salt/files/salt-3003-gentoolkit-revdep.patch 
b/app-admin/salt/files/salt-3003-gentoolkit-revdep.patch
new file mode 100644
index 00000000000..f73b5a8790f
--- /dev/null
+++ b/app-admin/salt/files/salt-3003-gentoolkit-revdep.patch
@@ -0,0 +1,13 @@
+diff --git a/salt/modules/gentoolkitmod.py b/salt/modules/gentoolkitmod.py
+index cc78c37114..f0949d19a8 100644
+--- a/salt/modules/gentoolkitmod.py
++++ b/salt/modules/gentoolkitmod.py
+@@ -49,7 +49,7 @@ def revdep_rebuild(lib=None):
+ 
+         salt '*' gentoolkit.revdep_rebuild
+     """
+-    cmd = "revdep-rebuild -i --quiet --no-progress"
++    cmd = "revdep-rebuild -i --quiet"
+     if lib is not None:
+         cmd += " --library={0}".format(lib)
+     return __salt__["cmd.retcode"](cmd, python_shell=False) == 0

diff --git a/app-admin/salt/files/salt-3003-skip-tests-that-oom-machine.patch 
b/app-admin/salt/files/salt-3003-skip-tests-that-oom-machine.patch
new file mode 100644
index 00000000000..804b6a8704f
--- /dev/null
+++ b/app-admin/salt/files/salt-3003-skip-tests-that-oom-machine.patch
@@ -0,0 +1,20 @@
+diff --git a/tests/unit/modules/test_boto_apigateway.py 
b/tests/unit/modules/test_boto_apigateway.py
+index 6ee6aeb002..db9aeaee95 100644
+--- a/tests/unit/modules/test_boto_apigateway.py
++++ b/tests/unit/modules/test_boto_apigateway.py
+@@ -154,6 +154,7 @@ def _has_required_botocore():
+         return True
+ 
+ 
++@skipIf(True, "Causes machines to OOM")
+ class BotoApiGatewayTestCaseBase(TestCase, LoaderModuleMockMixin):
+     conn = None
+ 
+@@ -190,6 +191,7 @@ class BotoApiGatewayTestCaseBase(TestCase, 
LoaderModuleMockMixin):
+         self.addCleanup(delattr, self, "utils")
+ 
+ 
++@skipIf(True, "Causes machines to OOM")
+ class BotoApiGatewayTestCaseMixin:
+     def _diff_list_dicts(self, listdict1, listdict2, sortkey):
+         """

diff --git a/app-admin/salt/files/salt-3003-tests.patch 
b/app-admin/salt/files/salt-3003-tests.patch
new file mode 100644
index 00000000000..c3562c5a444
--- /dev/null
+++ b/app-admin/salt/files/salt-3003-tests.patch
@@ -0,0 +1,139 @@
+diff --git a/tests/integration/grains/test_core.py 
b/tests/integration/grains/test_core.py
+index 5f1cf11e24..8affb398ff 100644
+--- a/tests/integration/grains/test_core.py
++++ b/tests/integration/grains/test_core.py
+@@ -21,6 +21,7 @@ def _freebsd_or_openbsd():
+     return salt.utils.platform.is_freebsd() or 
salt.utils.platform.is_openbsd()
+ 
+ 
++@pytest.mark.skip("Tests only should run on FreeBSD and OpenBSD")
+ @pytest.mark.windows_whitelisted
+ class TestGrainsCore(ModuleCase):
+     """
+diff --git a/tests/integration/states/test_x509.py 
b/tests/integration/states/test_x509.py
+index 2321689ef5..574de51e56 100644
+--- a/tests/integration/states/test_x509.py
++++ b/tests/integration/states/test_x509.py
+@@ -468,7 +468,7 @@ c9bcgp7D7xD+TxWWNj4CSXEccJgGr91StV+gFg4ARQ==
+             first_run[key]["changes"]["Certificate"]["New"]["Not After"],
+             "%Y-%m-%d %H:%M:%S",
+         )
+-        self.assertEqual(29, (expiry - datetime.datetime.now()).days)
++        self.assertEqual(30, (expiry - datetime.datetime.now()).days)
+         self.assertTrue(os.path.exists(crtfile), "Certificate was not 
created.")
+ 
+         with salt.utils.files.fopen(crtfile, "r") as first_cert:
+@@ -485,14 +485,14 @@ c9bcgp7D7xD+TxWWNj4CSXEccJgGr91StV+gFg4ARQ==
+             },
+         )
+         self.assertEqual(
+-            "Certificate needs renewal: 29 days remaining but it needs to be 
at least 90",
++            "Certificate needs renewal: 30 days remaining but it needs to be 
at least 90",
+             second_run[key]["changes"]["Status"]["Old"],
+         )
+         expiry = datetime.datetime.strptime(
+             second_run[key]["changes"]["Certificate"]["New"]["Not After"],
+             "%Y-%m-%d %H:%M:%S",
+         )
+-        self.assertEqual(179, (expiry - datetime.datetime.now()).days)
++        self.assertEqual(180, (expiry - datetime.datetime.now()).days)
+         with salt.utils.files.fopen(crtfile, "r") as second_cert:
+             self.assertNotEqual(
+                 cert_contents,
+diff --git a/tests/pytests/unit/modules/test_cmdmod.py 
b/tests/pytests/unit/modules/test_cmdmod.py
+index 5424514160..0564b59593 100644
+--- a/tests/pytests/unit/modules/test_cmdmod.py
++++ b/tests/pytests/unit/modules/test_cmdmod.py
+@@ -438,6 +438,7 @@ def test_run_cwd_doesnt_exist_issue_7154():
+ 
+ @pytest.mark.skip_on_darwin
+ @pytest.mark.skip_on_windows
++@pytest.mark.skip("does not work in sandbox environment")
+ def test_run_cwd_in_combination_with_runas():
+     """
+     cmd.run executes command in the cwd directory
+diff --git a/tests/unit/ext/test_ipaddress.py 
b/tests/unit/ext/test_ipaddress.py
+index 4fd87d1c3f..02585a9e4e 100644
+--- a/tests/unit/ext/test_ipaddress.py
++++ b/tests/unit/ext/test_ipaddress.py
+@@ -2682,6 +2682,7 @@ class IpaddrUnitTest(TestCase):
+             "2001:658:22a:cafe:200::1/::ffff:ffff:ffff:ffff",
+         )
+ 
++    @pytest.mark.skip("_cache no longer present in python3.8+")
+     def testNetworkElementCaching(self):
+         # V4 - make sure we're empty
+         self.assertNotIn("broadcast_address", self.ipv4_network._cache)
+diff --git a/tests/unit/utils/test_parsers.py 
b/tests/unit/utils/test_parsers.py
+index 907c67f477..2429d27641 100644
+--- a/tests/unit/utils/test_parsers.py
++++ b/tests/unit/utils/test_parsers.py
+@@ -5,6 +5,7 @@
+ import os
+ import shutil
+ import tempfile
++import pytest
+ 
+ import salt.config
+ import salt.log.setup as log
+@@ -983,6 +984,7 @@ class SaltRunOptionParserTestCase(ParserBase, TestCase):
+         if os.path.exists(self.log_file):
+             os.unlink(self.log_file)
+ 
++    @pytest.mark.skip("Tries to write to /var")
+     def test_jid_option(self):
+         jid = salt.utils.jid.gen_jid({})
+         args = ["--jid", jid]
+@@ -991,6 +993,7 @@ class SaltRunOptionParserTestCase(ParserBase, TestCase):
+         parser.parse_args(args)
+         assert parser.options.jid == jid
+ 
++    @pytest.mark.skip("Tries to write to /var")
+     def test_jid_option_invalid(self):
+         jid = salt.utils.jid.gen_jid({}) + "A"
+         args = ["--jid", jid]
+@@ -1041,6 +1044,7 @@ class SaltSSHOptionParserTestCase(ParserBase, TestCase):
+         if os.path.exists(self.ssh_log_file):
+             os.unlink(self.ssh_log_file)
+ 
++    @pytest.mark.skip("Tries to write to /var")
+     def test_jid_option(self):
+         jid = salt.utils.jid.gen_jid({})
+         args = ["--jid", jid] + self.args
+@@ -1049,6 +1053,7 @@ class SaltSSHOptionParserTestCase(ParserBase, TestCase):
+         parser.parse_args(args)
+         assert parser.options.jid == jid
+ 
++    @pytest.mark.skip("Tries to write to /var")
+     def test_jid_option_invalid(self):
+         jid = salt.utils.jid.gen_jid({}) + "A"
+         args = ["--jid", jid] + self.args
+diff --git a/tests/unit/utils/test_vt.py b/tests/unit/utils/test_vt.py
+index 87fc6a342c..12d4c6a073 100644
+--- a/tests/unit/utils/test_vt.py
++++ b/tests/unit/utils/test_vt.py
+@@ -20,6 +20,8 @@ import subprocess
+ import sys
+ import time
+ 
++import pytest
++
+ # Import Salt libs
+ import salt.utils
+ import salt.utils.files
+@@ -274,6 +276,7 @@ class VTTestCase(TestCase):
+         salt.utils.platform.is_windows(), "Skip VT tests on windows, due to 
issue 54290"
+     )
+     @fixStdOutErrFileNoIfNeeded
++    @pytest.mark.skip("Does not work in sandbox environment")
+     def test_split_multibyte_characters_unicode(self):
+         """
+             Tests that the vt correctly handles multibyte characters that are
+@@ -341,6 +344,7 @@ class VTTestCase(TestCase):
+         salt.utils.platform.is_windows(), "Skip VT tests on windows, due to 
issue 54290"
+     )
+     @fixStdOutErrFileNoIfNeeded
++    @pytest.mark.skip("Does not work in sandbox environment")
+     def test_split_multibyte_characters_shiftjis(self):
+         """
+             Tests that the vt correctly handles multibyte characters that are

diff --git a/app-admin/salt/salt-3003.ebuild b/app-admin/salt/salt-3003.ebuild
new file mode 100644
index 00000000000..75d91308956
--- /dev/null
+++ b/app-admin/salt/salt-3003.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{7..9} )
+DISTUTILS_USE_SETUPTOOLS=rdepend
+inherit systemd distutils-r1
+
+DESCRIPTION="Salt is a remote execution and configuration manager"
+HOMEPAGE="https://www.saltstack.com/resources/community/
+       https://github.com/saltstack";
+
+if [[ ${PV} == 9999* ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="git://github.com/${PN}stack/${PN}.git"
+       EGIT_BRANCH="develop"
+       SRC_URI=""
+else
+       SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+       KEYWORDS="~amd64 ~arm ~x86"
+fi
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako
+       mongodb neutron nova openssl portage profile redis selinux test raet
+       +zeromq vim-syntax"
+
+RDEPEND="
+       sys-apps/pciutils
+       >=dev-python/distro-1.5[${PYTHON_USEDEP}]
+       dev-python/jinja[${PYTHON_USEDEP}]
+       dev-python/libnacl[${PYTHON_USEDEP}]
+       >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}]
+       >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       dev-python/markupsafe[${PYTHON_USEDEP}]
+       >=dev-python/requests-1.0.0[${PYTHON_USEDEP}]
+       dev-python/setuptools[${PYTHON_USEDEP}]
+       >=dev-python/toml-0.10.2[${PYTHON_USEDEP}]
+       dev-python/watchdog[${PYTHON_USEDEP}]
+       libcloud? ( >=dev-python/libcloud-2.5.0[${PYTHON_USEDEP}] )
+       mako? ( dev-python/mako[${PYTHON_USEDEP}] )
+       ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
+       libvirt? (
+               $(python_gen_cond_dep 
'dev-python/libvirt-python[${PYTHON_USEDEP}]' python3_7)
+       )
+       openssl? (
+               dev-libs/openssl:0=[-bindist]
+               dev-python/pyopenssl[${PYTHON_USEDEP}]
+       )
+       raet? (
+               >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}]
+               >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}]
+               >=dev-python/raet-0.6.0[${PYTHON_USEDEP}]
+       )
+       cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] )
+       cheetah? ( dev-python/cheetah3[${PYTHON_USEDEP}] )
+       mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] )
+       portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
+       keyring? ( dev-python/keyring[${PYTHON_USEDEP}] )
+       redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
+       selinux? ( sec-policy/selinux-salt )
+       nova? (
+               $(python_gen_cond_dep 
'>=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]' python3_7)
+       )
+       neutron? (
+               $(python_gen_cond_dep 
'>=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]' python3_7)
+       )
+       gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] )
+       profile? ( dev-python/yappi[${PYTHON_USEDEP}] )
+       vim-syntax? ( app-vim/salt-vim )
+       zeromq? ( >=dev-python/pyzmq-2.2.0[${PYTHON_USEDEP}] )
+"
+BDEPEND="
+       test? (
+               ${RDEPEND}
+               >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
+               >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}]
+               >=dev-python/mock-2.0.0[${PYTHON_USEDEP}]
+               >=dev-python/moto-0.3.6[${PYTHON_USEDEP}]
+               dev-python/pip[${PYTHON_USEDEP}]
+               dev-python/psutil[${PYTHON_USEDEP}]
+               dev-python/pytest[${PYTHON_USEDEP}]
+               >=dev-python/pytest-salt-factories-0.121.1[${PYTHON_USEDEP}]
+               dev-python/pytest-tempdir[${PYTHON_USEDEP}]
+               dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}]
+               dev-python/pytest-subtests[${PYTHON_USEDEP}]
+               dev-python/flaky[${PYTHON_USEDEP}]
+               dev-python/libcloud[${PYTHON_USEDEP}]
+               >=dev-python/virtualenv-20.0.20[${PYTHON_USEDEP}]
+               !x86? ( >=dev-python/boto3-1.3.15[${PYTHON_USEDEP}] )
+       )"
+
+DOCS=( README.rst AUTHORS )
+
+REQUIRED_USE="|| ( raet zeromq )
+       test? ( cheetah genshi )"
+RESTRICT="!test? ( test ) x86? ( test )"
+
+PATCHES=(
+       "${FILESDIR}/salt-3003-skip-tests-that-oom-machine.patch"
+       "${FILESDIR}/salt-3003-gentoolkit-revdep.patch"
+       "${FILESDIR}/salt-3002-tests.patch"
+       "${FILESDIR}/salt-3003-tests.patch"
+)
+
+python_prepare_all() {
+       # remove tests with external dependencies that may not be available, and
+       # tests that don't work in sandbox
+       rm tests/unit/{test_{zypp_plugins,module_names},utils/test_extend}.py 
|| die
+       rm tests/unit/modules/test_{file,boto_{vpc,secgroup,elb}}.py || die
+       rm tests/unit/states/test_boto_vpc.py || die
+       rm tests/support/gitfs.py tests/unit/runners/test_git_pillar.py || die
+       rm tests/pytests/functional/transport/server/test_req_channel.py || die
+
+       # tests that require network access
+       rm tests/unit/{states,modules}/test_zcbuildout.py || die
+       rm -r tests/integration/cloud || die
+       rm -r tests/kitchen/tests/wordpress/tests || die
+       rm tests/kitchen/test_kitchen.py || die
+
+       # tests require root access
+       rm tests/integration/pillar/test_git_pillar.py || die
+       rm tests/integration/states/test_supervisord.py || die
+       rm tests/pytests/unit/client/test_ssh.py || die
+
+       # make sure pkg_resources doesn't bomb because pycrypto isn't installed
+       # make sure pkg_resources doesn't bomb because pycrypto isn't installed
+       find "${S}" -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d ; 
/pycryptodomex/ d' -i || die
+       # pycryptodome rather than pycryptodomex
+       find "${S}" -name '*.py' -print0 | xargs -0 -- sed -i -e 
's:Cryptodome:Crypto:g' -- || die
+
+       distutils-r1_python_prepare_all
+}
+
+python_prepare() {
+       einfo "Fixing collections.abc warnings for ${EPYTHON}"
+       local abc
+       abc="$("${EPYTHON}" -c 'import collections.abc; print("|".join((c for c 
in dir(collections.abc) if not c.startswith("_"))))')" || die
+       find -name '*.py' -type f -print0 | xargs -0 sed -r -e 
"s:collections\\.(${abc}):collections.abc.\\1:g" -i || die
+}
+
+python_install_all() {
+       local svc
+       USE_SETUPTOOLS=1 distutils-r1_python_install_all
+
+       for svc in minion master syndic api; do
+               newinitd "${FILESDIR}"/${svc}-initd-5 salt-${svc}
+               newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
+               systemd_dounit "${FILESDIR}"/salt-${svc}.service
+       done
+
+       insinto /etc/${PN}
+       doins -r conf/*
+}
+
+python_test() {
+       # testsuite likes lots of files
+       ulimit -n 4096 || die
+
+       # ${T} is too long a path for the tests to work
+       local TMPDIR
+       TMPDIR="$(mktemp --directory --tmpdir=/tmp ${P}-tests-XXXXX)"
+       (
+               export TMPDIR
+               cleanup() { rm -rf "${TMPDIR}" || die; }
+
+               trap cleanup EXIT
+
+               addwrite "${TMPDIR}"
+
+               USE_SETUPTOOLS=1 NO_INTERNET=1 SHELL="/bin/bash" \
+                       "${EPYTHON}" -m pytest -vv \
+                       || die "testing failed with ${EPYTHON}"
+       )
+}
+
+pkg_postinst() {
+       if use python_targets_python3_8; then
+               if use nova; then
+                       ewarn "Salt's nova functionality will not work with 
python3.8 since"
+                       ewarn "dev-python/python-novaclient does not support it 
yet"
+               fi
+               if use neutron; then
+                       ewarn "Salt's neutron functionality will not work with 
python3.8 since"
+                       ewarn "dev-python/python-neutronclient does not support 
it yet"
+               fi
+               if use libvirt; then
+                       ewarn "Salt's libvirt functionality will not work with 
python3.8 since"
+                       ewarn "dev-python/libvirt-python does not support it 
yet"
+               fi
+       fi
+}

Reply via email to