1 | ### fragment the molecule and check the number of configs
|
---|
2 |
|
---|
3 | AT_SETUP([Fragmentation - Automation: Worker enrolls in pool])
|
---|
4 | AT_KEYWORDS([fragmentation automation controller poolworker server shutdown])
|
---|
5 |
|
---|
6 | WORKERPORT=1055
|
---|
7 | CONTROLLERPORT=1056
|
---|
8 | WORKERLISTENPORT=1057
|
---|
9 |
|
---|
10 | # start service in background
|
---|
11 | ${AUTOTEST_PATH}/Fragmentation/Automation/Server --workerport $WORKERPORT --controllerport $CONTROLLERPORT &
|
---|
12 | server_pid=$!
|
---|
13 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
|
---|
14 |
|
---|
15 | # check help of poolworker
|
---|
16 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/PoolWorker -h], 1, [ignore], [ignore], [kill $server_pid])
|
---|
17 |
|
---|
18 | # let worker enroll in pool
|
---|
19 | ${AUTOTEST_PATH}/Fragmentation/Automation/PoolWorker -v 5 --signal 2 --server 127.0.0.1:${WORKERPORT} --hostname 127.0.0.1 --listen $WORKERLISTENPORT &
|
---|
20 | worker_pid=$!
|
---|
21 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
|
---|
22 |
|
---|
23 | # send kill signal to worker such that it shuts down properly
|
---|
24 | AT_CHECK([kill -2 $worker_pid], 0, [stdout], [ignore], [kill $server_pid $worker_pid])
|
---|
25 |
|
---|
26 | # shutdown server as well
|
---|
27 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Controller --server 127.0.0.1:$CONTROLLERPORT --command shutdown], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
|
---|
28 |
|
---|
29 | # check that Server is truely down
|
---|
30 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
|
---|
31 | AT_CHECK([kill $server_pid $worker_pid], 1, [ignore], [ignore])
|
---|
32 |
|
---|
33 | AT_CLEANUP
|
---|