forked from rpms/leapp-repository
128 lines
7.4 KiB
Diff
128 lines
7.4 KiB
Diff
From e530472760f0df186531bf3d17323ee082c7fba8 Mon Sep 17 00:00:00 2001
|
|
From: Tomas Fratrik <tfratrik@redhat.com>
|
|
Date: Mon, 18 Aug 2025 13:12:24 +0200
|
|
Subject: [PATCH 39/55] pylint: enable invalid-envvar-default
|
|
|
|
Jira: RHELMISC-16038
|
|
---
|
|
.pylintrc | 1 -
|
|
.../removeresumeservice/tests/test_removeresumeservice.py | 2 +-
|
|
.../tests/test_scheduleselinuxrelabeling.py | 4 ++--
|
|
.../tests/component_test_selinuxapplycustom.py | 2 +-
|
|
.../tests/component_test_selinuxcontentscanner.py | 2 +-
|
|
.../selinuxprepare/tests/component_test_selinuxprepare.py | 2 +-
|
|
.../setpermissiveselinux/tests/test_setpermissiveselinux.py | 4 ++--
|
|
7 files changed, 8 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/.pylintrc b/.pylintrc
|
|
index d98ab151..7a373e3d 100644
|
|
--- a/.pylintrc
|
|
+++ b/.pylintrc
|
|
@@ -45,7 +45,6 @@ disable=
|
|
too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
|
# new for python3 version of pylint
|
|
unnecessary-pass,
|
|
- invalid-envvar-default, # pylint3 warnings envvar returns str/none by default
|
|
bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
|
super-with-arguments, # required in python 2
|
|
raise-missing-from, # no 'raise from' in python 2
|
|
diff --git a/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py b/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
|
index ea803856..d59ef346 100644
|
|
--- a/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
|
+++ b/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
|
@@ -11,7 +11,7 @@ import pytest
|
|
'under the root user.',
|
|
)
|
|
# TODO make the test not destructive
|
|
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
|
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
|
reason='Test disabled by default because it would modify the system')
|
|
def test_remove_resume_service(current_actor_context):
|
|
service_name = 'leapp_resume.service'
|
|
diff --git a/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py b/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
|
index 595b9985..8603bd97 100644
|
|
--- a/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
|
+++ b/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
|
@@ -9,7 +9,7 @@ from leapp.snactor.fixture import current_actor_context
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
|
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
|
reason='Test disabled by default because it would modify the system',
|
|
)
|
|
def test_schedule_no_relabel(current_actor_context):
|
|
@@ -19,7 +19,7 @@ def test_schedule_no_relabel(current_actor_context):
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
|
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
|
reason='Test disabled by default because it would modify the system',
|
|
)
|
|
def test_schedule_relabel(current_actor_context):
|
|
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
|
index 8a4665c1..aab18e58 100644
|
|
--- a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
|
+++ b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
|
@@ -72,7 +72,7 @@ def destructive_selinux_env():
|
|
"Failed to remove SELinux customizations after testing")
|
|
|
|
|
|
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
|
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
|
reason='Test disabled by default because it would modify the system')
|
|
def test_SELinuxApplyCustom(current_actor_context, destructive_selinux_teardown):
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
|
index faa2e1b0..802e038a 100644
|
|
--- a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
|
+++ b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
|
@@ -76,7 +76,7 @@ def find_semanage_rule(rules, rule):
|
|
return next((r for r in rules if all(word in r for word in rule)), None)
|
|
|
|
|
|
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
|
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "false") in ["False", "false", "0"],
|
|
reason='Test disabled by default because it would modify the system')
|
|
def test_SELinuxContentScanner(current_actor_context, destructive_selinux_env):
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
|
index bad1baa2..d124675a 100644
|
|
--- a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
|
+++ b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
|
@@ -76,7 +76,7 @@ def destructive_selinux_env():
|
|
_run_cmd(semodule_command)
|
|
|
|
|
|
-@pytest.mark.skipif(os.getenv('DESTRUCTIVE_TESTING', False) in [False, '0'],
|
|
+@pytest.mark.skipif(os.getenv('DESTRUCTIVE_TESTING', '0').lower() in ['false', '0'],
|
|
reason='Test disabled by default because it would modify the system')
|
|
def test_SELinuxPrepare(current_actor_context, semodule_lfull_initial, semanage_export_initial,
|
|
destructive_selinux_env):
|
|
diff --git a/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py b/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
|
index efa4e550..9acdf39a 100644
|
|
--- a/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
|
+++ b/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
|
@@ -6,7 +6,7 @@ from leapp.models import SelinuxPermissiveDecision
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
|
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["0", "false"],
|
|
reason='Test disabled by default because it would modify the system')
|
|
def check_permissive_in_conf():
|
|
""" Check if we have set permissive in SElinux conf file """
|
|
@@ -19,7 +19,7 @@ def check_permissive_in_conf():
|
|
|
|
|
|
@pytest.mark.skipif(
|
|
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
|
+ os.getenv("DESTRUCTIVE_TESTING", "false").lower() in ["0", "false"],
|
|
reason='Test disabled by default because it would modify the system')
|
|
def test_set_selinux_permissive(current_actor_context):
|
|
current_actor_context.feed(SelinuxPermissiveDecision(set_permissive=True))
|
|
--
|
|
2.51.1
|
|
|