diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-05-23 13:46:07 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-05-23 13:46:07 +0000 |
commit | f70a21ae966d0bcc791cf12d02fe88910213ac08 (patch) | |
tree | 2bde6edfd2d28f96903be3304d1d50faa5a476cb | |
parent | ce8bd60732297c41b6816e3f0ffb9f4646f6305d (diff) | |
parent | ec3ba471f72593202fd7d2f45b918d35998b3b7e (diff) | |
download | ewww-f70a21ae966d0bcc791cf12d02fe88910213ac08.tar.gz |
Merge branch 'cleanup' into 'master'
test: kill server started by scenario at end of scenario
Closes #1
See merge request larswirzenius/ewww!4
-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 |