[6772eb] | 1 | ### fragment the molecule and check the number of configs
|
---|
| 2 |
|
---|
| 3 | AT_SETUP([Fragmentation - Automation: Adding jobs])
|
---|
| 4 | AT_KEYWORDS([fragmentation automation server worker jobadder])
|
---|
| 5 |
|
---|
| 6 | # check that ports are unique over all tests such that they may run in parallel
|
---|
| 7 | WORKERPORT=1035
|
---|
| 8 | CONTROLLERPORT=1036
|
---|
| 9 |
|
---|
| 10 | # start service in background
|
---|
| 11 | ${AUTOTEST_PATH}/Fragmentation/Automation/Server $WORKERPORT $CONTROLLERPORT &
|
---|
| 12 | server_pid=$!
|
---|
| 13 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 14 |
|
---|
| 15 | # add two jobs via JobAdder
|
---|
| 16 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/JobAdder 127.0.0.1 $CONTROLLERPORT 2], 0, [stdout], [ignore], [kill $server_pid])
|
---|
| 17 | AT_CHECK([fgrep "Sending 2 jobs ..." stdout], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 18 | AT_CHECK([fgrep "Operation completed" stdout], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 19 |
|
---|
| 20 | # work on jobs
|
---|
| 21 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Worker 127.0.0.1 $WORKERPORT], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 22 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Worker 127.0.0.1 $WORKERPORT], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 23 |
|
---|
| 24 | # shutdown
|
---|
| 25 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Shutdowner 127.0.0.1 $CONTROLLERPORT], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 26 |
|
---|
| 27 | # check that server is truely down
|
---|
| 28 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 29 | AT_CHECK([kill $server_pid], 1, [ignore], [ignore])
|
---|
| 30 |
|
---|
| 31 | AT_CLEANUP
|
---|