diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-05-23 16:44:58 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-05-23 16:44:58 +0300 |
commit | ec3ba471f72593202fd7d2f45b918d35998b3b7e (patch) | |
tree | 2bde6edfd2d28f96903be3304d1d50faa5a476cb | |
parent | ce8bd60732297c41b6816e3f0ffb9f4646f6305d (diff) | |
download | ewww-ec3ba471f72593202fd7d2f45b918d35998b3b7e.tar.gz |
test: kill server started by scenario at end of scenario
-rw-r--r-- | ewww.py | 8 | ||||
-rw-r--r-- | ewww.yaml | 1 |
2 files changed, 8 insertions, 1 deletions
@@ -6,6 +6,7 @@ import os import random import re import shutil +import signal import subprocess import time import urllib.parse @@ -100,7 +101,12 @@ def start_server(ctx, filename=None): ) _run_exit(ctx, 0) - ctx["pid"] = open("ewww.pid").read() + ctx["pid"] = int(open("ewww.pid").read().strip()) + + +# Stop previously started server. +def stop_server(ctx): + os.kill(ctx["pid"], signal.SIGKILL) # Make a HTTP request. @@ -3,6 +3,7 @@ - given: a running server using config file {filename} function: start_server + cleanup: stop_server - given: "{count} files in {dirname}" function: fixme |