From fddc73776cc22b3ca5fa3bc287be8e883a1cfe56 Mon Sep 17 00:00:00 2001 From: Fiona Klute Date: Mon, 8 Apr 2024 01:34:06 +0200 Subject: [PATCH] Remove executable bit & shebang where not needed This ensures scripts aren't accidentally called like binaries instead of through the interpreter, minimizing the amount of locations where a different interpreter location might cause issues. --- test/apache-conf/required-modules.py | 10 ++++------ test/check_test_ips.py | 2 -- test/doctest-mgstest.py | 1 - test/meson.build | 4 ++-- test/mgstest/__init__.py | 4 +--- test/mgstest/http.py | 4 +--- test/mgstest/ocsp.py | 2 -- test/mgstest/tests.py | 4 +--- test/runtest.py | 5 +---- test/softhsm-init.py | 3 --- test/tests/24_pkcs11_cert/hooks.py | 1 - test/unittest-mgstest.py | 1 - 12 files changed, 10 insertions(+), 31 deletions(-) mode change 100755 => 100644 test/doctest-mgstest.py mode change 100755 => 100644 test/runtest.py mode change 100755 => 100644 test/softhsm-init.py mode change 100755 => 100644 test/unittest-mgstest.py diff --git a/test/apache-conf/required-modules.py b/test/apache-conf/required-modules.py index 4e6aaac..ca1567e 100644 --- a/test/apache-conf/required-modules.py +++ b/test/apache-conf/required-modules.py @@ -1,4 +1,3 @@ -#!/usr/bin/python3 import os import re import subprocess @@ -14,8 +13,7 @@ built_in_modules = set() mod_re = re.compile(r'^\s+mod_(\w+)\.c') for line in result.stdout.splitlines(): - m = mod_re.match(line) - if m: + if (m := mod_re.match(line)): built_in_modules.add(m.group(1)) for mod in (required_modules - built_in_modules): @@ -25,7 +23,7 @@ mpm_choices = ['event', 'worker'] mod_dir = Path(os.environ['AP_LIBEXECDIR']) for mpm in mpm_choices: - mod = mod_dir.joinpath(f'mod_mpm_{mpm}.so') - if mod.exists(): - print(f'LoadModule\tmpm_{mpm}_module\t{mod!s}') + mod_lib = mod_dir / f'mod_mpm_{mpm}.so' + if mod_lib.exists(): + print(f'LoadModule\tmpm_{mpm}_module\t{mod_lib!s}') break diff --git a/test/check_test_ips.py b/test/check_test_ips.py index 704d609..5097ab5 100644 --- a/test/check_test_ips.py +++ b/test/check_test_ips.py @@ -1,5 +1,3 @@ -#!/usr/bin/python3 - # Copyright 2020 Fiona Klute # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/doctest-mgstest.py b/test/doctest-mgstest.py old mode 100755 new mode 100644 index f83aa39..1a217f3 --- a/test/doctest-mgstest.py +++ b/test/doctest-mgstest.py @@ -1,4 +1,3 @@ -#!/usr/bin/python3 import doctest import importlib import mgstest diff --git a/test/meson.build b/test/meson.build index 2f339b5..eab115a 100644 --- a/test/meson.build +++ b/test/meson.build @@ -144,11 +144,11 @@ test('integration', python, args: [tap_py], verbose: true, depends: [test_pki, test_dirs, mod_gnutls, listen_conf, modules_conf]) -test('doctest', doctest, +test('doctest', python, args: [doctest], env: env, depends: [test_pki, mod_gnutls]) -test('unittest', unittest, +test('unittest', python, args: [unittest], env: env, depends: [test_pki, mod_gnutls]) diff --git a/test/mgstest/__init__.py b/test/mgstest/__init__.py index d878994..35aba9b 100644 --- a/test/mgstest/__init__.py +++ b/test/mgstest/__init__.py @@ -1,6 +1,4 @@ -#!/usr/bin/python3 - -# Copyright 2019-2020 Fiona Klute +# Copyright 2019-2024 Fiona Klute # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/mgstest/http.py b/test/mgstest/http.py index f970720..da688ad 100644 --- a/test/mgstest/http.py +++ b/test/mgstest/http.py @@ -1,6 +1,4 @@ -#!/usr/bin/python3 - -# Copyright 2019-2020 Fiona Klute +# Copyright 2019-2024 Fiona Klute # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/mgstest/ocsp.py b/test/mgstest/ocsp.py index ccb34e6..133b3fa 100644 --- a/test/mgstest/ocsp.py +++ b/test/mgstest/ocsp.py @@ -1,5 +1,3 @@ -#!/usr/bin/python3 - # Copyright 2020 Krista Karppinen # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/mgstest/tests.py b/test/mgstest/tests.py index 3f8521d..0507eb9 100644 --- a/test/mgstest/tests.py +++ b/test/mgstest/tests.py @@ -1,6 +1,4 @@ -#!/usr/bin/python3 - -# Copyright 2019-2020 Fiona Klute +# Copyright 2019-2024 Fiona Klute # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/runtest.py b/test/runtest.py old mode 100755 new mode 100644 index 5adfa14..a5c2f50 --- a/test/runtest.py +++ b/test/runtest.py @@ -1,7 +1,4 @@ -#!/usr/bin/python3 -# PYTHON_ARGCOMPLETE_OK - -# Copyright 2019-2020 Fiona Klute +# Copyright 2019-2024 Fiona Klute # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/softhsm-init.py b/test/softhsm-init.py old mode 100755 new mode 100644 index 7192843..b28b0bf --- a/test/softhsm-init.py +++ b/test/softhsm-init.py @@ -1,6 +1,3 @@ -#!/usr/bin/python3 -# PYTHON_ARGCOMPLETE_OK - # Copyright 2020 Fiona Klute # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test/tests/24_pkcs11_cert/hooks.py b/test/tests/24_pkcs11_cert/hooks.py index 4dafdac..55f15e0 100644 --- a/test/tests/24_pkcs11_cert/hooks.py +++ b/test/tests/24_pkcs11_cert/hooks.py @@ -1,4 +1,3 @@ -#!/usr/bin/python3 import os import mgstest.softhsm from pathlib import Path diff --git a/test/unittest-mgstest.py b/test/unittest-mgstest.py old mode 100755 new mode 100644 index 4ba3c9b..752f798 --- a/test/unittest-mgstest.py +++ b/test/unittest-mgstest.py @@ -1,4 +1,3 @@ -#!/usr/bin/python3 import os import sys import unittest