Updated tests PMS persistency
Replaced kubeproxy with more efficient proxy
Issue-ID: NONRTRIC-486
Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: Ib976cc2b2ef4856ba4c2665c90cf6b6525972f14
diff --git a/test/common/create_policies_process.py b/test/common/create_policies_process.py
index b97904b..480d5cb 100644
--- a/test/common/create_policies_process.py
+++ b/test/common/create_policies_process.py
@@ -89,7 +89,8 @@
start=start
stop=count*num_rics+start
- total_retry_count=0
+ http_retry_count=0
+ connect_retry_count=0
for i in range(start,stop):
if (i%pids == (pid_id-1)):
@@ -97,6 +98,7 @@
ric_id=(i%num_rics)+1
ric=ric_base+str(ric_id)
+ connect_ok=False
retry_cnt=5
while(retry_cnt>0):
try:
@@ -128,31 +130,35 @@
resp=requests.put(url, data_out, headers=headers, verify=False, timeout=90)
else:
resp=requests.put(url, data_out, headers=headers, verify=False, timeout=90, proxies=proxydict)
+ connect_ok=True
except Exception as e1:
- print("1Put failed for id:"+uuid+str(i)+ ", "+str(e1) + " "+traceback.format_exc())
- sys.exit()
-
- if (resp.status_code == None):
- print("1Put failed for id:"+uuid+str(i)+ ", expected response code: "+str(responsecode)+", got: None")
- sys.exit()
-
- if (resp.status_code != responsecode):
- if (resp.status_code == 503 ) and (retry_cnt > 1):
+ if (retry_cnt > 1):
sleep(0.1)
retry_cnt -= 1
- total_retry_count += 1
+ connect_retry_count += 1
else:
- print("1Put failed for id:"+uuid+str(i)+ ", expected response code: "+str(responsecode)+", got: "+str(resp.status_code))
- print(url_out)
- print(str(data_out))
+ print("1Put failed for id:"+uuid+str(i)+ ", "+str(e1) + " "+traceback.format_exc())
sys.exit()
- else:
- retry_cnt=-1
- if (total_retry_count > 0):
- print("0 retries:"+str(total_retry_count))
- else:
- print("0")
+ if (connect_ok == True):
+ if (resp.status_code == None):
+ print("1Put failed for id:"+uuid+str(i)+ ", expected response code: "+str(responsecode)+", got: None")
+ sys.exit()
+
+ if (resp.status_code != responsecode):
+ if (resp.status_code >= 500) and (http_retry_count < 600 ) and (retry_cnt > 1):
+ sleep(0.1)
+ retry_cnt -= 1
+ http_retry_count += 1
+ else:
+ print("1Put failed for id:"+uuid+str(i)+ ", expected response code: "+str(responsecode)+", got: "+str(resp.status_code))
+ print(url_out)
+ print(str(data_out))
+ sys.exit()
+ else:
+ retry_cnt=-1
+
+ print("0 http retries:"+str(http_retry_count) + ", connect retries: "+str(connect_retry_count))
sys.exit()
except Exception as e: