summaryrefslogtreecommitdiff
path: root/test/compose/slirp4netns_opts/tests.sh
blob: 2d41311ad8fb012c03da20f753c599ba8cd58a94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- bash -*-

expected="teststring"

# Reading from the nc socket is flaky because docker-compose only starts
# the containers. We cannot know at this point if the container did already
# send the message. Give the container 5 seconds time to send the message
# to prevent flakes.
container_timeout=5
while [ $container_timeout -gt 0 ]; do
    output="$(< $OUTFILE)"
    if [ -n "$output" ]; then
        break
    fi
    sleep 1
    container_timeout=$(($container_timeout - 1))
done

is "$output" "$expected" "$testname : nc received teststring"