File: check-10-network.sh

package info (click to toggle)
libreswan 5.2-2.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 81,632 kB
  • sloc: ansic: 129,988; sh: 32,018; xml: 20,646; python: 10,303; makefile: 3,022; javascript: 1,506; sed: 574; yacc: 511; perl: 264; awk: 52
file content (82 lines) | stat: -rwxr-xr-x 1,694 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/sh

basedir=testing/pluto/$(basename $0 .sh)
hosts="east west rise set"
oss="netbsd freebsd openbsd fedora"

# where am I
if test ! testing/pluto ; then
    echo confused $basedir
    exit 1
fi

for os in ${oss} ; do

    dir=${basedir}-${os}
    echo ${dir}

    mkdir -p ${dir}

    cat <<EOF > ${dir}/description.txt
test network connectivity between the ${os} domains RISE and SET

... along with the generic EAST and WEST domains

this test was generated by $0
EOF

    for h in ${hosts} ; do
	touch ${dir}/${host}.console.txt
    done

    # start again
    rm -f ${dir}/*.sh

    n=1
    case $os in
	netbsd )  eth=vioif ; ifconfig=ifconfig ;;
	openbsd ) eth=vio   ; ifconfig=ifconfig ;;
	freebsd ) eth=vtnet ; ifconfig=ifconfig ;;
	* )       eth=eth   ; ifconfig="ip link set" ;;
    esac

    n=1

    # bring up all the networks

    # bring up all the networks
    for h in east west ; do
	cat <<EOF > ${dir}/0${n}-${h}-ifconfig.sh
../../guestbin/ip.sh addr show eth0
../../guestbin/ip.sh link set eth0 up
../../guestbin/ip.sh addr show eth1
../../guestbin/ip.sh link set eth1 up
EOF
	n=$((n + 1))
    done

    for h in rise set ; do
	cat <<EOF > ${dir}/0${n}-${os}${h}-ifconfig.sh
${ifconfig} ${eth}1
${ifconfig} ${eth}1 up
${ifconfig} ${eth}2
${ifconfig} ${eth}2 up
EOF
	n=$((n + 1))
    done

    # check connectivity

    cat <<EOF > ${dir}/0${n}-${os}rise-ping.sh
../../guestbin/ping-once.sh --up 198.18.1.145 # SET
../../guestbin/ping-once.sh --up 192.0.2.254  # EAST
EOF
    n=$((n + 1))

    cat <<EOF > ${dir}/0${n}-${os}set-ping.sh
../../guestbin/ping-once.sh --up 198.18.1.123 # RISE
../../guestbin/ping-once.sh --up 192.0.1.254  # WEST
EOF
    n=$((n + 1))

done