Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
rootfs/ | 03-May-2024 | - | 262 | 140 | ||
.gitignore | D | 03-May-2024 | 24 | 3 | 2 | |
Android.bp | D | 03-May-2024 | 1.1 KiB | 40 | 36 | |
OWNERS | D | 03-May-2024 | 35 | 3 | 2 | |
README | D | 03-May-2024 | 2.6 KiB | 78 | 51 | |
all_tests.py | D | 03-May-2024 | 2.1 KiB | 73 | 47 | |
all_tests.sh | D | 03-May-2024 | 2.5 KiB | 117 | 79 | |
anycast_test.py | D | 03-May-2024 | 3.4 KiB | 121 | 68 | |
bpf.py | D | 03-May-2024 | 9.5 KiB | 365 | 256 | |
bpf_test.py | D | 03-May-2024 | 22 KiB | 601 | 430 | |
build_all_rootfs.sh | D | 03-May-2024 | 776 | 27 | 7 | |
build_rootfs.sh | D | 03-May-2024 | 3.8 KiB | 159 | 106 | |
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 | 9.4 KiB | 279 | 200 | |
cstruct_test.py | D | 03-May-2024 | 7.3 KiB | 190 | 138 | |
forwarding_test.py | D | 03-May-2024 | 6.2 KiB | 173 | 111 | |
genetlink.py | D | 03-May-2024 | 3.8 KiB | 124 | 71 | |
iproute.py | D | 03-May-2024 | 26.9 KiB | 778 | 600 | |
leak_test.py | D | 03-May-2024 | 2.7 KiB | 85 | 40 | |
multinetwork_base.py | D | 03-May-2024 | 26 KiB | 764 | 538 | |
multinetwork_test.py | D | 03-May-2024 | 49.5 KiB | 1,315 | 911 | |
namespace.py | D | 03-May-2024 | 5.3 KiB | 167 | 105 | |
neighbour_test.py | D | 03-May-2024 | 14.1 KiB | 392 | 268 | |
net_test.py | D | 03-May-2024 | 13.5 KiB | 486 | 335 | |
net_test.sh | D | 03-May-2024 | 4.9 KiB | 174 | 99 | |
netlink.py | D | 03-May-2024 | 8.6 KiB | 282 | 185 | |
nf_test.py | D | 03-May-2024 | 2.8 KiB | 86 | 42 | |
no_test | D | 03-May-2024 | 12 | 2 | 0 | |
packets.py | D | 03-May-2024 | 7.2 KiB | 207 | 156 | |
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.4 KiB | 331 | 244 | |
pf_key_test.py | D | 03-May-2024 | 4 KiB | 100 | 63 | |
ping6_test.py | D | 03-May-2024 | 32 KiB | 877 | 621 | |
ping6_test.sh | D | 03-May-2024 | 266 | 17 | 5 | |
policy_crash_test.py | D | 03-May-2024 | 4.8 KiB | 136 | 44 | |
qtaguid_test.py | D | 03-May-2024 | 8.4 KiB | 229 | 183 | |
removed_feature_test.py | D | 03-May-2024 | 3.2 KiB | 95 | 58 | |
resilient_rs_test.py | D | 03-May-2024 | 5.5 KiB | 173 | 105 | |
run_net_test.sh | D | 03-May-2024 | 15.8 KiB | 462 | 324 | |
sock_diag.py | D | 03-May-2024 | 14.5 KiB | 434 | 330 | |
sock_diag_test.py | D | 03-May-2024 | 45.7 KiB | 1,179 | 885 | |
srcaddr_selection_test.py | D | 03-May-2024 | 14.9 KiB | 365 | 208 | |
sysctls_test.py | D | 03-May-2024 | 1.4 KiB | 44 | 18 | |
tcp_fastopen_test.py | D | 03-May-2024 | 4.5 KiB | 133 | 86 | |
tcp_metrics.py | D | 03-May-2024 | 4.4 KiB | 138 | 92 | |
tcp_nuke_addr_test.py | D | 03-May-2024 | 3.5 KiB | 113 | 74 | |
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.6 KiB | 35 | 17 | |
xfrm.py | D | 03-May-2024 | 27.4 KiB | 769 | 552 | |
xfrm_algorithm_test.py | D | 03-May-2024 | 15 KiB | 397 | 283 | |
xfrm_base.py | D | 03-May-2024 | 11 KiB | 326 | 218 | |
xfrm_test.py | D | 03-May-2024 | 36.9 KiB | 905 | 610 | |
xfrm_tunnel_test.py | D | 03-May-2024 | 42.4 KiB | 1,093 | 739 |
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