import pytest from frostfs_testlib.component_tests.container import ContainerizedService @pytest.mark.parametrize( "image", [ "busybox:musl", "golang:1.24", "python:3.12", ], ) def test_containerized_wrapper(image, neogo_deployment): demo = ContainerizedService( image=image, command='tick=0; while true; do tick=$((tick+1)); echo "tick=$tick"; sleep 0.1; done', ) demo.add_file(neogo_deployment.template, "/neogo/config.yml") demo.start() result = demo.exec("cat /neogo/config.yml") assert result.exit_code == 0 assert "StandbyCommittee" in str(result.output) print(f"Checking logs for {demo.name}") seen = [] for line in demo.logs(timeout=20): if "tick=3" in line: break seen.append(line) if len(seen) > 15: assert False, "expected output did not appear in container logs" demo.destroy() @pytest.mark.timeout(15) def test_wait_for_logs(): demo = ContainerizedService( image="busybox:musl", command='tick=0; while true; do tick=$((tick+1)); echo "tick=$tick"; sleep 0.1; done', ) demo.start() demo.wait("tick=1", timeout=5) with pytest.raises(TimeoutError): demo.wait("impossible line", timeout=5)