Function
_exec
(container_id: str, cmd: str, workdir: str = CONTAINER_WORKDIR, timeout: int = 600)
Source from the content-addressed store, hash-verified
| 85 | @pytest.fixture |
| 86 | def exec_in_container(): |
| 87 | def _exec(container_id: str, cmd: str, workdir: str = CONTAINER_WORKDIR, timeout: int = 600): |
| 88 | result = subprocess.run( |
| 89 | ["docker", "exec", "-w", workdir, container_id, "bash", "-lc", cmd], |
| 90 | capture_output=True, |
| 91 | text=True, |
| 92 | timeout=timeout, |
| 93 | check=False, |
| 94 | ) |
| 95 | return result.returncode, result.stdout, result.stderr |
| 96 | |
| 97 | return _exec |
| 98 | |
Callers
nothing calls this directly
Tested by
no test coverage detected