From 4a9e30bc86f4836b0926ce552454c1e15d23f39d Mon Sep 17 00:00:00 2001 From: Allison Karlitskaya Date: Fri, 26 May 2023 10:57:53 +0200 Subject: [PATCH] all: replace `import parent` with an interpreter line hack We'd like to run our executable python scripts using our new `pywrap` feature as a better way to get their PYTHONPATH setup properly. This script lives in our source tree, at a fixed relative location to each script that we're interested in, but has no absolute system path. The #!interpreter syntax does supports relative paths, but they are resolved relative to the current working directory, not relative to the file in which they appear, which makes this feature pretty useless. There are some tricks we can do to get our designed 'relative' behaviour, though. Something like this works: #!/usr/bin/env -S sh -c '"${0%/*}/pywrap" "$0"' but it causes various file auto-detection schemes (including our own test/static-code) to improperly conclude that this is a shell script, rather than a Python script. (n)vim also gets it wrong for highlighting and linting purposes. Fortunately there's a somewhat longer, but still acceptable version of this we can do in Python: #!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/pywrap", sys.argv) This fits well under our 118 column limit. Note that unlike `sh`, the `-c` option in Python doesn't require the script to be passed as a separate argument, which means we don't need to use the non-POSIX splitting tricks of `/usr/bin/env -S`. Note also: it appears as though our hardcoding of /usr/bin/python3 here might be venv-unfriendly, but it's not: /usr/bin/python3 (which surely exists) is used only for running this one tiny fragment of code. Our pywrap script itself finds python3 in the path. Let's move all of our previous users of `import parent` over to the new approach. We can remove a couple of `parent.py` symlinks we had lying around, as well. We also remove `parent.py` itself, since otherwise vulture complains about it being unused. Subprojects will be forced to adjust on upgrade. Remove a CodeQL exemption that was necessitated by our `import parent` shenanigans. --- .github/codeql-config.yml | 3 --- test/common/lcov.py | 4 +--- test/common/parent.py | 18 ------------------ test/common/run-tests | 12 ++++-------- test/image-prepare | 14 +++++++------- test/verify/check-apps | 3 +-- test/verify/check-bots-api | 3 +-- test/verify/check-connection | 3 +-- test/verify/check-embed | 3 +-- test/verify/check-example | 3 +-- test/verify/check-examples | 3 +-- test/verify/check-kdump | 3 +-- test/verify/check-loopback | 3 +-- test/verify/check-metrics | 3 +-- test/verify/check-networkmanager-basic | 3 +-- test/verify/check-networkmanager-bond | 3 +-- test/verify/check-networkmanager-bridge | 3 +-- test/verify/check-networkmanager-checkpoints | 3 +-- test/verify/check-networkmanager-firewall | 3 +-- test/verify/check-networkmanager-mac | 3 +-- test/verify/check-networkmanager-mtu | 3 +-- test/verify/check-networkmanager-other | 3 +-- test/verify/check-networkmanager-settings | 3 +-- test/verify/check-networkmanager-team | 3 +-- test/verify/check-networkmanager-unmanaged | 3 +-- test/verify/check-networkmanager-vlan | 3 +-- test/verify/check-packagekit | 3 +-- test/verify/check-packages | 3 +-- test/verify/check-pages | 3 +-- test/verify/check-reauthorize | 3 +-- test/verify/check-selinux | 3 +-- test/verify/check-session | 3 +-- test/verify/check-shell-active-pages | 3 +-- test/verify/check-shell-host-switching | 3 +-- test/verify/check-shell-keys | 3 +-- test/verify/check-shell-menu | 3 +-- test/verify/check-shell-multi-machine | 3 +-- test/verify/check-shell-multi-machine-key | 3 +-- test/verify/check-shell-multi-os | 3 +-- test/verify/check-sosreport | 3 +-- test/verify/check-static-login | 3 +-- test/verify/check-storage-basic | 3 +-- test/verify/check-storage-format | 3 +-- test/verify/check-storage-hidden | 3 +-- test/verify/check-storage-ignored | 3 +-- test/verify/check-storage-iscsi | 3 +-- test/verify/check-storage-luks | 3 +-- test/verify/check-storage-lvm2 | 3 +-- test/verify/check-storage-mdraid | 3 +-- test/verify/check-storage-mounting | 3 +-- test/verify/check-storage-msdos | 3 +-- test/verify/check-storage-multipath | 3 +-- test/verify/check-storage-nfs | 3 +-- test/verify/check-storage-partitions | 3 +-- test/verify/check-storage-raid1 | 3 +-- test/verify/check-storage-resize | 3 +-- test/verify/check-storage-scaling | 3 +-- test/verify/check-storage-stratis | 3 +-- test/verify/check-storage-swap | 3 +-- test/verify/check-storage-unused | 3 +-- test/verify/check-storage-used | 3 +-- test/verify/check-storage-vdo | 3 +-- test/verify/check-superuser | 3 +-- test/verify/check-system-info | 3 +-- test/verify/check-system-journal | 3 +-- test/verify/check-system-realms | 3 +-- test/verify/check-system-services | 3 +-- test/verify/check-system-shutdown-restart | 3 +-- test/verify/check-system-terminal | 3 +-- test/verify/check-system-tuned | 3 +-- test/verify/check-testlib | 3 +-- test/verify/check-users | 3 +-- test/verify/check-users-roles | 3 +-- test/verify/check-ws-bastion | 3 +-- test/verify/parent.py | 1 - tools/parent.py | 1 - tools/urls-check | 8 ++++---- 77 files changed, 85 insertions(+), 183 deletions(-) delete mode 100644 test/common/parent.py delete mode 120000 test/verify/parent.py delete mode 120000 tools/parent.py diff --git a/.github/codeql-config.yml b/.github/codeql-config.yml index d2ac37de5..30d8063a1 100644 --- a/.github/codeql-config.yml +++ b/.github/codeql-config.yml @@ -1,7 +1,4 @@ query-filters: - - exclude: - # complains about `import parent` in tests; unused imports already handled by flake8 - id: py/unused-import - exclude: # complains about `...` method bodies and `await`, i.e. mostly false positives id: py/ineffectual-statement diff --git a/test/common/lcov.py b/test/common/lcov.py index 45c91f36b..3fba6c3e2 100755 --- a/test/common/lcov.py +++ b/test/common/lcov.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/pywrap", sys.argv) # This file is part of Cockpit. # @@ -32,8 +32,6 @@ import subprocess import sys from bisect import bisect_left -import parent # NOQA: imported through a custom PYTHONPATH - from task import github BASE_DIR = os.path.realpath(f'{__file__}/../../..') diff --git a/test/common/parent.py b/test/common/parent.py deleted file mode 100644 index ed3ed71ff..000000000 --- a/test/common/parent.py +++ /dev/null @@ -1,18 +0,0 @@ -import importlib -import os -import subprocess -import sys - -BASE_DIR = os.path.realpath(f'{__file__}/../../..') -TEST_DIR = f'{BASE_DIR}/test' -BOTS_DIR = f'{BASE_DIR}/bots' - -sys.path.append(BOTS_DIR) -sys.path.append(f'{TEST_DIR}/common') -sys.path.append(f'{BOTS_DIR}/machine') - - -def ensure_bots(): - if not os.path.isdir(BOTS_DIR): - subprocess.check_call([f'{BASE_DIR}/test/common/make-bots']) - importlib.invalidate_caches() diff --git a/test/common/run-tests b/test/common/run-tests index 683b9efa4..a83cdf840 100755 --- a/test/common/run-tests +++ b/test/common/run-tests @@ -1,4 +1,4 @@ -#!/usr/bin/python3 -B +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/pywrap", sys.argv) import argparse import binascii @@ -17,15 +17,11 @@ import time import unittest from typing import List, Optional, Tuple -import parent +import testlib -parent.ensure_bots() # OQA: testvm lives in bots/ +import testvm -import testlib # noqa: E402, imported through parent.py - -import testvm # noqa: E402, imported through parent.py - -from lcov import create_coverage_report, prepare_for_code_coverage # NOQA: E402 +from lcov import create_coverage_report, prepare_for_code_coverage os.environ['PYTHONUNBUFFERED'] = '1' diff --git a/test/image-prepare b/test/image-prepare index d9cb82eb9..0c86083d6 100755 --- a/test/image-prepare +++ b/test/image-prepare @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/common/pywrap", sys.argv) # Build and run a bots/image-customize command to prepare a VM for testing Cockpit. # This file is part of Cockpit. @@ -25,13 +25,13 @@ import shutil import subprocess import sys -from common.parent import BASE_DIR, BOTS_DIR, TEST_DIR, ensure_bots +from lib import testmap +from lib.constants import DEFAULT_IMAGE +from machine.machine_core import machine_virtual -ensure_bots() # : testvm lives in bots/ - -from lib import testmap # NOQA: imported through parent.py -from lib.constants import DEFAULT_IMAGE # NOQA: imported through parent.py -from machine.machine_core import machine_virtual # NOQA: imported through parent.py +BASE_DIR = os.path.realpath(f'{__file__}/../..') +TEST_DIR = f'{BASE_DIR}/test' +BOTS_DIR = f'{BASE_DIR}/bots' def build_rpms(dist_tar, image, verbose, quick): diff --git a/test/verify/check-apps b/test/verify/check-apps index df1116127..3f27bdf5d 100755 --- a/test/verify/check-apps +++ b/test/verify/check-apps @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from packagelib import PackageCase from testlib import nondestructive, skipImage, skipOstree, test_main diff --git a/test/verify/check-bots-api b/test/verify/check-bots-api index bd9b13a9f..05d385479 100755 --- a/test/verify/check-bots-api +++ b/test/verify/check-bots-api @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -25,7 +25,6 @@ import tempfile import unittest from glob import glob -import parent # noqa: F401 from testlib import skipDistroPackage, test_main import testvm diff --git a/test/verify/check-connection b/test/verify/check-connection index c618866c5..2f065c95b 100755 --- a/test/verify/check-connection +++ b/test/verify/check-connection @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -22,7 +22,6 @@ import os import subprocess import time -import parent # noqa: F401 from testlib import ( TEST_DIR, MachineCase, diff --git a/test/verify/check-embed b/test/verify/check-embed index eb161d4f3..f21eb9136 100755 --- a/test/verify/check-embed +++ b/test/verify/check-embed @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#! /usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import subprocess -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipBrowser, skipDistroPackage, test_main diff --git a/test/verify/check-example b/test/verify/check-example index f462b23e6..b46b9a701 100755 --- a/test/verify/check-example +++ b/test/verify/check-example @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -22,7 +22,6 @@ import sys import time import unittest -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, test_main, todo diff --git a/test/verify/check-examples b/test/verify/check-examples index fdda442fa..49f6c4c01 100755 --- a/test/verify/check-examples +++ b/test/verify/check-examples @@ -1,8 +1,7 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) import os -import parent # noqa: F401 from testlib import TEST_DIR, MachineCase, nondestructive, skipDistroPackage, skipOstree, test_main EXAMPLES_DIR = os.path.join(os.path.dirname(TEST_DIR), "examples") diff --git a/test/verify/check-kdump b/test/verify/check-kdump index 172d8cb8b..1bf0c7704 100755 --- a/test/verify/check-kdump +++ b/test/verify/check-kdump @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, skipImage, skipOstree, test_main, timeout from lib.constants import TEST_OS_DEFAULT diff --git a/test/verify/check-loopback b/test/verify/check-loopback index 68b9ecd3a..71c174827 100755 --- a/test/verify/check-loopback +++ b/test/verify/check-loopback @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, skipOstree, test_main diff --git a/test/verify/check-metrics b/test/verify/check-metrics index 1577c930d..0c350e5c1 100755 --- a/test/verify/check-metrics +++ b/test/verify/check-metrics @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # Run this with --help to see available options for tracing and debugging # See https://github.com/cockpit-project/cockpit/blob/main/test/common/testlib.py # "class Browser" and "class MachineCase" for the available API. @@ -7,7 +7,6 @@ import re import time # import Cockpit's machinery for test VMs and its browser test API -import parent # noqa: F401 import packagelib from testlib import ( Browser, diff --git a/test/verify/check-networkmanager-basic b/test/verify/check-networkmanager-basic index 808808b7f..a830261e9 100755 --- a/test/verify/check-networkmanager-basic +++ b/test/verify/check-networkmanager-basic @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from netlib import NetworkCase from testlib import nondestructive, skipDistroPackage, test_main, wait diff --git a/test/verify/check-networkmanager-bond b/test/verify/check-networkmanager-bond index d6f2faa6f..2a9ac7c0c 100755 --- a/test/verify/check-networkmanager-bond +++ b/test/verify/check-networkmanager-bond @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from netlib import NetworkCase from testlib import nondestructive, skipDistroPackage, skipImage, skipOstree, test_main, wait diff --git a/test/verify/check-networkmanager-bridge b/test/verify/check-networkmanager-bridge index a1f199b06..a7d85b134 100755 --- a/test/verify/check-networkmanager-bridge +++ b/test/verify/check-networkmanager-bridge @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from netlib import NetworkCase from testlib import nondestructive, skipDistroPackage, test_main diff --git a/test/verify/check-networkmanager-checkpoints b/test/verify/check-networkmanager-checkpoints index ebedfbdd9..821fc7869 100755 --- a/test/verify/check-networkmanager-checkpoints +++ b/test/verify/check-networkmanager-checkpoints @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from netlib import NetworkCase, re from testlib import skipDistroPackage, skipImage, skipOstree, test_main, wait diff --git a/test/verify/check-networkmanager-firewall b/test/verify/check-networkmanager-firewall index 559c65665..efcfe48c5 100755 --- a/test/verify/check-networkmanager-firewall +++ b/test/verify/check-networkmanager-firewall @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import time -import parent # noqa: F401 from netlib import NetworkCase from testlib import Error, nondestructive, skipDistroPackage, skipOstree, test_main, wait diff --git a/test/verify/check-networkmanager-mac b/test/verify/check-networkmanager-mac index df6cd052f..998dd631f 100755 --- a/test/verify/check-networkmanager-mac +++ b/test/verify/check-networkmanager-mac @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from netlib import NetworkCase from testlib import skipDistroPackage, test_main diff --git a/test/verify/check-networkmanager-mtu b/test/verify/check-networkmanager-mtu index 800d28faf..f000794bb 100755 --- a/test/verify/check-networkmanager-mtu +++ b/test/verify/check-networkmanager-mtu @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from netlib import NetworkCase from testlib import skipDistroPackage, test_main, wait diff --git a/test/verify/check-networkmanager-other b/test/verify/check-networkmanager-other index 3f39bcf5c..17825af24 100755 --- a/test/verify/check-networkmanager-other +++ b/test/verify/check-networkmanager-other @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from netlib import NetworkCase from testlib import nondestructive, skipDistroPackage, test_main, wait diff --git a/test/verify/check-networkmanager-settings b/test/verify/check-networkmanager-settings index 70109a731..0c244554b 100755 --- a/test/verify/check-networkmanager-settings +++ b/test/verify/check-networkmanager-settings @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from netlib import NetworkCase from testlib import skipDistroPackage, test_main, wait diff --git a/test/verify/check-networkmanager-team b/test/verify/check-networkmanager-team index dee237976..b75905a66 100755 --- a/test/verify/check-networkmanager-team +++ b/test/verify/check-networkmanager-team @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import json -import parent # noqa: F401 from netlib import NetworkCase from testlib import nondestructive, skipDistroPackage, skipImage, skipOstree, test_main diff --git a/test/verify/check-networkmanager-unmanaged b/test/verify/check-networkmanager-unmanaged index 6796074af..bdba606d1 100755 --- a/test/verify/check-networkmanager-unmanaged +++ b/test/verify/check-networkmanager-unmanaged @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from netlib import NetworkCase from testlib import skipDistroPackage, test_main diff --git a/test/verify/check-networkmanager-vlan b/test/verify/check-networkmanager-vlan index 394312a0c..f45f67136 100755 --- a/test/verify/check-networkmanager-vlan +++ b/test/verify/check-networkmanager-vlan @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from netlib import NetworkCase from testlib import nondestructive, skipDistroPackage, test_main diff --git a/test/verify/check-packagekit b/test/verify/check-packagekit index 1d5a71584..7ccef145a 100755 --- a/test/verify/check-packagekit +++ b/test/verify/check-packagekit @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -21,7 +21,6 @@ import os import re import time -import parent # noqa: F401 from packagelib import PackageCase from testlib import nondestructive, onlyImage, skipDistroPackage, skipImage, skipOstree, test_main diff --git a/test/verify/check-packages b/test/verify/check-packages index d5e19c51b..a32a66e06 100755 --- a/test/verify/check-packages +++ b/test/verify/check-packages @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, test_main test_manifest = """ diff --git a/test/verify/check-pages b/test/verify/check-pages index 926e5ba87..14cbb56af 100755 --- a/test/verify/check-pages +++ b/test/verify/check-pages @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -20,7 +20,6 @@ import os import time -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, skipOstree, test_main RHEL_DOC_BASE = "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_systems_using_the_rhel_8_web_console" diff --git a/test/verify/check-reauthorize b/test/verify/check-reauthorize index 09d090e0b..8fb0f5119 100755 --- a/test/verify/check-reauthorize +++ b/test/verify/check-reauthorize @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, skipOstree, test_main diff --git a/test/verify/check-selinux b/test/verify/check-selinux index 940827c60..60f17c2a3 100755 --- a/test/verify/check-selinux +++ b/test/verify/check-selinux @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import time -import parent # noqa: F401 from testlib import ( Error, MachineCase, diff --git a/test/verify/check-session b/test/verify/check-session index 4efb5b86d..826ca8976 100755 --- a/test/verify/check-session +++ b/test/verify/check-session @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, test_main, wait diff --git a/test/verify/check-shell-active-pages b/test/verify/check-shell-active-pages index db15f3ee0..c93bba06f 100755 --- a/test/verify/check-shell-active-pages +++ b/test/verify/check-shell-active-pages @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, test_main diff --git a/test/verify/check-shell-host-switching b/test/verify/check-shell-host-switching index 366a267ab..6351ad52d 100755 --- a/test/verify/check-shell-host-switching +++ b/test/verify/check-shell-host-switching @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import time -import parent # noqa: F401 from testlib import MachineCase, no_retry_when_changed, skipDistroPackage, test_main, todoPybridgeRHEL8 diff --git a/test/verify/check-shell-keys b/test/verify/check-shell-keys index c102457bb..061087a17 100755 --- a/test/verify/check-shell-keys +++ b/test/verify/check-shell-keys @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipBrowser, skipDistroPackage, test_main FP_SHA256 = "SHA256:iyVAl4Z8riL9Jg4fV9Wv/6cbqebdDtsBEMkojNLLYX8" diff --git a/test/verify/check-shell-menu b/test/verify/check-shell-menu index 1a5f04d4f..8c80b27de 100755 --- a/test/verify/check-shell-menu +++ b/test/verify/check-shell-menu @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import time -import parent # noqa: F401 from testlib import MachineCase, enableAxe, nondestructive, skipDistroPackage, test_main diff --git a/test/verify/check-shell-multi-machine b/test/verify/check-shell-multi-machine index 70b094451..3fd6c457d 100755 --- a/test/verify/check-shell-multi-machine +++ b/test/verify/check-shell-multi-machine @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -21,7 +21,6 @@ import re import subprocess import time -import parent # noqa: F401 from testlib import MachineCase, skipDistroPackage, skipImage, test_main, todoPybridge, todoPybridgeRHEL8 diff --git a/test/verify/check-shell-multi-machine-key b/test/verify/check-shell-multi-machine-key index 964175c9b..8ea8a60bd 100755 --- a/test/verify/check-shell-multi-machine-key +++ b/test/verify/check-shell-multi-machine-key @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -20,7 +20,6 @@ import re import subprocess -import parent # noqa: F401 from testlib import ( MachineCase, skipBrowser, diff --git a/test/verify/check-shell-multi-os b/test/verify/check-shell-multi-os index a86d0bc6f..fe41c5b34 100755 --- a/test/verify/check-shell-multi-os +++ b/test/verify/check-shell-multi-os @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, skipDistroPackage, test_main, todoPybridgeRHEL8, wait diff --git a/test/verify/check-sosreport b/test/verify/check-sosreport index 12318a6c9..72cb86a87 100755 --- a/test/verify/check-sosreport +++ b/test/verify/check-sosreport @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -22,7 +22,6 @@ import os.path import subprocess import tarfile -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, skipImage, skipOstree, test_main, wait diff --git a/test/verify/check-static-login b/test/verify/check-static-login index 0910c4fbe..59d94a896 100755 --- a/test/verify/check-static-login +++ b/test/verify/check-static-login @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -22,7 +22,6 @@ import re import subprocess import time -import parent # noqa: F401 from testlib import ( MachineCase, nondestructive, diff --git a/test/verify/check-storage-basic b/test/verify/check-storage-basic index b830a7c63..91c25c039 100755 --- a/test/verify/check-storage-basic +++ b/test/verify/check-storage-basic @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import nondestructive, test_main, wait diff --git a/test/verify/check-storage-format b/test/verify/check-storage-format index 7ab0b540c..1caaecf44 100755 --- a/test/verify/check-storage-format +++ b/test/verify/check-storage-format @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import test_main diff --git a/test/verify/check-storage-hidden b/test/verify/check-storage-hidden index 8d0cf0978..3229a6227 100755 --- a/test/verify/check-storage-hidden +++ b/test/verify/check-storage-hidden @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase, json from testlib import nondestructive, onlyImage, test_main diff --git a/test/verify/check-storage-ignored b/test/verify/check-storage-ignored index a82f909df..827fe5b9c 100755 --- a/test/verify/check-storage-ignored +++ b/test/verify/check-storage-ignored @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import nondestructive, test_main diff --git a/test/verify/check-storage-iscsi b/test/verify/check-storage-iscsi index 2281012ce..9f72284b7 100755 --- a/test/verify/check-storage-iscsi +++ b/test/verify/check-storage-iscsi @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import skipImage, test_main diff --git a/test/verify/check-storage-luks b/test/verify/check-storage-luks index 2bed254bc..61b6676c5 100755 --- a/test/verify/check-storage-luks +++ b/test/verify/check-storage-luks @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import subprocess -import parent # noqa: F401 from packagelib import PackageCase from storagelib import StorageCase from testlib import attach, skipImage, test_main, timeout, wait diff --git a/test/verify/check-storage-lvm2 b/test/verify/check-storage-lvm2 index eb0577da7..9c6e10f98 100755 --- a/test/verify/check-storage-lvm2 +++ b/test/verify/check-storage-lvm2 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import nondestructive, test_main diff --git a/test/verify/check-storage-mdraid b/test/verify/check-storage-mdraid index 5674f2e25..091b556df 100755 --- a/test/verify/check-storage-mdraid +++ b/test/verify/check-storage-mdraid @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ from time import sleep -import parent # noqa: F401 from storagelib import StorageCase from testlib import Error, test_main diff --git a/test/verify/check-storage-mounting b/test/verify/check-storage-mounting index 0af50b1f3..0077d8f44 100755 --- a/test/verify/check-storage-mounting +++ b/test/verify/check-storage-mounting @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import test_main diff --git a/test/verify/check-storage-msdos b/test/verify/check-storage-msdos index 3737ddd1f..b406cc966 100755 --- a/test/verify/check-storage-msdos +++ b/test/verify/check-storage-msdos @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import test_main diff --git a/test/verify/check-storage-multipath b/test/verify/check-storage-multipath index d6241a5f2..5704b9e9f 100755 --- a/test/verify/check-storage-multipath +++ b/test/verify/check-storage-multipath @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import skipImage, test_main diff --git a/test/verify/check-storage-nfs b/test/verify/check-storage-nfs index f4efed462..6a517eecc 100755 --- a/test/verify/check-storage-nfs +++ b/test/verify/check-storage-nfs @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from packagelib import PackageCase from storagelib import StorageCase, StorageHelpers from testlib import nondestructive, skipOstree, test_main diff --git a/test/verify/check-storage-partitions b/test/verify/check-storage-partitions index 0198ca45e..33d69a077 100755 --- a/test/verify/check-storage-partitions +++ b/test/verify/check-storage-partitions @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import nondestructive, skipMobile, test_main, wait diff --git a/test/verify/check-storage-raid1 b/test/verify/check-storage-raid1 index 229c9418e..736e29d8a 100755 --- a/test/verify/check-storage-raid1 +++ b/test/verify/check-storage-raid1 @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import test_main diff --git a/test/verify/check-storage-resize b/test/verify/check-storage-resize index 46c904d5c..3e9148b79 100755 --- a/test/verify/check-storage-resize +++ b/test/verify/check-storage-resize @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import unittest -import parent # noqa: F401 from storagelib import StorageCase from testlib import skipImage, test_main diff --git a/test/verify/check-storage-scaling b/test/verify/check-storage-scaling index 0dfa3c991..bb2f7356a 100755 --- a/test/verify/check-storage-scaling +++ b/test/verify/check-storage-scaling @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import test_main diff --git a/test/verify/check-storage-stratis b/test/verify/check-storage-stratis index 65489bb25..2121eb6a4 100755 --- a/test/verify/check-storage-stratis +++ b/test/verify/check-storage-stratis @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from packagelib import PackageCase from storagelib import StorageCase from testlib import skipImage, test_main diff --git a/test/verify/check-storage-swap b/test/verify/check-storage-swap index 3c33212aa..9c7ab50f4 100755 --- a/test/verify/check-storage-swap +++ b/test/verify/check-storage-swap @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import nondestructive, onlyImage, test_main diff --git a/test/verify/check-storage-unused b/test/verify/check-storage-unused index 6cc93548a..c4b275c22 100755 --- a/test/verify/check-storage-unused +++ b/test/verify/check-storage-unused @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import test_main diff --git a/test/verify/check-storage-used b/test/verify/check-storage-used index beb9a6366..c69967278 100755 --- a/test/verify/check-storage-used +++ b/test/verify/check-storage-used @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from storagelib import StorageCase from testlib import nondestructive, test_main diff --git a/test/verify/check-storage-vdo b/test/verify/check-storage-vdo index 0d7017898..1ae2362ea 100755 --- a/test/verify/check-storage-vdo +++ b/test/verify/check-storage-vdo @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import re -import parent # noqa: F401 from packagelib import PackageCase from storagelib import StorageCase, StorageHelpers from testlib import onlyImage, test_main diff --git a/test/verify/check-superuser b/test/verify/check-superuser index 72a84a35e..04451a698 100755 --- a/test/verify/check-superuser +++ b/test/verify/check-superuser @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import time -import parent # noqa: F401 from testlib import ( MachineCase, nondestructive, diff --git a/test/verify/check-system-info b/test/verify/check-system-info index 3e3ab5609..c55df3fea 100755 --- a/test/verify/check-system-info +++ b/test/verify/check-system-info @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -20,7 +20,6 @@ import re import time -import parent # noqa: F401 from packagelib import PackageCase from testlib import enableAxe, nondestructive, onlyImage, skipDistroPackage, skipImage, skipOstree, test_main, wait diff --git a/test/verify/check-system-journal b/test/verify/check-system-journal index 4399625b3..3d4ee75af 100755 --- a/test/verify/check-system-journal +++ b/test/verify/check-system-journal @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import time -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, skipImage, test_main sleep_crash_list_sel = "#journal-box .cockpit-logline .cockpit-log-message:contains('(sleep) crashed in')" diff --git a/test/verify/check-system-realms b/test/verify/check-system-realms index 787dbacd7..f58a1818a 100755 --- a/test/verify/check-system-realms +++ b/test/verify/check-system-realms @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -24,7 +24,6 @@ import re import struct import time -import parent # noqa: F401 import packagelib from testlib import ( Error, diff --git a/test/verify/check-system-services b/test/verify/check-system-services index 7443bf427..aed267feb 100755 --- a/test/verify/check-system-services +++ b/test/verify/check-system-services @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -19,7 +19,6 @@ import time -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, test_main, wait import testvm diff --git a/test/verify/check-system-shutdown-restart b/test/verify/check-system-shutdown-restart index fe4a0f754..06af46e7e 100755 --- a/test/verify/check-system-shutdown-restart +++ b/test/verify/check-system-shutdown-restart @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, skipDistroPackage, test_main, todoPybridgeRHEL8 diff --git a/test/verify/check-system-terminal b/test/verify/check-system-terminal index 2988c4884..eaaab71c5 100755 --- a/test/verify/check-system-terminal +++ b/test/verify/check-system-terminal @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipBrowser, skipDistroPackage, test_main diff --git a/test/verify/check-system-tuned b/test/verify/check-system-tuned index 1ed270b09..1eee875c7 100755 --- a/test/verify/check-system-tuned +++ b/test/verify/check-system-tuned @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, skipImage, skipOstree, test_main diff --git a/test/verify/check-testlib b/test/verify/check-testlib index 2bae71edc..4b2d7ecea 100755 --- a/test/verify/check-testlib +++ b/test/verify/check-testlib @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -22,7 +22,6 @@ import re import subprocess import unittest -import parent # noqa: F401 from testlib import TEST_DIR, MachineCase, no_retry_when_changed, nondestructive, skipDistroPackage, test_main dirname = os.path.dirname(__file__) diff --git a/test/verify/check-users b/test/verify/check-users index 7ec36c3e0..b482311d3 100755 --- a/test/verify/check-users +++ b/test/verify/check-users @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -20,7 +20,6 @@ import datetime import os -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, skipOstree, test_main, wait good_password = "tqymuVh.ZfZnP§9Wr=LM3JyG5yx" diff --git a/test/verify/check-users-roles b/test/verify/check-users-roles index 88fd1a253..da3e0911a 100755 --- a/test/verify/check-users-roles +++ b/test/verify/check-users-roles @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, skipDistroPackage, test_main diff --git a/test/verify/check-ws-bastion b/test/verify/check-ws-bastion index abf0aa020..e972c46be 100755 --- a/test/verify/check-ws-bastion +++ b/test/verify/check-ws-bastion @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,7 +17,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -import parent # noqa: F401 from testlib import MachineCase, nondestructive, onlyImage, test_main HOST = "host.containers.internal" diff --git a/test/verify/parent.py b/test/verify/parent.py deleted file mode 120000 index 679efd4e2..000000000 --- a/test/verify/parent.py +++ /dev/null @@ -1 +0,0 @@ -../common/parent.py \ No newline at end of file diff --git a/tools/parent.py b/tools/parent.py deleted file mode 120000 index 042076300..000000000 --- a/tools/parent.py +++ /dev/null @@ -1 +0,0 @@ -../test/common/parent.py \ No newline at end of file diff --git a/tools/urls-check b/tools/urls-check index 8b1a544d5..bbd6664cc 100755 --- a/tools/urls-check +++ b/tools/urls-check @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/python3 -cimport os, sys; os.execv(os.path.dirname(sys.argv[1]) + "/../test/common/pywrap", sys.argv) # This file is part of Cockpit. # @@ -17,10 +17,9 @@ # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . -# ruff: noqa: I001 - import argparse import fnmatch +import os import subprocess import sys import time @@ -28,9 +27,10 @@ import urllib import urllib.parse from urllib.request import Request, urlopen -from parent import BASE_DIR import task +BASE_DIR = os.path.realpath(f'{__file__}/../..') + DAYS = 7 TASK_NAME = "Validate all URLs"