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>
2019-12-15 22:08:00 +01:00
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
PWD := $( shell pwd )
CHOST := $( shell gcc -dumpmachine)
2020-01-02 17:47:49 +01:00
HOST_ARCH := $( firstword $( subst -, ,$( CHOST) ) )
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>
2019-12-15 22:08:00 +01:00
i f n e q ( , $( ARCH ) )
CBUILD := $( subst -gcc,,$( lastword $( subst /, ,$( firstword $( wildcard $( foreach bindir,$( subst :, ,$( PATH) ) ,$( bindir) /$( ARCH) -*-gcc) ) ) ) ) )
i f e q ( , $( CBUILD ) )
$( error The toolchain for $ ( ARCH ) is not installed )
e n d i f
e l s e
CBUILD := $( CHOST)
ARCH := $( firstword $( subst -, ,$( CBUILD) ) )
e n d i f
# Set these from the environment to override
KERNEL_PATH ?= $( PWD) /../../../../..
BUILD_PATH ?= $( PWD) /build/$( ARCH)
DISTFILES_PATH ?= $( PWD) /distfiles
NR_CPUS ?= 4
MIRROR := https://download.wireguard.com/qemu-test/distfiles/
default : qemu
# variable name, tarball project name, version, tarball extension, default URI base
d e f i n e tar_download =
$(1)_VERSION := $( 3)
$(1)_NAME := $( 2) -$$ ( $( 1) _VERSION)
$(1)_TAR := $( DISTFILES_PATH) /$$ ( $( 1) _NAME) $( 4)
$(1)_PATH := $( BUILD_PATH) /$$ ( $( 1) _NAME)
$( call file_download ,$ $ ( $ ( 1) _NAME ) $ ( 4) ,$ ( 5) ,$ ( 6) )
e n d e f
d e f i n e file_download =
$(DISTFILES_PATH)/$(1) :
mkdir -p $( DISTFILES_PATH)
2020-02-14 23:57:20 +01:00
flock -x $$ @.lock -c '[ -f $$@ ] && exit 0; wget -O $$@.tmp $(MIRROR)$(1) || wget -O $$@.tmp $(2)$(1) || rm -f $$@.tmp; [ -f $$@.tmp ] || exit 1; if echo "$(3) $$@.tmp" | sha256sum -c -; then mv $$@.tmp $$@; else rm -f $$@.tmp; exit 71; fi'
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>
2019-12-15 22:08:00 +01:00
e n d e f
2020-03-18 18:30:44 -06:00
$(eval $(call tar_download,MUSL,musl,1.2.0,.tar.gz,https : //musl .libc .org /releases /, c 6de 7b 191139142d 3f 9a 7b 5b 702c 9cae 1b 5ee 6e 7f 57e 582da 9328629408fd 4e 8))
2020-01-02 17:47:49 +01:00
$(eval $(call tar_download,IPERF,iperf,3.7,.tar.gz,https : //downloads .es .net /pub /iperf /, d 846040224317caf 2f 75c 843d 309a 950a 7db 23f 9b 44b 94688ccbe 557d 6d 1710c ))
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>
2019-12-15 22:08:00 +01:00
$(eval $(call tar_download,BASH,bash,5.0,.tar.gz,https : //ftp .gnu .org /gnu /bash /, b 4a 80f 2ac 66170b 2913efbfb 9f 2594f 1f 76c 7b 1afd 11f 799e 22035d 63077fb 4d ))
2020-05-19 22:49:27 -06:00
$(eval $(call tar_download,IPROUTE2,iproute2,5.6.0,.tar.xz,https : //www .kernel .org /pub /linux /utils /net /iproute 2/, 1b 5b 0e 25ce 6e 23da 7526ea 1da 044e 814ad 85ba 761b 10dd 29c 2b 027c 056b 04692))
2020-01-02 17:47:49 +01:00
$(eval $(call tar_download,IPTABLES,iptables,1.8.4,.tar.bz2,https : //www .netfilter .org /projects /iptables /files /, 993a 3a 5490a 544c 2cbf 2ef 15cf 7e 7ed 21af 1845baf 228318d 5c 36ef 8827e 157c ))
$(eval $(call tar_download,NMAP,nmap,7.80,.tar.bz2,https : //nmap .org /dist /, fcfa 5a 0e 42099e 12e 4bf 7a 68ebe 6fde 05553383a 682e 816a 7ec 9256ab 4773faa ))
$(eval $(call tar_download,IPUTILS,iputils,s20190709,.tar.gz,https : //github .com /iputils /iputils /archive /s 20190709.tar .gz /#,a15720dd741d7538dd2645f9f516d193636ae4300ff7dbc8bfca757bf166490a))
2020-02-14 23:57:20 +01:00
$(eval $(call tar_download,WIREGUARD_TOOLS,wireguard-tools,1.0.20200206,.tar.xz,https : //git .zx 2c 4.com /wireguard -tools /snapshot /, f 5207248c 6a 3c 3e 3bfc 9ab 30b 91c 1897b 00802ed 861e 1f 9faaed 873366078c 64))
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>
2019-12-15 22:08:00 +01:00
KERNEL_BUILD_PATH := $( BUILD_PATH) /kernel$( if $( findstring yes,$( DEBUG_KERNEL) ) ,-debug)
rwildcard = $( foreach d,$( wildcard $1 *) ,$( call rwildcard,$d /,$2 ) $( filter $( subst *,%,$2 ) ,$d ) )
WIREGUARD_SOURCES := $( call rwildcard,$( KERNEL_PATH) /drivers/net/wireguard/,*)
export CFLAGS ?= -O3 -pipe
export LDFLAGS ?=
export CPPFLAGS := -I$( BUILD_PATH) /include
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
CROSS_COMPILE_FLAG := --host= $( CHOST)
CFLAGS += -march= native
STRIP := strip
e l s e
$(info Cross compilation : building for $( CBUILD ) using $( CHOST ) )
CROSS_COMPILE_FLAG := --build= $( CBUILD) --host= $( CHOST)
export CROSS_COMPILE = $( CBUILD) -
STRIP := $( CBUILD) -strip
e n d i f
i f e q ( $( ARCH ) , a a r c h 6 4 )
QEMU_ARCH := aarch64
KERNEL_ARCH := arm64
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /arch/arm64/boot/Image
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host -machine virt,gic_version= host,accel= kvm
e l s e
QEMU_MACHINE := -cpu cortex-a53 -machine virt
CFLAGS += -march= armv8-a -mtune= cortex-a53
e n d i f
e l s e i f e q ( $( ARCH ) , a a r c h 6 4 _ b e )
QEMU_ARCH := aarch64
KERNEL_ARCH := arm64
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /arch/arm64/boot/Image
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host -machine virt,gic_version= host,accel= kvm
e l s e
QEMU_MACHINE := -cpu cortex-a53 -machine virt
CFLAGS += -march= armv8-a -mtune= cortex-a53
e n d i f
e l s e i f e q ( $( ARCH ) , a r m )
QEMU_ARCH := arm
KERNEL_ARCH := arm
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /arch/arm/boot/zImage
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host -machine virt,gic_version= host,accel= kvm
e l s e
QEMU_MACHINE := -cpu cortex-a15 -machine virt
CFLAGS += -march= armv7-a -mtune= cortex-a15 -mabi= aapcs-linux
e n d i f
e l s e i f e q ( $( ARCH ) , a r m e b )
QEMU_ARCH := arm
KERNEL_ARCH := arm
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /arch/arm/boot/zImage
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host -machine virt,gic_version= host,accel= kvm
e l s e
QEMU_MACHINE := -cpu cortex-a15 -machine virt
CFLAGS += -march= armv7-a -mabi= aapcs-linux # We don't pass -mtune=cortex-a15 due to a compiler bug on big endian.
LDFLAGS += -Wl,--be8
e n d i f
e l s e i f e q ( $( ARCH ) , x 8 6 _ 6 4 )
QEMU_ARCH := x86_64
KERNEL_ARCH := x86_64
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /arch/x86/boot/bzImage
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host -machine q35,accel= kvm
e l s e
QEMU_MACHINE := -cpu Skylake-Server -machine q35
CFLAGS += -march= skylake-avx512
e n d i f
e l s e i f e q ( $( ARCH ) , i 6 8 6 )
QEMU_ARCH := i386
KERNEL_ARCH := x86
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /arch/x86/boot/bzImage
2020-01-02 17:47:49 +01:00
i f e q ( $( subst x 86_ 64,i 686,$ ( HOST_ARCH ) ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host -machine q35,accel= kvm
e l s e
QEMU_MACHINE := -cpu coreduo -machine q35
CFLAGS += -march= prescott
e n d i f
e l s e i f e q ( $( ARCH ) , m i p s 6 4 )
QEMU_ARCH := mips64
KERNEL_ARCH := mips
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /vmlinux
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host -machine malta,accel= kvm
CFLAGS += -EB
e l s e
QEMU_MACHINE := -cpu MIPS64R2-generic -machine malta -smp 1
CFLAGS += -march= mips64r2 -EB
e n d i f
e l s e i f e q ( $( ARCH ) , m i p s 6 4 e l )
QEMU_ARCH := mips64el
KERNEL_ARCH := mips
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /vmlinux
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host -machine malta,accel= kvm
CFLAGS += -EL
e l s e
QEMU_MACHINE := -cpu MIPS64R2-generic -machine malta -smp 1
CFLAGS += -march= mips64r2 -EL
e n d i f
e l s e i f e q ( $( ARCH ) , m i p s )
QEMU_ARCH := mips
KERNEL_ARCH := mips
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /vmlinux
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host -machine malta,accel= kvm
CFLAGS += -EB
e l s e
QEMU_MACHINE := -cpu 24Kf -machine malta -smp 1
CFLAGS += -march= mips32r2 -EB
e n d i f
e l s e i f e q ( $( ARCH ) , m i p s e l )
QEMU_ARCH := mipsel
KERNEL_ARCH := mips
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /vmlinux
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host -machine malta,accel= kvm
CFLAGS += -EL
e l s e
QEMU_MACHINE := -cpu 24Kf -machine malta -smp 1
CFLAGS += -march= mips32r2 -EL
e n d i f
e l s e i f e q ( $( ARCH ) , p o w e r p c 6 4 l e )
QEMU_ARCH := ppc64
KERNEL_ARCH := powerpc
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /vmlinux
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host,accel= kvm -machine pseries
e l s e
QEMU_MACHINE := -machine pseries
e n d i f
CFLAGS += -mcpu= powerpc64le -mlong-double-64
e l s e i f e q ( $( ARCH ) , p o w e r p c )
QEMU_ARCH := ppc
KERNEL_ARCH := powerpc
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /arch/powerpc/boot/uImage
2020-01-02 17:47:49 +01:00
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
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>
2019-12-15 22:08:00 +01:00
QEMU_MACHINE := -cpu host,accel= kvm -machine ppce500
e l s e
QEMU_MACHINE := -machine ppce500
e n d i f
CFLAGS += -mcpu= powerpc -mlong-double-64 -msecure-plt
e l s e i f e q ( $( ARCH ) , m 6 8 k )
QEMU_ARCH := m68k
KERNEL_ARCH := m68k
KERNEL_BZIMAGE := $( KERNEL_BUILD_PATH) /vmlinux
2020-01-02 17:47:49 +01:00
KERNEL_CMDLINE := $( shell sed -n 's/CONFIG_CMDLINE=\(.*\)/\1/p' arch/m68k.config)
i f e q ( $( HOST_ARCH ) , $( ARCH ) )
QEMU_MACHINE := -cpu host,accel= kvm -machine q800 -smp 1 -append $( KERNEL_CMDLINE)
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>
2019-12-15 22:08:00 +01:00
e l s e
2020-01-02 17:47:49 +01:00
QEMU_MACHINE := -machine q800 -smp 1 -append $( KERNEL_CMDLINE)
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>
2019-12-15 22:08:00 +01:00
e n d i f
e l s e
$(error I only build : x 86_ 64, i 686, arm , armeb , aarch 64, aarch 64_be , mips , mipsel , mips 64, mips 64el , powerpc 64le , powerpc , m 68k )
e n d i f
REAL_CC := $( CBUILD) -gcc
MUSL_CC := $( BUILD_PATH) /musl-gcc
export CC := $( MUSL_CC)
USERSPACE_DEPS := $( MUSL_CC) $( BUILD_PATH) /include/.installed $( BUILD_PATH) /include/linux/.installed
build : $( KERNEL_BZIMAGE )
qemu : $( KERNEL_BZIMAGE )
rm -f $( BUILD_PATH) /result
timeout --foreground 20m qemu-system-$( QEMU_ARCH) \
-nodefaults \
-nographic \
-smp $( NR_CPUS) \
$( QEMU_MACHINE) \
-m $$ ( grep -q CONFIG_DEBUG_KMEMLEAK = y $( KERNEL_BUILD_PATH) /.config && echo 1G || echo 256M) \
-serial stdio \
-serial file:$( BUILD_PATH) /result \
-no-reboot \
-monitor none \
-kernel $<
grep -Fq success $( BUILD_PATH) /result
$(BUILD_PATH)/init-cpio-spec.txt :
mkdir -p $( BUILD_PATH)
echo " file /init $( BUILD_PATH) /init 755 0 0 " > $@
echo " file /init.sh $( PWD) /../netns.sh 755 0 0 " >> $@
echo "dir /dev 755 0 0" >> $@
echo "nod /dev/console 644 0 0 c 5 1" >> $@
echo "dir /bin 755 0 0" >> $@
echo " file /bin/iperf3 $( IPERF_PATH) /src/iperf3 755 0 0 " >> $@
2020-01-02 17:47:49 +01:00
echo " file /bin/wg $( WIREGUARD_TOOLS_PATH) /src/wg 755 0 0 " >> $@
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>
2019-12-15 22:08:00 +01:00
echo " file /bin/bash $( BASH_PATH) /bash 755 0 0 " >> $@
echo " file /bin/ip $( IPROUTE2_PATH) /ip/ip 755 0 0 " >> $@
echo " file /bin/ss $( IPROUTE2_PATH) /misc/ss 755 0 0 " >> $@
echo " file /bin/ping $( IPUTILS_PATH) /ping 755 0 0 " >> $@
echo " file /bin/ncat $( NMAP_PATH) /ncat/ncat 755 0 0 " >> $@
2020-01-02 17:47:49 +01:00
echo " file /bin/xtables-legacy-multi $( IPTABLES_PATH) /iptables/xtables-legacy-multi 755 0 0 " >> $@
echo "slink /bin/iptables xtables-legacy-multi 777 0 0" >> $@
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>
2019-12-15 22:08:00 +01:00
echo "slink /bin/ping6 ping 777 0 0" >> $@
echo "dir /lib 755 0 0" >> $@
echo " file /lib/libc.so $( MUSL_PATH) /lib/libc.so 755 0 0 " >> $@
echo "slink /lib/ld-linux.so.1 libc.so 777 0 0" >> $@
$(KERNEL_BUILD_PATH)/.config : kernel .config arch /$( ARCH ) .config
mkdir -p $( KERNEL_BUILD_PATH)
cp kernel.config $( KERNEL_BUILD_PATH) /minimal.config
printf 'CONFIG_NR_CPUS=$(NR_CPUS)\nCONFIG_INITRAMFS_SOURCE="$(BUILD_PATH)/init-cpio-spec.txt"\n' >> $( KERNEL_BUILD_PATH) /minimal.config
cat arch/$( ARCH) .config >> $( KERNEL_BUILD_PATH) /minimal.config
$( MAKE) -C $( KERNEL_PATH) O = $( KERNEL_BUILD_PATH) ARCH = $( KERNEL_ARCH) allnoconfig
cd $( KERNEL_BUILD_PATH) && ARCH = $( KERNEL_ARCH) $( KERNEL_PATH) /scripts/kconfig/merge_config.sh -n $( KERNEL_BUILD_PATH) /.config $( KERNEL_BUILD_PATH) /minimal.config
$( if $( findstring yes,$( DEBUG_KERNEL) ) ,cp debug.config $( KERNEL_BUILD_PATH) && cd $( KERNEL_BUILD_PATH) && ARCH = $( KERNEL_ARCH) $( KERNEL_PATH) /scripts/kconfig/merge_config.sh -n $( KERNEL_BUILD_PATH) /.config debug.config,)
2020-01-02 17:47:49 +01:00
$(KERNEL_BZIMAGE) : $( KERNEL_BUILD_PATH ) /.config $( BUILD_PATH ) /init -cpio -spec .txt $( MUSL_PATH ) /lib /libc .so $( IPERF_PATH ) /src /iperf 3 $( IPUTILS_PATH ) /ping $( BASH_PATH ) /bash $( IPROUTE 2_PATH ) /misc /ss $( IPROUTE 2_PATH ) /ip /ip $( IPTABLES_PATH ) /iptables /xtables -legacy -multi $( NMAP_PATH ) /ncat /ncat $( WIREGUARD_TOOLS_PATH ) /src /wg $( BUILD_PATH ) /init ../netns .sh $( WIREGUARD_SOURCES )
$( MAKE) -C $( KERNEL_PATH) O = $( KERNEL_BUILD_PATH) ARCH = $( KERNEL_ARCH) CROSS_COMPILE = $( CROSS_COMPILE)
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>
2019-12-15 22:08:00 +01:00
$(BUILD_PATH)/include/linux/.installed : | $( KERNEL_BUILD_PATH ) /.config
$( MAKE) -C $( KERNEL_PATH) O = $( KERNEL_BUILD_PATH) INSTALL_HDR_PATH = $( BUILD_PATH) ARCH = $( KERNEL_ARCH) CROSS_COMPILE = $( CROSS_COMPILE) headers_install
touch $@
$(MUSL_PATH)/lib/libc.so : $( MUSL_TAR )
mkdir -p $( BUILD_PATH)
flock -s $<.lock tar -C $( BUILD_PATH) -xf $<
cd $( MUSL_PATH) && CC = $( REAL_CC) ./configure --prefix= / --disable-static --build= $( CBUILD)
$( MAKE) -C $( MUSL_PATH)
$( STRIP) -s $@
$(BUILD_PATH)/include/.installed : $( MUSL_PATH ) /lib /libc .so
$( MAKE) -C $( MUSL_PATH) DESTDIR = $( BUILD_PATH) install-headers
touch $@
$(MUSL_CC) : $( MUSL_PATH ) /lib /libc .so
sh $( MUSL_PATH) /tools/musl-gcc.specs.sh $( BUILD_PATH) /include $( MUSL_PATH) /lib /lib/ld-linux.so.1 > $( BUILD_PATH) /musl-gcc.specs
2020-01-02 17:47:49 +01:00
printf '#!/bin/sh\nexec "$(REAL_CC)" --specs="$(BUILD_PATH)/musl-gcc.specs" "$$@"\n' > $( BUILD_PATH) /musl-gcc
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>
2019-12-15 22:08:00 +01:00
chmod +x $( BUILD_PATH) /musl-gcc
$(IPERF_PATH)/.installed : $( IPERF_TAR )
mkdir -p $( BUILD_PATH)
flock -s $<.lock tar -C $( BUILD_PATH) -xf $<
sed -i '1s/^/#include <stdint.h>/' $( IPERF_PATH) /src/cjson.h $( IPERF_PATH) /src/timer.h
sed -i -r 's/-p?g//g' $( IPERF_PATH) /src/Makefile*
touch $@
$(IPERF_PATH)/src/iperf3 : | $( IPERF_PATH ) /.installed $( USERSPACE_DEPS )
2020-01-02 17:47:49 +01:00
cd $( IPERF_PATH) && CFLAGS = " $( CFLAGS) -D_GNU_SOURCE " ./configure --prefix= / $( CROSS_COMPILE_FLAG) --enable-static --disable-shared --with-openssl= no
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>
2019-12-15 22:08:00 +01:00
$( MAKE) -C $( IPERF_PATH)
$( STRIP) -s $@
$(WIREGUARD_TOOLS_PATH)/.installed : $( WIREGUARD_TOOLS_TAR )
2020-02-14 23:57:20 +01:00
mkdir -p $( BUILD_PATH)
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>
2019-12-15 22:08:00 +01:00
flock -s $<.lock tar -C $( BUILD_PATH) -xf $<
touch $@
2020-02-14 23:57:20 +01:00
$(WIREGUARD_TOOLS_PATH)/src/wg : | $( WIREGUARD_TOOLS_PATH ) /.installed $( USERSPACE_DEPS )
$( MAKE) -C $( WIREGUARD_TOOLS_PATH) /src wg
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>
2019-12-15 22:08:00 +01:00
$( STRIP) -s $@
$(BUILD_PATH)/init : init .c | $( USERSPACE_DEPS )
mkdir -p $( BUILD_PATH)
$( MUSL_CC) -o $@ $( CFLAGS) $( LDFLAGS) -std= gnu11 $<
$( STRIP) -s $@
$(IPUTILS_PATH)/.installed : $( IPUTILS_TAR )
mkdir -p $( BUILD_PATH)
flock -s $<.lock tar -C $( BUILD_PATH) -xf $<
touch $@
$(IPUTILS_PATH)/ping : | $( IPUTILS_PATH ) /.installed $( USERSPACE_DEPS )
2020-01-02 17:47:49 +01:00
sed -i /atexit/d $( IPUTILS_PATH) /ping.c
cd $( IPUTILS_PATH) && $( CC) $( CFLAGS) -std= c99 -o $@ ping.c ping_common.c ping6_common.c iputils_common.c -D_GNU_SOURCE -D'IPUTILS_VERSION(f)=f' -lresolv $( LDFLAGS)
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>
2019-12-15 22:08:00 +01:00
$( STRIP) -s $@
$(BASH_PATH)/.installed : $( BASH_TAR )
mkdir -p $( BUILD_PATH)
flock -s $<.lock tar -C $( BUILD_PATH) -xf $<
touch $@
$(BASH_PATH)/bash : | $( BASH_PATH ) /.installed $( USERSPACE_DEPS )
cd $( BASH_PATH) && ./configure --prefix= / $( CROSS_COMPILE_FLAG) --without-bash-malloc --disable-debugger --disable-help-builtin --disable-history --disable-multibyte --disable-progcomp --disable-readline --disable-mem-scramble
$( MAKE) -C $( BASH_PATH)
$( STRIP) -s $@
$(IPROUTE2_PATH)/.installed : $( IPROUTE 2_TAR )
mkdir -p $( BUILD_PATH)
flock -s $<.lock tar -C $( BUILD_PATH) -xf $<
2020-02-14 23:57:20 +01:00
printf 'CC:=$(CC)\nPKG_CONFIG:=pkg-config\nTC_CONFIG_XT:=n\nTC_CONFIG_ATM:=n\nTC_CONFIG_IPSET:=n\nIP_CONFIG_SETNS:=y\nHAVE_ELF:=n\nHAVE_MNL:=n\nHAVE_BERKELEY_DB:=n\nHAVE_LATEX:=n\nHAVE_PDFLATEX:=n\nCFLAGS+=-DHAVE_SETNS\n' > $( IPROUTE2_PATH) /config.mk
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>
2019-12-15 22:08:00 +01:00
printf 'lib: snapshot\n\t$$(MAKE) -C lib\nip/ip: lib\n\t$$(MAKE) -C ip ip\nmisc/ss: lib\n\t$$(MAKE) -C misc ss\n' >> $( IPROUTE2_PATH) /Makefile
touch $@
2020-02-14 23:57:20 +01:00
$(IPROUTE2_PATH)/ip/ip : | $( IPROUTE 2_PATH ) /.installed $( USERSPACE_DEPS )
$( MAKE) -C $( IPROUTE2_PATH) PREFIX = / ip/ip
$( STRIP) -s $@
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>
2019-12-15 22:08:00 +01:00
2020-02-14 23:57:20 +01:00
$(IPROUTE2_PATH)/misc/ss : | $( IPROUTE 2_PATH ) /.installed $( USERSPACE_DEPS )
$( MAKE) -C $( IPROUTE2_PATH) PREFIX = / misc/ss
$( STRIP) -s $@
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>
2019-12-15 22:08:00 +01:00
$(IPTABLES_PATH)/.installed : $( IPTABLES_TAR )
mkdir -p $( BUILD_PATH)
flock -s $<.lock tar -C $( BUILD_PATH) -xf $<
sed -i -e "/nfnetlink=[01]/s:=[01]:=0:" -e "/nfconntrack=[01]/s:=[01]:=0:" $( IPTABLES_PATH) /configure
touch $@
2020-02-14 23:57:20 +01:00
$(IPTABLES_PATH)/iptables/xtables-legacy-multi : | $( IPTABLES_PATH ) /.installed $( USERSPACE_DEPS )
cd $( IPTABLES_PATH) && ./configure --prefix= / $( CROSS_COMPILE_FLAG) --enable-static --disable-shared --disable-nftables --disable-bpf-compiler --disable-nfsynproxy --disable-libipq --disable-connlabel --with-kernel= $( BUILD_PATH) /include
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>
2019-12-15 22:08:00 +01:00
$( MAKE) -C $( IPTABLES_PATH)
$( STRIP) -s $@
$(NMAP_PATH)/.installed : $( NMAP_TAR )
mkdir -p $( BUILD_PATH)
flock -s $<.lock tar -C $( BUILD_PATH) -xf $<
touch $@
$(NMAP_PATH)/ncat/ncat : | $( NMAP_PATH ) /.installed $( USERSPACE_DEPS )
2020-01-02 17:47:49 +01:00
cd $( NMAP_PATH) && ./configure --prefix= / $( CROSS_COMPILE_FLAG) --enable-static --disable-shared --without-ndiff --without-zenmap --without-nping --with-libpcap= included --with-libpcre= included --with-libdnet= included --without-liblua --with-liblinear= included --without-nmap-update --without-openssl --with-pcap= linux --without-libssh
$( MAKE) -C $( NMAP_PATH) /libpcap
$( MAKE) -C $( NMAP_PATH) /ncat
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>
2019-12-15 22:08:00 +01:00
$( STRIP) -s $@
clean :
rm -rf $( BUILD_PATH)
distclean : clean
rm -rf $( DISTFILES_PATH)
menuconfig : $( KERNEL_BUILD_PATH ) /.config
2020-01-02 17:47:49 +01:00
$( MAKE) -C $( KERNEL_PATH) O = $( KERNEL_BUILD_PATH) ARCH = $( KERNEL_ARCH) CROSS_COMPILE = $( CROSS_COMPILE) menuconfig
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>
2019-12-15 22:08:00 +01:00
.PHONY : qemu build clean distclean menuconfig
.DELETE_ON_ERROR :