forked from GreyDGL/REST_Go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
29 lines (22 loc) · 1.33 KB
/
run.py
File metadata and controls
29 lines (22 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys
import time
import subprocess
if __name__ == "__main__":
tool = sys.argv[1]
time_limit = 1
base_cov_port = 11000
services = ["features-service", "languagetool", "ncs", "news", "ocvn", "proxyprint", "restcountries", "scout-api", "scs", "erc20-rest-service", "genome-nexus", "person-controller", "problem-controller", "rest-study", "spring-batch-rest", "spring-boot-sample-app", "user-management", "cwa-verification", "market", "project-tracking-system"]
for i in range(20):
cov_port = base_cov_port + i*10
print("Running " + tool + " for " + services[i] + ": " + str(cov_port))
session = tool + '_' + services[i]
cov_session = services[i] + "_cov"
subprocess.run("tmux new -d -s " + cov_session + " sh get_cov.sh " + str(cov_port), shell=True)
subprocess.run("tmux new -d -s " + session + " 'timeout " + time_limit + "h python3 run_tool.py " + tool + ' ' + services[i] + ' ' + str(cov_port) + "'", shell=True)
time.sleep(300)
time.sleep(int(time_limit) * 60 * 60)
subprocess.run("sh stop_all.sh", shell=True)
for i in range(20):
subprocess.run("tmux kill-sess -t " + services[i], shell=True)
subprocess.run("tmux kill-sess -t " + services[i] + "_cov", shell=True)
subprocess.run("tmux kill-sess -t " + tool + '_' + services[i], shell=True)