summaryrefslogtreecommitdiff
path: root/scripts/scalability/makefile
blob: 0067c650af72ac40d098c70973e1b4b2e2484120 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Test Controller for Server Scalability Tests
# ============================================
#
# This makefile knows how to install server and client components of the Test
# Controller, as well as to trigger a run of the benchmarks.
#
# Test Controller server
# ----------------------
#
# In the server, run the following to have an instance of the Test Controller
# server running:
#
#   make install-server
#   make start-server
#
# And, if you want to see the logs, use:
#
#   make log
#
# Alternativelly, use `make start-server-nodaemon` to avoid detaching from the
# terminal.
#
# Test Controller client
# ----------------------
#
# Make sure an instance of the Test Controller Server is reachable at $(URI),
# and run:
#
#   make install-client
#   make run-test


URI = https://giraffe.cdev.bitmask.net:7001

PIDFILE   = /tmp/test_controller.pid
LOGFILE   = /tmp/test_controller.log
TACFILE   = ./test_controller/server/server.tac


#----------------#
# Server targets #
#----------------#

install-server:
	pip install ".[server]"

start-server:
	twistd --pidfile=$(PIDFILE) --logfile=$(LOGFILE) --python=$(TACFILE)

start-server-nodaemon:
	twistd --nodaemon --python=$(TACFILE)

kill:
	[ -f $(PIDFILE) ] && kill -9 $$(cat $(PIDFILE))

log:
	tail -F $(LOGFILE)

restart: kill start


#----------------#
# Client targets #
#----------------#

install-client:
	pip install ".[client]"

test:
	(cd test_controller/client && make test URI=$(URI))