Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
rootfs/ | 03-May-2024 | - | 1,231 | 794 | ||
.gitignore | D | 03-May-2024 | 24 | 3 | 2 | |
Android.bp | D | 03-May-2024 | 501 | 25 | 23 | |
OWNERS | D | 03-May-2024 | 150 | 6 | 4 | |
README | D | 03-May-2024 | 2.6 KiB | 78 | 51 | |
TEST_MAPPING | D | 03-May-2024 | 152 | 13 | 12 | |
all_tests.py | D | 03-May-2024 | 2 KiB | 73 | 45 | |
all_tests.sh | D | 03-May-2024 | 2.7 KiB | 121 | 80 | |
anycast_test.py | D | 03-May-2024 | 3.4 KiB | 123 | 70 | |
bpf.py | D | 03-May-2024 | 9.7 KiB | 369 | 256 | |
bpf_test.py | D | 03-May-2024 | 22.2 KiB | 613 | 421 | |
build_rootfs.sh | D | 03-May-2024 | 19.7 KiB | 552 | 431 | |
csocket.py | D | 03-May-2024 | 11.1 KiB | 374 | 255 | |
csocket_test.py | D | 03-May-2024 | 2.7 KiB | 95 | 58 | |
cstruct.py | D | 03-May-2024 | 10.7 KiB | 304 | 211 | |
cstruct_test.py | D | 03-May-2024 | 7.7 KiB | 197 | 144 | |
genetlink.py | D | 03-May-2024 | 3.9 KiB | 125 | 71 | |
iproute.py | D | 03-May-2024 | 27 KiB | 781 | 601 | |
leak_test.py | D | 03-May-2024 | 2.7 KiB | 86 | 41 | |
multinetwork_base.py | D | 03-May-2024 | 26.2 KiB | 772 | 544 | |
multinetwork_test.py | D | 03-May-2024 | 48.8 KiB | 1,311 | 910 | |
namespace.py | D | 03-May-2024 | 6.9 KiB | 201 | 123 | |
neighbour_test.py | D | 03-May-2024 | 13.5 KiB | 384 | 264 | |
net_test.py | D | 03-May-2024 | 15.4 KiB | 545 | 388 | |
net_test.sh | D | 03-May-2024 | 5.5 KiB | 193 | 111 | |
netlink.py | D | 03-May-2024 | 9.6 KiB | 312 | 202 | |
netlink_test.py | D | 03-May-2024 | 1.3 KiB | 43 | 19 | |
nf_test.py | D | 03-May-2024 | 2.8 KiB | 88 | 44 | |
no_test | D | 03-May-2024 | 12 | 2 | 0 | |
packets.py | D | 03-May-2024 | 7.1 KiB | 204 | 155 | |
parallel_tests.sh | D | 03-May-2024 | 1.4 KiB | 63 | 44 | |
parameterization_test.py | D | 03-May-2024 | 2.5 KiB | 84 | 44 | |
pf_key.py | D | 03-May-2024 | 10.6 KiB | 338 | 249 | |
pf_key_test.py | D | 03-May-2024 | 4.5 KiB | 117 | 77 | |
ping6_test.py | D | 03-May-2024 | 31.9 KiB | 919 | 671 | |
ping6_test.sh | D | 03-May-2024 | 266 | 17 | 5 | |
policy_crash_test.py | D | 03-May-2024 | 4.9 KiB | 137 | 45 | |
removed_feature_test.py | D | 03-May-2024 | 3.4 KiB | 102 | 64 | |
resilient_rs_test.py | D | 03-May-2024 | 5.6 KiB | 178 | 108 | |
run_net_test.sh | D | 03-May-2024 | 17.5 KiB | 496 | 339 | |
sock_diag.py | D | 03-May-2024 | 14.5 KiB | 433 | 328 | |
sock_diag_test.py | D | 03-May-2024 | 44.2 KiB | 1,144 | 853 | |
srcaddr_selection_test.py | D | 03-May-2024 | 14.6 KiB | 359 | 206 | |
sysctls_test.py | D | 03-May-2024 | 1.7 KiB | 48 | 22 | |
tcp_fastopen_test.py | D | 03-May-2024 | 4.8 KiB | 143 | 92 | |
tcp_metrics.py | D | 03-May-2024 | 4.5 KiB | 139 | 93 | |
tcp_nuke_addr_test.py | D | 03-May-2024 | 3.4 KiB | 112 | 73 | |
tcp_repair_test.py | D | 03-May-2024 | 11.8 KiB | 342 | 245 | |
tcp_test.py | D | 03-May-2024 | 4.6 KiB | 138 | 89 | |
tun_twister.py | D | 03-May-2024 | 7.3 KiB | 215 | 159 | |
util.py | D | 03-May-2024 | 2.7 KiB | 72 | 37 | |
vts_kernel_net_tests.xml | D | 03-May-2024 | 1.4 KiB | 31 | 14 | |
xfrm.py | D | 03-May-2024 | 27.5 KiB | 772 | 554 | |
xfrm_algorithm_test.py | D | 03-May-2024 | 15.1 KiB | 397 | 283 | |
xfrm_base.py | D | 03-May-2024 | 11.2 KiB | 331 | 222 | |
xfrm_test.py | D | 03-May-2024 | 41.3 KiB | 1,011 | 682 | |
xfrm_tunnel_test.py | D | 03-May-2024 | 44.6 KiB | 1,149 | 769 |
README
1 net_test v0.1 2 ============= 3 4A simple framework for blackbox testing of kernel networking code. 5 6 7Why use it? 8=========== 9 10- Fast test / boot cycle. 11- Access to host filesystem and networking via L2 bridging. 12- Full Linux userland including Python, etc. 13- Kernel bugs don't crash the system. 14 15 16How to use it 17============= 18 19cd <kerneldir> 20path/to/net_test/run_net_test.sh <test> 21 22where <test> is the name of a test binary in the net_test directory. This can 23be an x86 binary, a shell script, a Python script. etc. 24 25 26How it works 27============ 28 29net_test compiles the kernel to a user-mode linux binary, which runs as a 30process on the host machine. It runs the binary to start a Linux "virtual 31machine" whose root filesystem is the supplied Debian disk image. The machine 32boots, mounts the root filesystem read-only, runs the specified test from init, and then drops to a shell. 33 34 35Access to host filesystem 36========================= 37 38The VM mounts the host filesystem at /host, so the test can be modified and 39re-run without rebooting the VM. 40 41 42Access to host networking 43========================= 44 45Access to host networking is provided by tap interfaces. On the host, the 46interfaces are named <user>TAP0, <user>TAP1, etc., where <user> is the first 4710 characters of the username running net_test. (10 characters because 48IFNAMSIZ = 16). On the guest, they are named eth0, eth1, etc. 49 50net_test does not do any networking setup beyond creating the tap interfaces. 51IP connectivity can be provided on the host side by setting up a DHCP server 52and NAT, sending IPv6 router advertisements, etc. By default, the VM has IPv6 53privacy addresses disabled, so its IPv6 addresses can be predicted using a tool 54such as ipv6calc. 55 56The provided filesystem contains a DHCPv4 client and simple networking 57utilities such as ping[6], traceroute[6], and wget. 58 59The number of tap interfaces is currently hardcoded to two. To change this 60number, modify run_net_test.sh. 61 62 63Logging into the VM, installing packages, etc. 64============================================== 65 66net_test mounts the root filesystem read-only, and runs the test from init, but 67since the filesystem contains a full Linux userland, it's possible to boot into 68userland and modify the filesystem, for example to install packages using 69apt-get install. Log in as root with no password. By default, the filesystem is 70configured to perform DHCPv4 on eth0 and listen to RAs. 71 72 73Bugs 74==== 75 76Since the test mounts the filesystem read-only, tests cannot modify 77/etc/resolv.conf and the system resolver is hardcoded to 8.8.8.8. 78