diff --git a/tests/conftest.py b/tests/conftest.py index 669709f..0626a1f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -76,6 +76,11 @@ def file_exists(self, path: str) -> bool: result = self.run(f"test -f {shlex.quote(path)}") return result.returncode == 0 + def file_executable(self, path: str) -> bool: + """Check if a file exists and is executable.""" + result = self.run(f"test -x {shlex.quote(path)}") + return result.returncode == 0 + def dir_exists(self, path: str) -> bool: """Check if a directory exists.""" result = self.run(f"test -d {shlex.quote(path)}") diff --git a/tests/test_common.py b/tests/test_common.py index 2346c73..91ea207 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -67,6 +67,18 @@ def test_workdir_writable(container): assert result.returncode == 0 +def test_fix_permissions_executable(container): + """Verify fix-permissions script is installed and executable. + + This script is critical for OpenShift compatibility, it ensures GID 0 + group write access on directories. If accidentally removed or with wrong + permissions, downstream images break at runtime with permission errors. + """ + assert container.file_executable("/usr/local/bin/fix-permissions"), ( + "/usr/local/bin/fix-permissions must exist and be executable" + ) + + # --- Configuration Tests --- @@ -81,6 +93,16 @@ def test_pip_conf_valid(container): assert "[global]" in result.stdout, "pip.conf missing [global] section" +def test_pip_index_url_configured(container): + """Verify pip global.index-url is configured""" + result = container.run("pip config --global get global.index-url") + assert result.returncode == 0, ( + "pip global.index-url is not set — expected an index-url in /etc/pip.conf" + ) + index_url = result.stdout.strip() + assert index_url, "pip global.index-url is set but empty" + + def test_uv_toml_exists(container): """Verify uv configuration file exists.""" assert container.file_exists("/etc/uv/uv.toml"), "uv configuration file not found"