diff --git a/test/benchmark/bench_linux_and_aster.sh b/test/benchmark/bench_linux_and_aster.sh index fccb17c15..7a783edaa 100755 --- a/test/benchmark/bench_linux_and_aster.sh +++ b/test/benchmark/bench_linux_and_aster.sh @@ -84,7 +84,7 @@ run_benchmark() { ;; "host_guest") echo "Running benchmark ${benchmark} on host and guest..." - bash "${BENCHMARK_DIR}/${benchmark_root}/bench_runner.sh" \ + bash "${BENCHMARK_DIR}/common/host_guest_bench_runner.sh" \ "${BENCHMARK_DIR}/${benchmark}" \ "${asterinas_cmd}" \ "${linux_cmd}" \ diff --git a/test/benchmark/iperf3/bench_runner.sh b/test/benchmark/common/host_guest_bench_runner.sh similarity index 80% rename from test/benchmark/iperf3/bench_runner.sh rename to test/benchmark/common/host_guest_bench_runner.sh index f5754cd1b..3f4d6f357 100755 --- a/test/benchmark/iperf3/bench_runner.sh +++ b/test/benchmark/common/host_guest_bench_runner.sh @@ -14,8 +14,16 @@ LINUX_OUTPUT=$5 BENCHMARK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/../" source "${BENCHMARK_DIR}/common/prepare_host.sh" -# Persist iperf3 port -export IPERF_PORT=5201 +if [[ "$BENCHMARK_PATH" =~ "iperf" ]]; then + # Persist Iperf port + export IPERF_PORT=5201 +elif [[ "$BENCHMARK_PATH" =~ "nginx" ]]; then + # Persist Nginx port + export NGINX_PORT=8080 +elif [[ "$BENCHMARK_PATH" =~ "redis" ]]; then + # Persist Redis port + export REDIS_PORT=6379 +fi # Function to run the benchmark # Parameters: