1#!/bin/bash
2
3# In case IPv6 is compiled as a module.
4[ -f /proc/net/if_inet6 ] || insmod $DIR/kernel/net-next/net/ipv6/ipv6.ko
5
6# Minimal network setup.
7ip link set lo up
8ip link set lo mtu 16436
9ip link set eth0 up
10
11# Allow people to run ping.
12echo "0 65536" > /proc/sys/net/ipv4/ping_group_range
13
14# Read environment variables passed to the kernel to determine if script is
15# running on builder and to find which test to run.
16
17if [ "$net_test_mode" != "builder" ]; then
18  # Fall out to a shell once the test completes or if there's an error.
19  trap "exec /bin/bash" ERR EXIT
20fi
21
22echo -e "Running $net_test $net_test_args\n"
23$net_test $net_test_args
24
25# Write exit code of net_test to /proc/exitcode so that the builder can use it
26# to signal failure if any tests fail.
27echo $? >/proc/exitcode
28