tests/*server.py: remove pidfile on server termination

Avoid pidfile leaking/laying around after server already exited.

Reviewed-by: Daniel Stenberg
Closes #7506
This commit is contained in:
Marc Hoersken 2021-07-16 12:23:03 +02:00
parent 4d680e4a8f
commit c34bd93f60
No known key found for this signature in database
GPG Key ID: 61E03CBED7BC859E
3 changed files with 9 additions and 0 deletions

View File

@ -188,5 +188,8 @@ if __name__ == '__main__':
log.exception(e)
rc = ScriptRC.EXCEPTION
if options.pidfile and os.path.isfile(options.pidfile):
os.unlink(options.pidfile)
log.info("[DICT] Returning %d", rc)
sys.exit(rc)

View File

@ -364,5 +364,8 @@ if __name__ == '__main__':
log.exception(e)
rc = ScriptRC.EXCEPTION
if options.pidfile and os.path.isfile(options.pidfile):
os.unlink(options.pidfile)
log.info("Returning %d", rc)
sys.exit(rc)

View File

@ -391,5 +391,8 @@ if __name__ == '__main__':
log.exception(e)
rc = ScriptRC.EXCEPTION
if options.pidfile and os.path.isfile(options.pidfile):
os.unlink(options.pidfile)
log.info("[SMB] Returning %d", rc)
sys.exit(rc)