1 | ### fragment the molecule and check the number of configs
|
---|
2 |
|
---|
3 | AT_SETUP([Fragmentation - Automation])
|
---|
4 | AT_KEYWORDS([fragmentation automation worker])
|
---|
5 |
|
---|
6 | WORKERPORT=1025
|
---|
7 | CONTROLLERPORT=1026
|
---|
8 |
|
---|
9 | # start service in background
|
---|
10 | ${AUTOTEST_PATH}/Fragmentation/Automation/Server $WORKERPORT $CONTROLLERPORT &
|
---|
11 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [pkill Server])
|
---|
12 |
|
---|
13 | # add a job
|
---|
14 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/JobAdder 127.0.0.1 $CONTROLLERPORT 1], 0, [stdout], [ignore], [pkill Server])
|
---|
15 | # first worker has a job
|
---|
16 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Worker 127.0.0.1 $WORKERPORT], 0, [stdout], [ignore], [pkill Server])
|
---|
17 | AT_CHECK([fgrep "Job id: 1" stdout], 0, [ignore], [ignore], [pkill Server])
|
---|
18 |
|
---|
19 | # add no job to shutdown socket
|
---|
20 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/JobAdder 127.0.0.1 $CONTROLLERPORT 0], 0, [stdout], [ignore], [pkill Server])
|
---|
21 | # third job has none
|
---|
22 | AT_CHECK([${AUTOTEST_PATH}/Fragmentation/Automation/Worker 127.0.0.1 $WORKERPORT], 1, [stdout], [ignore], [pkill Server])
|
---|
23 | AT_CHECK([fgrep "The server has no job for me" stdout], 0, [ignore], [ignore], [pkill Server])
|
---|
24 |
|
---|
25 | # check that server is truely down
|
---|
26 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [pkill Server])
|
---|
27 | AT_CHECK([pkill Server], 1, [ignore], [ignore])
|
---|
28 |
|
---|
29 | AT_CLEANUP
|
---|