commit: 3db3c517d7e7635f3507f1e7f921dcc9fdd33c9a
Author: David Palao <david.palao <AT> gmail <DOT> com>
AuthorDate: Mon May 1 09:18:48 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 26 15:44:36 2023 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3db3c517
tests: process: order of skipif conditions changed
...to agree with the original, checking if:
1. system is not Linux
2. ping is missing
3. portage.process._unshare_validate returns error
Signed-off-by: David Palao <david.palao <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
lib/portage/tests/process/test_unshare_net.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/portage/tests/process/test_unshare_net.py
b/lib/portage/tests/process/test_unshare_net.py
index 4c70465f8..7910e1553 100644
--- a/lib/portage/tests/process/test_unshare_net.py
+++ b/lib/portage/tests/process/test_unshare_net.py
@@ -13,7 +13,6 @@ from portage.tests import TestCase
CLONE_NEWNET = 0x40000000
-
UNSHARE_NET_TEST_SCRIPT = """
ping -c 1 -W 1 127.0.0.1 || exit 1
ping -c 1 -W 1 10.0.0.1 || exit 1
@@ -21,19 +20,18 @@ ping -c 1 -W 1 10.0.0.1 || exit 1
ping -c 1 -W 1 ::1 || exit 1
ping -c 1 -W 1 fd::1 || exit 1
"""
-
ABILITY_TO_UNSHARE = portage.process._unshare_validate(CLONE_NEWNET)
class UnshareNetTestCase(TestCase):
- @pytest.mark.skipif(platform.system() != "Linux", reason="not Linux")
- @pytest.mark.skipif(
- portage.process.find_binary("ping") is None, reason="ping not found"
- )
@pytest.mark.skipif(
ABILITY_TO_UNSHARE != 0,
reason=f"Unable to unshare: {errno.errorcode.get(ABILITY_TO_UNSHARE,
'?')}",
)
+ @pytest.mark.skipif(
+ portage.process.find_binary("ping") is None, reason="ping not found"
+ )
+ @pytest.mark.skipif(platform.system() != "Linux", reason="not Linux")
def testUnshareNet(self):
env = os.environ.copy()
env["IPV6"] = "1" if portage.process._has_ipv6() else ""