oslo.messaging/tools/functions.sh
Andrew Smith 3afc3a0a1d Update kafka functional test
This patch addresses a number of issues that prevented the functional
tests from running. The functional tests now execute and can complete
succesfully. At times, the test will fail (noticiably in CI) indicating
an underlying issue with consumer interaction with the kafka server.

It would be beneficial to merge this patch as it provides repeatability
and visibility for driver-kafka server integration to facilitate
additional debugging and testing.

This patch:

* removes use of deprecated get_transport
* override consumer_group for each test
* changed to synchronous send
* update to kafka 1.0.0 server

Depends-On: Ib552152e841a9fc0bffdcb7c3f7bc75613d0ed62
Change-Id: I7009a3b96ee250c177c10f5121eb73d908747a52
2017-12-16 14:41:03 -05:00

23 lines
393 B
Bash

wait_for_line () {
while read line
do
echo "$line" | grep -q "$1" && break
echo "$line" | grep "$2" && exit 1
done < "$3"
# Read the fifo for ever otherwise process would block
cat "$3" >/dev/null &
}
function clean_exit(){
local error_code="$?"
for job in `jobs -p`
do
kill -9 $job
done
rm -rf "$1"
return $error_code
}