github.com/containers/podman/v5@v5.1.0-rc1/test/compose/slirp4netns_opts/tests.sh (about)

     1  # -*- bash -*-
     2  
     3  expected="teststring"
     4  
     5  # Reading from the nc socket is flaky because docker-compose only starts
     6  # the containers. We cannot know at this point if the container did already
     7  # send the message. Give the container 5 seconds time to send the message
     8  # to prevent flakes.
     9  container_timeout=5
    10  while [ $container_timeout -gt 0 ]; do
    11      output="$(< $OUTFILE)"
    12      if [ -n "$output" ]; then
    13          break
    14      fi
    15      sleep 1
    16      container_timeout=$(($container_timeout - 1))
    17  done
    18  
    19  is "$output" "$expected" "$testname : nc received teststring"