diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-12-02 11:59:35 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-12-04 03:36:19 +0100 |
commit | 2f6ef4b6237ae8d2f097fc29a02665b25824c278 (patch) | |
tree | 8b5f71d53c6ffeb209def3c84c1c0083525776cf /src/tests/qemu | |
parent | hashtable: use random number each time (diff) | |
download | wireguard-monolithic-historical-2f6ef4b6237ae8d2f097fc29a02665b25824c278.tar.xz wireguard-monolithic-historical-2f6ef4b6237ae8d2f097fc29a02665b25824c278.zip |
tests: make sure ncat gets killed
Diffstat (limited to 'src/tests/qemu')
-rw-r--r-- | src/tests/qemu/Makefile | 2 | ||||
-rw-r--r-- | src/tests/qemu/init.c | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/tests/qemu/Makefile b/src/tests/qemu/Makefile index b60aa5a..a1ece9b 100644 --- a/src/tests/qemu/Makefile +++ b/src/tests/qemu/Makefile @@ -45,7 +45,7 @@ KERNEL_BZIMAGE := $(KERNEL_PATH)/arch/x86/boot/bzImage $(eval $(call tar_download,MUSL,musl,1.1.15,.tar.gz,https://www.musl-libc.org/releases/)) $(eval $(call tar_download,LIBMNL,libmnl,1.0.4,.tar.bz2,http://ftp.netfilter.org/pub/libmnl/)) $(eval $(call tar_download,IPERF,iperf,3.1.3,.tar.gz,http://downloads.es.net/pub/iperf/)) -$(eval $(call tar_download,BASH,bash,30a978b7d808c067219c95be88c4979b6a7aa251,.tar.gz,http://git.savannah.gnu.org/cgit/bash.git/snapshot/)) +$(eval $(call tar_download,BASH,bash,f459cbd8be37b28be1dc90315e0ab51d7f211301,.tar.gz,http://git.savannah.gnu.org/cgit/bash.git/snapshot/)) $(eval $(call tar_download,IPROUTE2,iproute2,4.3.0,.tar.gz,http://www.kernel.org/pub/linux/utils/net/iproute2/)) $(eval $(call tar_download,IPTABLES,iptables,1.6.0,.tar.bz2,http://ftp.netfilter.org/pub/iptables/)) $(eval $(call tar_download,NMAP,nmap,7.25BETA1,.tar.bz2,http://nmap.org/dist/)) diff --git a/src/tests/qemu/init.c b/src/tests/qemu/init.c index 62157c0..d23ec37 100644 --- a/src/tests/qemu/init.c +++ b/src/tests/qemu/init.c @@ -144,18 +144,17 @@ static void kmod_selftests(void) static void launch_tests(void) { int status, fd; + pid_t pid; pretty_message("[+] Launching tests..."); - switch (fork()) { - case -1: + pid = fork(); + if (pid == -1) panic("fork"); - break; - case 0: + else if (pid == 0) { execl("/init.sh", "init", NULL); panic("exec"); - break; } - if (wait(&status) < 0) - panic("wait"); + if (waitpid(pid, &status, 0) < 0) + panic("waitpid"); if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { pretty_message("[+] Tests successful! :-)"); fd = open("/dev/vport1p1", O_WRONLY); |