Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a test for restart_itde in a container #98

Merged
merged 11 commits into from
Apr 3, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Adding intermediate status checks in the restart_itde test
ahsimb committed Apr 2, 2024
commit 79a30b0113a371f9f039a4bd7370a3d09f03d30b
3 changes: 2 additions & 1 deletion doc/changes/changes_0.2.9.md
Original file line number Diff line number Diff line change
@@ -11,4 +11,5 @@ Post-release fixes.
- Handles correctly special characters in the password.
* #89: Connecting a new AI-Lab container to the Docker DB network when the latter container restarts.
* #93: Refactoring the ITDE manager interface.
* #94: Adding an integration test for restart_itde() in a container.
* #94: Adding an integration test for restart_itde() in a container.
* #95: Adding an integration test for get_itde_status() in a container.
11 changes: 8 additions & 3 deletions test/integration/test_itde_manager_in_docker_container.py
Original file line number Diff line number Diff line change
@@ -195,6 +195,7 @@ def itde_stop_and_restart():
def run_test():
from pathlib import Path

from exasol_integration_test_docker_environment.lib.docker import ContextDockerClient
from exasol.nb_connector.ai_lab_config import AILabConfig
from exasol.nb_connector.itde_manager import (
ItdeContainerStatus, bring_itde_up, restart_itde, get_itde_status,
@@ -206,16 +207,20 @@ def run_test():
secrets.save(AILabConfig.disk_size.value, "4")

bring_itde_up(secrets)
assert get_itde_status(secrets) is ItdeContainerStatus.READY

# Disconnect calling container from Docker-DB network
_remove_current_container_from_db_network(secrets)
# Stop the ITDE container.
assert get_itde_status(secrets) is ItdeContainerStatus.RUNNING

# Stop the Docker-DB container.
container_name = secrets.get(AILabConfig.itde_container)
with ContextDockerClient() as docker_client:
docker_client.api.stop(container_name)
assert get_itde_status(secrets) is ItdeContainerStatus.STOPPED

restart_itde(secrets)
status = get_itde_status(secrets)
assert status is ItdeContainerStatus.READY
assert get_itde_status(secrets) is ItdeContainerStatus.READY

function_source_code = textwrap.dedent(dill.source.getsource(run_test))
source_code = f"{function_source_code}\nrun_test()"