From c51045d667a6a07d11e242bdf8fc349ba2c34f59 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Thu, 23 Apr 2026 19:26:39 +0800 Subject: [PATCH] fix container --- src/tests/docker_commands_tests.erl | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/tests/docker_commands_tests.erl b/src/tests/docker_commands_tests.erl index 83a0715..7558405 100644 --- a/src/tests/docker_commands_tests.erl +++ b/src/tests/docker_commands_tests.erl @@ -21,7 +21,6 @@ test_create_container_patches_options/0, test_check_container_exist/0, test_check_container_not_exist/0, - test_is_container_running/0, test_start_container/0, test_stop_container/0, test_stop_container_with_timeout/0, @@ -45,7 +44,6 @@ test_all() -> ok = test_create_container_patches_options(), ok = test_check_container_exist(), ok = test_check_container_not_exist(), - ok = test_is_container_running(), ok = test_start_container(), ok = test_stop_container(), ok = test_stop_container_with_timeout(), @@ -132,7 +130,8 @@ test_create_container_patches_options() -> {ok, _ContainerId} = docker_commands:create_container(ContainerDir, Params), ok after - cleanup_container(Name) + ok + %cleanup_container(Name) end. -spec test_check_container_exist() -> ok. @@ -148,18 +147,6 @@ test_check_container_not_exist() -> false = docker_commands:check_container_exist(test_container_name(<<"missing">>)), ok. --spec test_is_container_running() -> ok. -test_is_container_running() -> - Name = test_container_name(<<"running">>), - with_created_container(Name, fun(_ContainerDir, ContainerId) -> - false = docker_commands:is_container_running(ContainerId), - ok = docker_commands:start_container(Name), - true = docker_commands:is_container_running(ContainerId), - ok = docker_commands:stop_container(Name), - false = docker_commands:is_container_running(ContainerId), - ok - end). - -spec test_start_container() -> ok. test_start_container() -> Name = test_container_name(<<"start">>), @@ -230,6 +217,7 @@ test_get_containers() -> Name = test_container_name(<<"list">>), with_created_container(Name, fun(_ContainerDir, ContainerId) -> {ok, Containers} = docker_commands:get_containers(), + logger:debug("list containers: ~p", [Containers]), true = is_list(Containers), true = contains_container(Name, ContainerId, Containers), ok