Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}")
Expand Down
22 changes: 22 additions & 0 deletions tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---


Expand All @@ -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"
Expand Down