From d3b8d919e317d4c1a4b035f9c2d22ef1187e5dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=84=D0=BE=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=20=D0=95=D0=BA=D0=B0=D1=82=D0=B5=D1=80=D0=B8=D0=BD=D0=B0?= Date: Fri, 27 Nov 2026 20:03:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=A07:=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D1=8F=D1=82=D1=8C=20=D0=BF=D1=83=D0=B1=D0=BB=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8E=20=D0=BF=D0=BE=D1=80=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20docker=20ps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `docker compose ps --format {{.Ports}}` не гарантирует это поле; docker ps с фильтром проекта даёт стабильный формат. Co-Authored-By: O3 Agent Claude --- student-tests/test_lab7.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/student-tests/test_lab7.py b/student-tests/test_lab7.py index 69c444f..9a2c7b8 100644 --- a/student-tests/test_lab7.py +++ b/student-tests/test_lab7.py @@ -177,7 +177,9 @@ def main(): wrong_name.startswith("cert_error"), wrong_name) # 1b. Наружу — только loopback-порты; app-контейнеры hardened. - ps_out = compose("ps", "--format", "{{.Service}}|{{.Ports}}").stdout + ps_out = run(["docker", "ps", + "--filter", "label=com.docker.compose.project=messenger-lab7", + "--format", "{{.Names}}|{{.Ports}}"]).stdout public = [line for line in ps_out.splitlines() if "->" in line and "127.0.0.1:" not in line and "[::1]:" not in line] check("exposure: no service published on all interfaces", not public,