| [404d2b] | 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
 | 
|---|
| [51a013] | 7 | WORKERPORT=11035
 | 
|---|
 | 8 | CONTROLLERPORT=11036
 | 
|---|
 | 9 | WORKERLISTENPORT=11037
 | 
|---|
| [404d2b] | 10 | 
 | 
|---|
 | 11 | # start service in background
 | 
|---|
| [ab2e834] | 12 | ${AUTOTEST_PATH}/JobMarketServer --workeraddress 127.0.0.1:$WORKERLISTENPORT --workerport $WORKERPORT --controllerport $CONTROLLERPORT &
 | 
|---|
| [404d2b] | 13 | server_pid=$!
 | 
|---|
 | 14 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | # add one SystemCommandJob via JobAdder
 | 
|---|
 | 17 | AT_CHECK([${AUTOTEST_PATH}/JobMarketController --server 127.0.0.1:$CONTROLLERPORT --command createjobs --executable "cat" --jobcommand "Nothing"], 0, [stdout], [ignore], [kill $server_pid])
 | 
|---|
 | 18 | AT_CHECK([fgrep "Sending 1 jobs ..." stdout], 0, [ignore], [ignore], [kill $server_pid])
 | 
|---|
 | 19 | 
 | 
|---|
| [ab2e834] | 20 | # add one NoOpJob
 | 
|---|
| [404d2b] | 21 | AT_CHECK([${AUTOTEST_PATH}/JobMarketController --server 127.0.0.1:$CONTROLLERPORT --command createjobs], 0, [stdout], [ignore], [kill $server_pid])
 | 
|---|
 | 22 | AT_CHECK([fgrep "Creating 1 new NoOpJob(s)." stdout], 0, [ignore], [ignore], [kill $server_pid])
 | 
|---|
 | 23 | AT_CHECK([fgrep "Sending 1 jobs ..." stdout], 0, [ignore], [ignore], [kill $server_pid])
 | 
|---|
 | 24 | 
 | 
|---|
 | 25 | # clear all waiting jobs
 | 
|---|
 | 26 | AT_CHECK([${AUTOTEST_PATH}/JobMarketController --server 127.0.0.1:$CONTROLLERPORT --command removealljobs], 0, [stdout], [ignore], [kill $server_pid])
 | 
|---|
 | 27 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
 | 
|---|
 | 28 | 
 | 
|---|
 | 29 | # shutdown
 | 
|---|
 | 30 | AT_CHECK([${AUTOTEST_PATH}/JobMarketController --server 127.0.0.1:$CONTROLLERPORT --command shutdown], 0, [ignore], [ignore], [kill $server_pid])
 | 
|---|
 | 31 | 
 | 
|---|
 | 32 | # check that server is truely down
 | 
|---|
 | 33 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
 | 
|---|
 | 34 | AT_CHECK([kill $server_pid $worker_pid], 1, [ignore], [ignore])
 | 
|---|
 | 35 | 
 | 
|---|
 | 36 | AT_CLEANUP
 | 
|---|