[a06358c] | 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
|
---|
[684bc1] | 11 | ${AUTOTEST_PATH}/Fragmentation/Automation/Server --workerport $WORKERPORT --controllerport $CONTROLLERPORT &
|
---|
[a06358c] | 12 | server_pid=$!
|
---|
| 13 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 14 |
|
---|
[5ac92e] | 15 | # check help of poolworker
|
---|
| 16 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/PoolWorker -h], 1, [ignore], [ignore], [kill $server_pid])
|
---|
| 17 |
|
---|
[a06358c] | 18 | # let worker enroll in pool
|
---|
[5ac92e] | 19 | ${AUTOTEST_PATH}/Fragmentation/Automation/PoolWorker -v 5 --signal 2 --server 127.0.0.1:${WORKERPORT} --hostname 127.0.0.1 --listen $WORKERLISTENPORT &
|
---|
[a06358c] | 20 | worker_pid=$!
|
---|
| 21 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
|
---|
| 22 |
|
---|
[469f53] | 23 | # add one jobs via JobAdder
|
---|
| 24 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Controller --server 127.0.0.1:$CONTROLLERPORT --command createjobs --executable "cat" --jobcommand "Nothing"], 0, [stdout], [ignore], [kill $server_pid $worker_pid])
|
---|
| 25 | AT_CHECK([fgrep "Sending 1 jobs ..." stdout], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
|
---|
| 26 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
|
---|
| 27 |
|
---|
[5ac92e] | 28 | # send kill signal to worker such that it shuts down properly
|
---|
| 29 | AT_CHECK([kill -2 $worker_pid], 0, [stdout], [ignore], [kill $server_pid $worker_pid])
|
---|
[a06358c] | 30 |
|
---|
| 31 | # shutdown server as well
|
---|
[af9b9ff] | 32 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Controller --server 127.0.0.1:$CONTROLLERPORT --command shutdown], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
|
---|
[a06358c] | 33 |
|
---|
| 34 | # check that Server is truely down
|
---|
| 35 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
|
---|
| 36 | AT_CHECK([kill $server_pid $worker_pid], 1, [ignore], [ignore])
|
---|
| 37 |
|
---|
| 38 | AT_CLEANUP
|
---|