File: setup.sh

package info (click to toggle)
libnet 1.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,808 kB
  • sloc: ansic: 19,531; makefile: 290; sh: 94; ruby: 8
file content (16 lines) | stat: -rwxr-xr-x 399 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
# Set up a virtual world in an unshare for the unit tests to run in.

# http://staskobzar.blogspot.com/2017/04/test-anything-protocol-tap-with.html
export CMOCKA_MESSAGE_OUTPUT=TAP

if [ $(uname) = Linux ]; then
    ip link add eth0 type dummy
    ip link set eth0 up
    ip link set lo up

    ip addr  add 192.168.2.200/24 dev eth0
    ip route add default via 192.168.2.1
fi

exec "$@"