Skip to content

Commit 65d88d0

Browse files
zx2c4davem330
authored andcommitted
wireguard: selftests: import harness makefile for test suite
WireGuard has been using this on build.wireguard.com for the last several years with considerable success. It allows for very quick and iterative development cycles, and supports several platforms. To run the test suite on your current platform in QEMU: $ make -C tools/testing/selftests/wireguard/qemu -j$(nproc) To run it with KASAN and such turned on: $ DEBUG_KERNEL=yes make -C tools/testing/selftests/wireguard/qemu -j$(nproc) To run it emulated for another platform in QEMU: $ ARCH=arm make -C tools/testing/selftests/wireguard/qemu -j$(nproc) At the moment, we support aarch64_be, aarch64, arm, armeb, i686, m68k, mips64, mips64el, mips, mipsel, powerpc64le, powerpc, and x86_64. The system supports incremental rebuilding, so it should be very fast to change a single file and then test it out and have immediate feedback. This requires for the right toolchain and qemu to be installed prior. I've had success with those from musl.cc. This is tailored for WireGuard at the moment, though later projects might generalize it for other network testing. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c5dea81 commit 65d88d0

18 files changed

Lines changed: 947 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
distfiles/

‎tools/testing/selftests/wireguard/qemu/Makefile‎

Lines changed: 385 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONFIG_SERIAL_AMBA_PL011=y
2+
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
3+
CONFIG_CMDLINE_BOOL=y
4+
CONFIG_CMDLINE="console=ttyAMA0 wg.success=ttyAMA1"
5+
CONFIG_FRAME_WARN=1280
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CONFIG_CPU_BIG_ENDIAN=y
2+
CONFIG_SERIAL_AMBA_PL011=y
3+
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
4+
CONFIG_CMDLINE_BOOL=y
5+
CONFIG_CMDLINE="console=ttyAMA0 wg.success=ttyAMA1"
6+
CONFIG_FRAME_WARN=1280
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_MMU=y
2+
CONFIG_ARCH_MULTI_V7=y
3+
CONFIG_ARCH_VIRT=y
4+
CONFIG_THUMB2_KERNEL=n
5+
CONFIG_SERIAL_AMBA_PL011=y
6+
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
7+
CONFIG_CMDLINE_BOOL=y
8+
CONFIG_CMDLINE="console=ttyAMA0 wg.success=ttyAMA1"
9+
CONFIG_FRAME_WARN=1024
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CONFIG_MMU=y
2+
CONFIG_ARCH_MULTI_V7=y
3+
CONFIG_ARCH_VIRT=y
4+
CONFIG_THUMB2_KERNEL=n
5+
CONFIG_SERIAL_AMBA_PL011=y
6+
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
7+
CONFIG_CMDLINE_BOOL=y
8+
CONFIG_CMDLINE="console=ttyAMA0 wg.success=ttyAMA1"
9+
CONFIG_CPU_BIG_ENDIAN=y
10+
CONFIG_FRAME_WARN=1024
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONFIG_SERIAL_8250=y
2+
CONFIG_SERIAL_8250_CONSOLE=y
3+
CONFIG_CMDLINE_BOOL=y
4+
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1"
5+
CONFIG_FRAME_WARN=1024
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_MMU=y
2+
CONFIG_M68040=y
3+
CONFIG_MAC=y
4+
CONFIG_SERIAL_PMACZILOG=y
5+
CONFIG_SERIAL_PMACZILOG_TTYS=y
6+
CONFIG_SERIAL_PMACZILOG_CONSOLE=y
7+
CONFIG_CMDLINE_BOOL=y
8+
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1"
9+
CONFIG_FRAME_WARN=1024
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CONFIG_CPU_MIPS32_R2=y
2+
CONFIG_MIPS_MALTA=y
3+
CONFIG_MIPS_CPS=y
4+
CONFIG_MIPS_FP_SUPPORT=y
5+
CONFIG_POWER_RESET=y
6+
CONFIG_POWER_RESET_SYSCON=y
7+
CONFIG_SERIAL_8250=y
8+
CONFIG_SERIAL_8250_CONSOLE=y
9+
CONFIG_CMDLINE_BOOL=y
10+
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1"
11+
CONFIG_FRAME_WARN=1024
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CONFIG_64BIT=y
2+
CONFIG_CPU_MIPS64_R2=y
3+
CONFIG_MIPS32_N32=y
4+
CONFIG_CPU_HAS_MSA=y
5+
CONFIG_MIPS_MALTA=y
6+
CONFIG_MIPS_CPS=y
7+
CONFIG_MIPS_FP_SUPPORT=y
8+
CONFIG_POWER_RESET=y
9+
CONFIG_POWER_RESET_SYSCON=y
10+
CONFIG_SERIAL_8250=y
11+
CONFIG_SERIAL_8250_CONSOLE=y
12+
CONFIG_CMDLINE_BOOL=y
13+
CONFIG_CMDLINE="console=ttyS0 wg.success=ttyS1"
14+
CONFIG_FRAME_WARN=1280

0 commit comments

Comments
 (0)