### fragment the molecule and check the number of configs AT_SETUP([Fragmentation - Automation: Worker sets false hostname]) AT_KEYWORDS([fragmentation automation controller poolworker server falsehost]) WORKERPORT=11080 CONTROLLERPORT=11081 WORKERLISTENPORT=11082 TIMEOUT=3 # start service in background ${AUTOTEST_PATH}/JobMarketServer -v 5 --workerport $WORKERPORT --controllerport $CONTROLLERPORT --timeout $TIMEOUT & server_pid=$! AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid]) # let worker enroll in pool ${AUTOTEST_PATH}/JobMarketPoolWorker -v 5 --signal 2 --server 127.0.0.1:${WORKERPORT} --hostname falsehost --listen $WORKERLISTENPORT & worker_pid=$! AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid $worker_pid]) # remove worker: server will fail to resolve hostname and remove address from pool AT_CHECK([${AUTOTEST_PATH}/JobMarketController --server 127.0.0.1:$CONTROLLERPORT --command removeall], 0, [ignore], [ignore], [kill $server_pid $worker_pid]) AT_CHECK([sleep 4], 0, [ignore], [ignore], [kill $server_pid $worker_pid]) AT_CHECK([kill -s 0 $server_pid], 0, [ignore], [ignore], [kill $server_pid $worker_pid]) AT_CHECK([kill -s 0 $worker_pid], 0, [ignore], [ignore], [kill $server_pid $worker_pid]) # shutdown server, should terminate as no workers are left AT_CHECK([${AUTOTEST_PATH}/JobMarketController --server 127.0.0.1:$CONTROLLERPORT --command shutdown], 0, [ignore], [ignore], [kill $server_pid $worker_pid]) # we have to kill worker as he cannot know that Server is gone AT_CHECK([kill $worker_pid], 0, [ignore], [ignore], [kill $server_pid $worker_pid]) # check that Server is truly down AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid $worker_pid]) AT_CHECK([kill $server_pid], 1, [ignore], [ignore], [kill $worker_pid]) AT_CHECK([kill $worker_pid], 1, [ignore], [ignore]) AT_CLEANUP