Skip to content

Commit

Permalink
detect environment in Makefile to use same Make targets
Browse files Browse the repository at this point in the history
  • Loading branch information
nqb committed Nov 25, 2021
1 parent 522fd36 commit f07218b
Showing 1 changed file with 35 additions and 26 deletions.
61 changes: 35 additions & 26 deletions t/venom/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ SHELL=/bin/bash
PFSERVERS_DIR=pfservers
CI_PIPELINE_ID=123456789

#==============================================================================
# Tests CI or localdev
#==============================================================================
# in localdev, we don't want to clean all VM created previously
ifeq ($(CI), true)
$(info CI environment detected)
MAKE_TARGET=run
DEV_ENV=dev
else
$(info localdev environment detected)
MAKE_TARGET=run_w_clean
DEV_ENV=localdev
endif

#==============================================================================
# Targets
#==============================================================================
Expand Down Expand Up @@ -48,81 +62,76 @@ clean:

unit_tests_el8:
make \
PF_VM_NAME=pfel8dev \
PF_VM_NAME=pfel8$(DEV_ENV) \
SCENARIOS_TO_RUN=unit_tests \
$(MAKE_TARGET)

configurator_el8:
make \
PF_VM_NAME=pfel8dev \
PF_VM_NAME=pfel8$(DEV_ENV) \
SCENARIOS_TO_RUN=configurator \
$(MAKE_TARGET)

configurator_deb11:
make \
PF_VM_NAME=pfdeb11dev \
PF_VM_NAME=pfdeb11$(DEV_ENV) \
SCENARIOS_TO_RUN=configurator \
$(MAKE_TARGET)

dot1x_eap_peap_el8:
make \
PF_VM_NAME=pfel8dev \
PF_VM_NAME=pfel8$(DEV_ENV) \
INT_TEST_VM_NAMES="ad switch01 node01 wireless01" \
SCENARIOS_TO_RUN=dot1x_eap_peap \
$(MAKE_TARGET)

dot1x_eap_peap_deb11:
make \
PF_VM_NAME=pfdeb11dev \
PF_VM_NAME=pfdeb11$(DEV_ENV) \
INT_TEST_VM_NAMES="ad switch01 node01 wireless01" \
SCENARIOS_TO_RUN=dot1x_eap_peap \
$(MAKE_TARGET)

mac_auth_el8:
make \
PF_VM_NAME=pfel8dev \
PF_VM_NAME=pfel8$(DEV_ENV) \
INT_TEST_VM_NAMES="switch01 node01 wireless01" \
SCENARIOS_TO_RUN=mac_auth \
$(MAKE_TARGET)

mac_auth_deb11:
make \
PF_VM_NAME=pfdeb11dev \
PF_VM_NAME=pfdeb11$(DEV_ENV) \
INT_TEST_VM_NAMES="switch01 node01 wireless01" \
SCENARIOS_TO_RUN=mac_auth \
$(MAKE_TARGET)

dot1x_eap_tls_el8:
make \
PF_VM_NAME=pfel8dev \
PF_VM_NAME=pfel8$(DEV_ENV) \
INT_TEST_VM_NAMES="switch01 node01" \
SCENARIOS_TO_RUN=dot1x_eap_tls \
$(MAKE_TARGET)

dot1x_eap_tls_deb11:
make \
PF_VM_NAME=pfdeb11dev \
PF_VM_NAME=pfdeb11$(DEV_ENV) \
INT_TEST_VM_NAMES="switch01 node01" \
SCENARIOS_TO_RUN=dot1x_eap_tls \
$(MAKE_TARGET)

#==============================================================================
# Targets for local tests
#==============================================================================
# Usage: SCENARIOS_TO_RUN=example make local_el8
local_el8:
example_el8:
make \
PF_VM_NAME=pfel8localdev \
INT_TEST_VM_NAMES="$(INT_TEST_VM_NAMES)" \
SCENARIOS_TO_RUN=$(SCENARIOS_TO_RUN) \
run_w_clean
PF_VM_NAME=pfel8$(DEV_ENV) \
# if you want to start additional VMs
#INT_TEST_VM_NAMES="switch01 node01" \
SCENARIOS_TO_RUN=example \
$(MAKE_TARGET)

# Usage: SCENARIOS_TO_RUN=example make local_deb11
local_deb11:
example_deb11:
make \
PF_VM_NAME=pfdeb11localdev \
INT_TEST_VM_NAMES="$(INT_TEST_VM_NAMES)" \
SCENARIOS_TO_RUN=$(SCENARIOS_TO_RUN) \
run_w_clean


PF_VM_NAME=pfdeb11$(DEV_ENV) \
# if you want to start additional VMs
#INT_TEST_VM_NAMES="switch01 node01" \
SCENARIOS_TO_RUN=example \
$(MAKE_TARGET)

0 comments on commit f07218b

Please sign in to comment.