@@ -50,7 +50,7 @@ def get_ue_gnb_epc(self, extra, band, common_scs, bandwidth, mcs, ue_count):
5050 "bandwidth" : bandwidth ,
5151 "mcs" : mcs ,
5252 "log_level" : get_loglevel (),
53- "pcap" : bool ( os . environ [ "RETINA_PCAP_ENABLE" ])
53+ "pcap" : get_pcap (),
5454 }
5555 },
5656 }
@@ -74,19 +74,24 @@ def get_ue_gnb_epc(self, extra, band, common_scs, bandwidth, mcs, ue_count):
7474
7575 with suppress (NameError , grpc ._channel ._InactiveRpcError ):
7676 return_code = gnb .Stop (Empty ()).value
77- teardown_ok &= return_code == 0
7877 if return_code < 0 :
78+ teardown_ok = False
7979 logging .error ("GNB crashed with exit code %s" , return_code )
8080 elif return_code > 0 :
81+ if get_fail_if_internal_errors ():
82+ teardown_ok = False
8183 logging .error ("GNB has %d errors or warnings" , return_code )
8284 with suppress (NameError , grpc ._channel ._InactiveRpcError ):
8385 epc .Stop (Empty ()).value
8486 with suppress (NameError , grpc ._channel ._InactiveRpcError ):
8587 return_code = ue .Stop (Empty ()).value
8688 teardown_ok &= return_code == 0
8789 if return_code < 0 :
90+ teardown_ok = False
8891 logging .error ("UE crashed with exit code %s" , return_code )
8992 elif return_code > 0 :
93+ if get_fail_if_internal_errors ():
94+ teardown_ok = False
9095 logging .error ("UE has %d errors or warnings" , return_code )
9196 if teardown_ok is False :
9297 test_successful = False
@@ -147,3 +152,23 @@ def get_loglevel():
147152 return os .environ ["RETINA_LOGLEVEL" ]
148153 except KeyError :
149154 return "info"
155+
156+
157+ def get_pcap ():
158+ """
159+ Return True / False
160+ """
161+ try :
162+ return bool (os .environ ["RETINA_PCAP_ENABLE" ])
163+ except KeyError :
164+ return False
165+
166+
167+ def get_fail_if_internal_errors ():
168+ """
169+ Return True / False
170+ """
171+ try :
172+ return bool (os .environ ["RETINA_FAIL_IF_INTERNAL_ERRORS" ])
173+ except KeyError :
174+ return True
0 commit comments