[0bdd51b] | 1 | ### fragment the molecule and check the number of configs
|
---|
| 2 |
|
---|
| 3 | AT_SETUP([Fragmentation - Automation])
|
---|
| 4 | AT_KEYWORDS([fragmentation automation worker])
|
---|
| 5 |
|
---|
[db03d9] | 6 | WORKERPORT=1025
|
---|
| 7 | CONTROLLERPORT=1026
|
---|
[0bdd51b] | 8 |
|
---|
| 9 | # start service in background
|
---|
[db03d9] | 10 | ${AUTOTEST_PATH}/Fragmentation/Automation/Server $WORKERPORT $CONTROLLERPORT &
|
---|
[0bdd51b] | 11 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [pkill Server])
|
---|
| 12 |
|
---|
[778abb] | 13 | # add two jobs
|
---|
| 14 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/JobAdder 127.0.0.1 $CONTROLLERPORT 2], 0, [ignore], [ignore], [pkill Server])
|
---|
| 15 |
|
---|
[db03d9] | 16 | # first worker has a job
|
---|
| 17 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Worker 127.0.0.1 $WORKERPORT], 0, [stdout], [ignore], [pkill Server])
|
---|
[ef2767] | 18 | AT_CHECK([fgrep "Job id: 1" stdout], 0, [ignore], [ignore], [pkill Server])
|
---|
[db03d9] | 19 |
|
---|
[3c4a5e] | 20 | # check number of done jobs
|
---|
| 21 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/ResultChecker 127.0.0.1 $CONTROLLERPORT], 0, [stdout], [ignore], [pkill Server])
|
---|
| 22 | AT_CHECK([fgrep "1 jobs are calculated so far" stdout], 0, [ignore], [ignore], [pkill Server])
|
---|
| 23 |
|
---|
[db03d9] | 24 | # add no job to shutdown socket
|
---|
| 25 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/JobAdder 127.0.0.1 $CONTROLLERPORT 0], 0, [stdout], [ignore], [pkill Server])
|
---|
[778abb] | 26 |
|
---|
| 27 | # second worker has a job, but then there are no more, hence socket powered down
|
---|
| 28 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Worker 127.0.0.1 $WORKERPORT], 0, [stdout], [ignore], [pkill Server])
|
---|
| 29 | AT_CHECK([fgrep "Job id: 2" stdout], 0, [ignore], [ignore], [pkill Server])
|
---|
[0bdd51b] | 30 |
|
---|
| 31 | # check that server is truely down
|
---|
| 32 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [pkill Server])
|
---|
| 33 | AT_CHECK([pkill Server], 1, [ignore], [ignore])
|
---|
| 34 |
|
---|
| 35 | AT_CLEANUP
|
---|