[0bdd51b] | 1 | ### fragment the molecule and check the number of configs
|
---|
| 2 |
|
---|
[e70b9d] | 3 | AT_SETUP([Fragmentation - Automation: Server/Worker])
|
---|
| 4 | AT_KEYWORDS([fragmentation automation server worker])
|
---|
[0bdd51b] | 5 |
|
---|
[03195a] | 6 | # check that ports are unique over all tests such that they may run in parallel
|
---|
[db03d9] | 7 | WORKERPORT=1025
|
---|
| 8 | CONTROLLERPORT=1026
|
---|
[0bdd51b] | 9 |
|
---|
| 10 | # start service in background
|
---|
[db03d9] | 11 | ${AUTOTEST_PATH}/Fragmentation/Automation/Server $WORKERPORT $CONTROLLERPORT &
|
---|
[03195a] | 12 | server_pid=$!
|
---|
| 13 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
|
---|
[0bdd51b] | 14 |
|
---|
[fb2324] | 15 | # add one jobs
|
---|
| 16 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/JobAdder 127.0.0.1 $CONTROLLERPORT 1], 0, [ignore], [ignore], [kill $server_pid])
|
---|
[778abb] | 17 |
|
---|
[db03d9] | 18 | # first worker has a job
|
---|
[03195a] | 19 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Worker 127.0.0.1 $WORKERPORT], 0, [stdout], [ignore], [kill $server_pid])
|
---|
| 20 | AT_CHECK([fgrep "Job id: 1" stdout], 0, [ignore], [ignore], [kill $server_pid])
|
---|
[db03d9] | 21 |
|
---|
[167b63] | 22 | # check number of done jobs
|
---|
[03195a] | 23 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/ResultChecker 127.0.0.1 $CONTROLLERPORT], 0, [stdout], [ignore], [kill $server_pid])
|
---|
| 24 | AT_CHECK([fgrep "1 jobs are calculated so far" stdout], 0, [ignore], [ignore], [kill $server_pid])
|
---|
[3c4a5e] | 25 |
|
---|
[0196c6] | 26 | # shutdown controller socket
|
---|
[03195a] | 27 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Shutdowner 127.0.0.1 $CONTROLLERPORT], 0, [stdout], [ignore], [kill $server_pid])
|
---|
[0196c6] | 28 |
|
---|
[0bdd51b] | 29 | # check that server is truely down
|
---|
[03195a] | 30 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 31 | AT_CHECK([kill $server_pid], 1, [ignore], [ignore])
|
---|
[0bdd51b] | 32 |
|
---|
| 33 | AT_CLEANUP
|
---|