OSDN Git Service

am b4cf7b30: Add switches for compressor
[android-x86/system-extras.git] / tests / net_test / net_test.sh
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.
7 ip link set lo up
8 ip link set lo mtu 16436
9 ip link set eth0 up
10
11 # Allow people to run ping.
12 echo "0 65536" > /proc/sys/net/ipv4/ping_group_range
13
14 # Fall out to a shell once the test completes or if there's an error.
15 trap "exec /bin/bash" ERR EXIT
16
17 # Find and run the test.
18 test=$(cat /proc/cmdline | sed -re 's/.*net_test=([^ ]*).*/\1/g')
19 echo -e "Running $test\n"
20 $test