Skip to content

Commit

Permalink
conn: add container/podman/docker connection
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrezina committed Jul 11, 2024
1 parent e31f590 commit 83a907f
Show file tree
Hide file tree
Showing 3 changed files with 463 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ API Reference
pytest_mh.cli
pytest_mh.conn
pytest_mh.conn.ssh
pytest_mh.conn.container
pytest_mh.utils
3 changes: 3 additions & 0 deletions pytest_mh/_private/multihost.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from ..cli import CLIBuilder
from ..conn import Bash, Connection, Powershell, Process, ProcessError, ProcessInputBuffer, ProcessResult, Shell
from ..conn.container import ContainerClient
from ..conn.ssh import SSHClient
from .artifacts import (
MultihostArtifactsCollector,
Expand Down Expand Up @@ -619,6 +620,8 @@ def get_connection(self, shell: Shell) -> Connection:
match conn_type:
case "ssh":
return SSHClient.from_confdict(self, conn_confdict)
case "podman" | "docker":
return ContainerClient.from_confdict(self, conn_confdict)
case _:
raise ValueError(f"Unknown connection type: {conn_type}!")

Expand Down
Loading

0 comments on commit 83a907f

Please sign in to comment.