github.com/rootless-containers/rootlesskit/v2@v2.3.4/hack/integration-net.sh (about)

     1  #!/bin/bash
     2  # Integration tests for network drivers.
     3  # See also: benchmark-iperf3-net.sh
     4  
     5  source $(realpath $(dirname $0))/common.inc.sh
     6  if [ $# -lt 1 ]; then
     7  	ERROR "Usage: $0 NETDRIVER [FLAGS...]"
     8  	exit 1
     9  fi
    10  net=$1
    11  shift 1
    12  flags=$@
    13  INFO "net=${net} flags=$@"
    14  
    15  # Test DNS
    16  set -x
    17  if [ "${net}" = "lxc-user-nic" ]; then
    18  	# ignore "lxc-net is already running" error
    19  	sudo /usr/lib/$(uname -m)-linux-gnu/lxc/lxc-net start || sudo /etc/init.d/lxc-net start || true
    20  fi
    21  $ROOTLESSKIT --net=${net} --copy-up=/etc --copy-up=/run --disable-host-loopback ${flags} -- nslookup example.com