diff --git a/zap-plugin.patch b/zap-plugin.patch index 6904fcee19755e7e84fb8091dd6125308bbd63fe..0e8c3fdf1a309ac4682e2abb8a1aeb4374e3069d 100644 --- a/zap-plugin.patch +++ b/zap-plugin.patch @@ -1,18 +1,20 @@ ---- plugin/zap.py 2015-11-24 16:46:07.543884068 +0000 -+++ /tmp/zap.py 2015-11-25 08:33:33.983165539 +0000 -@@ -78,7 +78,7 @@ - print 'Starting ZAP ...' - - global child_pid -- proc = subprocess.Popen([cmd,'-daemon']) -+ proc = subprocess.Popen([cmd,'-daemon', '-config', 'api.disablekey=true']) - child_pid = proc.pid - - print 'Waiting for ZAP to load, 10 seconds ...' -@@ -129,4 +129,4 @@ - #EOF - - if __name__ == "__main__": -- main() -\ No newline at end of file -+ main() +19a20 +> import psutil +81c82 +< proc = subprocess.Popen([cmd,'-daemon']) +--- +> proc = subprocess.Popen([cmd,'-daemon', '-config', 'api.disablekey=true']) +84,85c85,94 +< print 'Waiting for ZAP to load, 10 seconds ...' +< time.sleep(10) +--- +> print 'Waiting for ZAP to load...' +> max_wait=60 +> import time +> import psutil +> time1=time.time() +> while True: +> if 8080 in [i.laddr.port for i in psutil.Process(proc.pid).connections() if i.status=='LISTEN']: +> break +> if time.time()-time1 > max_wait: +> raise Exception("ZAP wait timeout")