CHARM_SRC_DIR := $(CHARM_DIR)/layers
CHARM_DOCKER_TAG := charm-tools
CHARM_BUILD_DIR := $(CHARM_DIR)/builds
+DOCKER_BUILD ?= $(shell which docker)
Q=@
$(Q)$(GEN_PKG) --no-remove-files -d $(BUILD_DIR) $(BUILD_DIR)/$(PKG_BASE_NAME)
endif
+ifdef DOCKER_BUILD
$(CHARM_BUILD_DIR)/%: $(CHARM_SRC_DIR)/%
$(Q)docker build -q -t $(CHARM_DOCKER_TAG) $(CHARM_DIR)/.
- $(Q)docker run -u $$(id -u):$$(id -g) -v$(CHARM_DIR):$(CHARM_DIR) -w$(CHARM_DIR) $(CHARM_DOCKER_TAG) charm-build -o $(CHARM_DIR) $<
+ $(CHARM_DIR) $(CHARM_DOCKER_TAG) charm-build -o $(CHARM_DIR) $<
+else
+$(CHARM_BUILD_DIR)/%: $(CHARM_SRC_DIR)/%
+ $(Q)charm-build -o $(CHARM_DIR) $<
+endif
clean:
$(Q)rm -rf $(BUILD_DIR)
OS_PASSWORD_NAME ?=
OS_PROJECT_NAME ?=
+TOPDIR=$(shell readlink -f .|sed -e 's/systest.*//')
+
ifdef OS_AUTH_URL
OPTION_OS_AUTH_URL=--os-url $(OS_AUTH_URL)
endif
OPTION_TEST_NSD_DESCRIPTORS=--osm-nsd-descriptor-packages $(TEST_NSD_DESCRIPTORS)
endif
-DESCRIPTOR_REPO_NAME = descriptor-packages
-DESCRIPTOR_REPO_DIR ?= $(shell pwd)/descriptor-packages
-DESCRIPTOR_BUILD_DIR := $(DESCRIPTOR_REPO_DIR)/build
-OPTION_DESCRIPTOR_BUILD_DIR=--osm-descriptor-packages $(DESCRIPTOR_BUILD_DIR)
+DESCRIPTOR_DIR ?= $(TOPDIR)/descriptor-packages
TEST_OSM_NS_NAME_PREFIX=pytest-$(shell date +%D-%T)-
OPTION_TEST_OSM_NS_NAME_PREFIX=--osm-ns-name-prefix $(TEST_OSM_NS_NAME_PREFIX)
PYTEST_OPTIONS=
Q=@
-DESCRIPTOR_REPO ?= https://osm.etsi.org/gerrit/osm/$(DESCRIPTOR_REPO_NAME)
-
-
TEST_VNFD_DESCRIPTORS ?= None
TEST_NSD_DESCRIPTORS ?= None
.PHONY: check_openstack_env check_OSM_HOSTNAME
-descriptors:
- test -e $(DESCRIPTOR_REPO_NAME) || git clone $(DESCRIPTOR_REPO)
- $(MAKE) -C $(DESCRIPTOR_REPO_NAME)
-
report_dir:
@mkdir -p reports
--junitxml $(JUNITXML_DIR)/$(JUNITXML) \
$(PYTEST_OPTIONS)
-cirros: check_OSM_HOSTNAME check_openstack_env
+$(DESCRIPTOR_DIR)/vnfd/cirros_vnf/build/%.tar.gz:
+ $(MAKE) -C $(DESCRIPTOR_DIR)/vnfd/cirros_vnf
+
+$(DESCRIPTOR_DIR)/nsd/cirros_ns/build/%.tar.gz:
+ $(MAKE) -C $(DESCRIPTOR_DIR)/nsd/cirros_ns
+
+cirros: check_OSM_HOSTNAME check_openstack_env \
+ $(DESCRIPTOR_DIR)/vnfd/cirros_vnf/build/cirros_vnf.tar.gz \
+ $(DESCRIPTOR_DIR)/nsd/cirros_ns/build/cirros_ns.tar.gz
$(Q)$(MAKE) \
- TEST_VNFD_DESCRIPTORS=$(DESCRIPTOR_BUILD_DIR)/vnfd_pkgs/cirros_vnf.tar.gz \
- TEST_NSD_DESCRIPTORS=$(DESCRIPTOR_BUILD_DIR)/nsd_pkgs/cirros_ns.tar.gz \
+ TEST_VNFD_DESCRIPTORS=$(DESCRIPTOR_DIR)/vnfd/cirros_vnf/build/cirros_vnf.tar.gz \
+ TEST_NSD_DESCRIPTORS=$(DESCRIPTOR_DIR)/nsd/cirros_ns/build/cirros_ns.tar.gz \
JUNITXML=pytest-$@.xml \
PYTEST_OPTIONS="$(PYTEST_OPTIONS) -m vnf" _run_test
-ns_scale: check_OSM_HOSTNAME check_openstack_env
+ns_scale: check_OSM_HOSTNAME check_openstack_env \
+ $(DESCRIPTOR_DIR)/vnfd/cirros_vnf/build/cirros_vnf.tar.gz \
+ $(DESCRIPTOR_DIR)/nsd/cirros_ns/build/cirros_ns.tar.gz
$(Q)$(MAKE) \
- TEST_VNFD_DESCRIPTORS=$(DESCRIPTOR_BUILD_DIR)/vnfd_pkgs/cirros_vnf.tar.gz \
- TEST_NSD_DESCRIPTORS=$(DESCRIPTOR_BUILD_DIR)/nsd_pkgs/cirros_ns.tar.gz \
+ TEST_VNFD_DESCRIPTORS=$(DESCRIPTOR_DIR)/vnfd/cirros_vnf/build/cirros_vnf.tar.gz \
+ TEST_NSD_DESCRIPTORS=$(DESCRIPTOR_DIR)/nsd/cirros_ns/build/cirros_ns.tar.gz \
JUNITXML=pytest-$@.xml \
PYTEST_OPTIONS="$(PYTEST_OPTIONS) -m ns_scale" _run_test
JUNITXML=pytest-$@.xml \
PYTEST_OPTIONS="$(PYTEST_OPTIONS) -m vim" _run_test
+$(DESCRIPTOR_DIR)/vnfd/ping_vnf/build/%.tar.gz:
+ $(MAKE) -C $(DESCRIPTOR_DIR)/vnfd/ping_vnf
+
+$(DESCRIPTOR_DIR)/vnfd/pong_vnf/build/%.tar.gz:
+ $(MAKE) -C $(DESCRIPTOR_DIR)/vnfd/pong_vnf
+
+$(DESCRIPTOR_DIR)/vnfd/ping_pong_ns/build/%.tar.gz:
+ $(MAKE) -C $(DESCRIPTOR_DIR)/nsd/ping_pong_ns
+
ping_pong: check_OSM_HOSTNAME check_openstack_env
$(Q)$(MAKE) \
- TEST_VNFD_DESCRIPTORS="$(DESCRIPTOR_BUILD_DIR)/vnfd_pkgs/ping_vnf.tar.gz,$(DESCRIPTOR_BUILD_DIR)/vnfd_pkgs/pong_vnf.tar.gz" \
- TEST_NSD_DESCRIPTORS="$(DESCRIPTOR_BUILD_DIR)/nsd_pkgs/ping_pong_ns.tar.gz" \
+ TEST_VNFD_DESCRIPTORS="$(DESCRIPTOR_DIR)/vnfd/ping_vnf/build/ping_vnf.tar.gz $(DESCRIPTOR_DIR)/vnfd/pong_vnf/build/pong_vnf.tar.gz" \
+ TEST_NSD_DESCRIPTORS=$(DESCRIPTOR_DIR)/nsd/ping_pong_ns/build/ping_pong_ns.tar.gz \
JUNITXML=pytest-$@.xml \
PYTEST_OPTIONS="$(PYTEST_OPTIONS) -m vnf" _run_test