-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add minimal tests for git, helm and nginx containers
- Loading branch information
1 parent
1105535
commit 5622516
Showing
7 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from pytest_container.runtime import LOCALHOST | ||
|
||
from bci_tester.data import GIT_CONTAINER | ||
|
||
|
||
CONTAINER_IMAGES = (GIT_CONTAINER,) | ||
|
||
|
||
def test_git_version(auto_container, host): | ||
assert ( | ||
"git version 2." | ||
in auto_container.connection.run_expect( | ||
[0], "git --version" | ||
).stdout.strip() | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from pytest_container.runtime import LOCALHOST | ||
|
||
from bci_tester.data import HELM_CONTAINER | ||
|
||
|
||
CONTAINER_IMAGES = (HELM_CONTAINER,) | ||
|
||
|
||
def test_helm_version(auto_container, host, container_runtime): | ||
assert ( | ||
"GitTreeState" | ||
in host.run_expect( | ||
[0], | ||
f"{container_runtime.runner_binary} run --rm {auto_container.image_url_or_id} version", | ||
).stdout.strip() | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from pytest_container.runtime import LOCALHOST | ||
|
||
from bci_tester.data import NGINX_CONTAINER | ||
|
||
|
||
CONTAINER_IMAGES = (NGINX_CONTAINER,) | ||
|
||
|
||
def test_nginx_welcome_page(auto_container, host): | ||
host_port = auto_container.forwarded_ports[0].host_port | ||
|
||
assert "Welcome to nginx" in host.check_output( | ||
f"curl -sf --retry 5 --retry-connrefused http://localhost:{host_port}/" | ||
) |