From 595540b3ed48baeb1bde0037358a3498c444d89a Mon Sep 17 00:00:00 2001 From: Austin Raney Date: Fri, 2 Feb 2024 14:15:59 -0500 Subject: [PATCH] test(fix): add mac support --- .../lib/scheduler/dmod/test/setup_it_env.sh | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/python/lib/scheduler/dmod/test/setup_it_env.sh b/python/lib/scheduler/dmod/test/setup_it_env.sh index 46e4393d1..4c1c274a8 100644 --- a/python/lib/scheduler/dmod/test/setup_it_env.sh +++ b/python/lib/scheduler/dmod/test/setup_it_env.sh @@ -14,15 +14,25 @@ it_redis_startup() do_setup() { + # Make sure the necessary Docker networks have been set up, as the tests will fail otherwise - docker_dev_init_swarm_network ${DOCKER_MPI_NET_NAME:=mpi-net} \ - ${DOCKER_MPI_NET_SUBNET:?Need to set MPI net subnet value for testing within .test_env} \ - ${DOCKER_MPI_NET_GATEWAY:?Need to set MPI net gateway value for testing within .test_env} \ - ${DOCKER_MPI_NET_VXLAN_ID:=4097} + if [ -z "${DOCKER_MPI_NET_VXLAN_ID:-}" ]; then + docker_dev_init_swarm_network ${DOCKER_MPI_NET_NAME:=mpi-net} \ + ${DOCKER_MPI_NET_SUBNET:?Need to set MPI net subnet value for testing within .test_env} \ + ${DOCKER_MPI_NET_GATEWAY:?Need to set MPI net gateway value for testing within .test_env} \ + ${DOCKER_MPI_NET_DRIVER:-overlay} + else + docker_dev_init_swarm_network ${DOCKER_MPI_NET_NAME:=mpi-net} \ + ${DOCKER_MPI_NET_SUBNET:?Need to set MPI net subnet value for testing within .test_env} \ + ${DOCKER_MPI_NET_GATEWAY:?Need to set MPI net gateway value for testing within .test_env} \ + ${DOCKER_MPI_NET_DRIVER:=macvlan} \ + ${DOCKER_MPI_NET_VXLAN_ID} + fi # Then the requests-net docker_dev_init_swarm_network ${DOCKER_REQUESTS_NET_NAME:=requests-net} \ ${DOCKER_REQUESTS_NET_SUBNET:?Need to set requests net subnet value for testing within .test_env} \ - ${DOCKER_REQUESTS_NET_GATEWAY:?Need to set requests net gateway value for testing within .test_env} + ${DOCKER_REQUESTS_NET_GATEWAY:?Need to set requests net gateway value for testing within .test_env} \ + ${DOCKER_REQUESTS_NET_DRIVER:-overlay} # Need Docker container with Redis instance it_redis_startup }