@@ -110,10 +110,19 @@ def _check_impl_is_compliant(self, name: str, role: Perspective) -> bool:
110110 self .compliant .setdefault (name , {})
111111
112112 client_log_dir = tempfile .TemporaryDirectory (dir = "/tmp" , prefix = "logs_client_" )
113- www_dir = tempfile .TemporaryDirectory (dir = "/tmp" , prefix = "compliance_www_" )
114113 certs_dir = tempfile .TemporaryDirectory (dir = "/tmp" , prefix = "compliance_certs_" )
115- downloads_dir = tempfile .TemporaryDirectory (
116- dir = "/tmp" , prefix = "compliance_downloads_"
114+
115+ client_www_dir = tempfile .TemporaryDirectory (
116+ dir = "/tmp" , prefix = "compliance_client_www_"
117+ )
118+ client_downloads_dir = tempfile .TemporaryDirectory (
119+ dir = "/tmp" , prefix = "compliance_client_downloads_"
120+ )
121+ server_www_dir = tempfile .TemporaryDirectory (
122+ dir = "/tmp" , prefix = "compliance_server_www_"
123+ )
124+ server_downloads_dir = tempfile .TemporaryDirectory (
125+ dir = "/tmp" , prefix = "compliance_server_downloads_"
117126 )
118127
119128 testcases_quic .generate_cert_chain (certs_dir .name )
@@ -126,8 +135,10 @@ def _check_impl_is_compliant(self, name: str, role: Perspective) -> bool:
126135 "TESTCASE_CLIENT=" + generate_slug () + " "
127136 "SERVER_LOGS=/dev/null "
128137 "CLIENT_LOGS=" + client_log_dir .name + " "
129- "WWW=" + www_dir .name + " "
130- "DOWNLOADS=" + downloads_dir .name + " "
138+ "CLIENT_WWW=" + client_www_dir .name + " "
139+ "CLIENT_DOWNLOADS=" + client_downloads_dir .name + " "
140+ "SERVER_WWW=" + server_www_dir .name + " "
141+ "SERVER_DOWNLOADS=" + server_downloads_dir .name + " "
131142 'SCENARIO="simple-p2p --delay=15ms --bandwidth=10Mbps --queue=25" '
132143 "CLIENT=" + self ._implementations [name ]["image" ] + " "
133144 "SERVER="
@@ -155,8 +166,10 @@ def _check_impl_is_compliant(self, name: str, role: Perspective) -> bool:
155166 "TESTCASE_SERVER=" + generate_slug () + " "
156167 "SERVER_LOGS=" + server_log_dir .name + " "
157168 "CLIENT_LOGS=/dev/null "
158- "WWW=" + www_dir .name + " "
159- "DOWNLOADS=" + downloads_dir .name + " "
169+ "CLIENT_WWW=" + client_www_dir .name + " "
170+ "CLIENT_DOWNLOADS=" + client_downloads_dir .name + " "
171+ "SERVER_WWW=" + server_www_dir .name + " "
172+ "SERVER_DOWNLOADS=" + server_downloads_dir .name + " "
160173 "CLIENT="
161174 + self ._implementations [name ]["image" ]
162175 + " " # only needed so docker compose doesn't complain
@@ -172,8 +185,6 @@ def _check_impl_is_compliant(self, name: str, role: Perspective) -> bool:
172185 self .compliant [name ][role ] = False
173186 return False
174187 logging .debug ("%s server compliant." , name )
175- else :
176- raise ValueError (f"Unknown perspective for compliance check: { role } " )
177188
178189 # remember compliance test outcome for this role
179190 self .compliant [name ][role ] = True
@@ -410,8 +421,10 @@ def _run_test(
410421 "CERTS=" + test .certs_dir () + " "
411422 "TESTCASE_SERVER=" + test .testname (Perspective .SERVER ) + " "
412423 "TESTCASE_CLIENT=" + test .testname (Perspective .CLIENT ) + " "
413- "WWW=" + test .www_dir () + " "
414- "DOWNLOADS=" + test .download_dir () + " "
424+ "CLIENT_WWW=" + test .client_www_dir () + " "
425+ "CLIENT_DOWNLOADS=" + test .client_download_dir () + " "
426+ "SERVER_WWW=" + test .server_www_dir () + " "
427+ "SERVER_DOWNLOADS=" + test .server_download_dir () + " "
415428 "SERVER_LOGS=" + server_log_dir .name + " "
416429 "CLIENT_LOGS=" + client_log_dir .name + " "
417430 'SCENARIO="{}" '
@@ -423,7 +436,7 @@ def _run_test(
423436 containers = "sim client server " + " " .join (test .additional_containers ())
424437 cmd = (
425438 params
426- + " docker compose --env-file empty.env up --abort-on-container-exit --timeout 1 "
439+ + " docker compose --env-file empty.env up --abort-on-container-exit --timeout 10 "
427440 + containers
428441 )
429442 logging .debug ("Command: %s" , cmd )
@@ -485,11 +498,30 @@ def _run_test(
485498 shutil .copytree (sim_log_dir .name , log_dir + "/sim" )
486499 shutil .copyfile (log_file .name , log_dir + "/output.txt" )
487500 if self ._save_files and status == TestResult .FAILED :
488- shutil .copytree (test .www_dir (), log_dir + "/www" )
489501 try :
490- shutil .copytree (test .download_dir (), log_dir + "/downloads" )
502+ shutil .copytree (test .server_www_dir (), log_dir + "/server_www" )
503+ except Exception as exception :
504+ logging .info ("Could not copy server www files: %s" , exception )
505+ try :
506+ shutil .copytree (
507+ test .client_download_dir (), log_dir + "/client_downloads"
508+ )
491509 except Exception as exception :
492- logging .info ("Could not copy downloaded files: %s" , exception )
510+ logging .info (
511+ "Could not copy client downloaded files: %s" , exception
512+ )
513+ try :
514+ shutil .copytree (test .client_www_dir (), log_dir + "/client_www" )
515+ except Exception as exception :
516+ logging .info ("Could not copy client www files: %s" , exception )
517+ try :
518+ shutil .copytree (
519+ test .server_download_dir (), log_dir + "/server_downloads"
520+ )
521+ except Exception as exception :
522+ logging .info (
523+ "Could not copy server downloaded files: %s" , exception
524+ )
493525
494526 test .cleanup ()
495527 server_log_dir .cleanup ()
0 commit comments