From a3a15c7fd755fb9812d61082a38b57480bb63599 Mon Sep 17 00:00:00 2001 From: Peter Pietzuch Date: Thu, 13 Aug 2020 09:59:32 +0000 Subject: [PATCH] Add iperf network test This test is still broken due to https://github.com/lsds/sgx-lkl/issues/499 and deactivated by default. --- tests/basic/network/Makefile | 45 ++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/tests/basic/network/Makefile b/tests/basic/network/Makefile index 3b5a0cecb..923e03c19 100644 --- a/tests/basic/network/Makefile +++ b/tests/basic/network/Makefile @@ -1,35 +1,56 @@ include ../../common.mk -CC_APP=/usr/bin/curl - +# Test1 - curl +CURL_APP=/usr/bin/curl # The following used to access https://www.microsoft.com, but this fails # with Github issue https://github.com/lsds/sgx-lkl/issues/499. Other URLs # appear to work fine. -CC_APP_CMDLINE=${CC_APP} --trace-ascii - https://www.wikipedia.org/ +CURL_APP_CMDLINE=${CURL_APP} --trace-ascii - https://www.wikipedia.org/ -CC_IMAGE_SIZE=128M +# Test 2 - iperf +# This test requires iperf3 to be installed on the host. +IPERF_APP=/usr/bin/iperf3 +# The following iperf test still suffers from a problem in which the +# throughput collapses to zero after a few seconds. +IPERF_APP_CMDLINE=${IPERF_APP} -V -c 10.0.1.254 -t 60 -P 8 +CC_IMAGE_SIZE=64M CC_IMAGE=sgxlkl-alpine.img - SGXLKL_ENV=SGXLKL_TAP=sgxlkl_tap0 -VERBOSE_OPTS=SGXLKL_VERBOSE=1 SGXLKL_KERNEL_VERBOSE=1 +VERBOSE_OPTS=SGXLKL_VERBOSE=1 SGXLKL_KERNEL_VERBOSE=1 SGXLKL_ETHREADS=8 SGXLKL_TRACE_LKL_SYSCALL=0 SGXLKL_TRACE_SIGNAL=0 ifeq ($(SGXLKL_VERBOSE),) SGXLKL_ENV+=${VERBOSE_OPTS} endif .DELETE_ON_ERROR: -.PHONY: all clean run-hw run-sw +.PHONY: all clean run-hw run-sw run-curl-hw run-curl-sw run-iperf-hw run-iperf-sw clean: rm -f $(CC_IMAGE) $(CC_IMAGE): - ${SGXLKL_DISK_TOOL} create --size=${CC_IMAGE_SIZE} --alpine="curl" ${CC_IMAGE} + ${SGXLKL_DISK_TOOL} create --size=${CC_IMAGE_SIZE} --alpine="curl iperf3" ${CC_IMAGE} + +# Only run the curl test by default, as the iperf test is still broken. +run-hw: run-curl-hw + +run-curl-hw: $(CC_IMAGE) + ${SGXLKL_ENV} ${SGXLKL_STARTER} --hw-debug $(CC_IMAGE) $(CURL_APP_CMDLINE) + +run-iperf-hw: $(CC_IMAGE) + killall -q iperf3; iperf3 --server --daemon && sleep 2 + ${SGXLKL_ENV} ${SGXLKL_STARTER} --hw-debug $(CC_IMAGE) $(IPERF_APP_CMDLINE) + killall iperf3 + +# Only runt the curl test by default, as the iperf test is still broken. +run-sw: run-curl-sw -run-hw: $(CC_IMAGE) - ${SGXLKL_ENV} ${SGXLKL_STARTER} --hw-debug $(CC_IMAGE) $(CC_APP_CMDLINE) +run-curl-sw: $(CC_IMAGE) + ${SGXLKL_ENV} ${SGXLKL_STARTER} --sw-debug $(CC_IMAGE) $(CURL_APP_CMDLINE) -run-sw: $(CC_IMAGE) - ${SGXLKL_ENV} ${SGXLKL_STARTER} --sw-debug $(CC_IMAGE) $(CC_APP_CMDLINE) +run-iperf-sw: $(CC_IMAGE) + killall -q iperf3; iperf3 --server --daemon && sleep 2 + ${SGXLKL_ENV} ${SGXLKL_STARTER} --sw-debug $(CC_IMAGE) $(IPERF_APP_CMDLINE) + killall iperf3