File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ CONTAINER:
44 - docker
55 - podman
66 REGISTRY_HUB: https://mirror.gcr.io
7- UPSTREAM_NAME: 'library/busybox'
7+ UPSTREAM_NAME: jmalloc/echo-server
88 ALTERNATIVE_UPSTREAM_NAMES:
99 - hello-world
1010 - alpine
Original file line number Diff line number Diff line change 119119 'container.upstream_name' ,
120120 must_exist = True ,
121121 is_type_of = str ,
122- default = 'library/busybox ' ,
122+ default = 'jmalloc/echo-server ' ,
123123 ),
124124 Validator (
125125 'container.alternative_upstream_names' ,
Original file line number Diff line number Diff line change 1111"""
1212
1313from datetime import UTC , datetime
14+ import re
1415
1516from box import Box
1617from fauxfactory import gen_string
@@ -95,16 +96,18 @@ def test_positive_pull_image(
9596 )
9697 assert result .status == 0
9798 try :
98- result = module_container_contenthost .execute (f'docker run { repo ["published-at" ]} ' )
99+ result = module_container_contenthost .execute (
100+ f'docker run -d { repo ["published-at" ]} '
101+ )
99102 assert result .status == 0
103+ match = re .match (r'^[0-9a-f]+$' , result .stdout )
104+ if match :
105+ container_id = match .group (0 )
100106 finally :
101107 # Stop and remove the container
102- result = module_container_contenthost .execute (
103- f'docker ps -a | grep { repo ["published-at" ]} '
104- )
105- container_id = result .stdout [0 ].split ()[0 ]
106- module_container_contenthost .execute (f'docker stop { container_id } ' )
107- module_container_contenthost .execute (f'docker rm { container_id } ' )
108+ if container_id :
109+ module_container_contenthost .execute (f'docker stop { container_id } ' )
110+ module_container_contenthost .execute (f'docker rm { container_id } ' )
108111 finally :
109112 # Remove docker image
110113 module_container_contenthost .execute (f'docker rmi { repo ["published-at" ]} ' )
You can’t perform that action at this time.
0 commit comments