| 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 |  | 
|---|
| 19 | # work on jobs | 
|---|
| 20 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Worker 127.0.0.1 $WORKERPORT], 0, [ignore], [ignore], [kill $server_pid]) | 
|---|
| 21 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Worker 127.0.0.1 $WORKERPORT], 0, [ignore], [ignore], [kill $server_pid]) | 
|---|
| 22 |  | 
|---|
| 23 | # shutdown | 
|---|
| 24 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Shutdowner 127.0.0.1 $CONTROLLERPORT], 0, [ignore], [ignore], [kill $server_pid]) | 
|---|
| 25 |  | 
|---|
| 26 | # check that server is truely down | 
|---|
| 27 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid]) | 
|---|
| 28 | AT_CHECK([kill $server_pid], 1, [ignore], [ignore]) | 
|---|
| 29 |  | 
|---|
| 30 | AT_CLEANUP | 
|---|