ActiveTest Service Creation.

Onboarding is done by running 'make activetest'. fusion.img, qt600.img, vta.img, and vpma.img
should be in the corresponding service_profile's image/ folder in order for images to be
uploaded in glance.

The measurement agents can be created through the different agents tenants. For example, to
create a VPMA tenant, run 'make vpma 1' where '1' can be any numberical identifier for the
tenant to be created.

Measurement agents will automatically register with the fusion controller through the use of
the synchronizer. Furthermore, tests can be orchestrated through XOS by modifying the models
for the vpma agents.

Change-Id: I69bab4b5f771c87126781799217bb36fda478fd3
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e388fcb
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,53 @@
+include ~/service-profile/mcord/Makefile
+
+ifneq (,$(filter $(firstword $(MAKECMDGOALS)),vpma vta qt600))
+  # use the rest as arguments for "run"
+  TARGET_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
+  # ...and turn them into do-nothing targets
+  $(eval $(TARGET_ARGS):;@:)
+endif
+
+activetest: activetest-onboard
+	$(RUN_TOSCA) $(SERVICE_DIR)/ActiveTest/pod-activetest.yaml
+
+activetest-onboard: $(CONFIG_DIR)/files/activetest_config activetest-flavors
+	sudo cp $(CONFIG_DIR)/id_rsa $(CONFIG_DIR)/key_import/activetest_rsa
+	sudo cp $(CONFIG_DIR)/id_rsa.pub $(CONFIG_DIR)/key_import/activetest_rsa.pub
+	$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/ActiveTest/xos/ActiveTest-onboard.yaml
+	$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/ActiveTest/xos/synchronizer/activetest-synchronizer.yaml
+	bash $(COMMON_DIR)/wait_for_onboarding_ready.sh 81 services/activetest
+	bash $(COMMON_DIR)/wait_for_onboarding_ready.sh 81 xos
+	bash $(COMMON_DIR)/wait_for_xos_port.sh 80
+
+foobar: $(CONFIG_DIR)/files/activetest_config
+
+$(CONFIG_DIR)/files/activetest_config:
+	cp $(SERVICE_DIR)/ActiveTest/xos/synchronizer/activetest_config $(CONFIG_DIR)/files/activetest_config
+
+clean: cleanup
+	./cleanup.sh
+	bash -c "source $(CONFIG_DIR)/admin-openrc.sh; nova list --all-tenants; neutron net-list"
+
+activetest-flavors:
+	bash -c "source $(CONFIG_DIR)/admin-openrc.sh; nova flavor-show activetest.vta || nova flavor-create activetest.vta auto 4096 64 2"
+
+.PHONY: vpma
+vpma:
+	sed 's/vpmatenant/vpmatenant$(TARGET_ARGS)/g' pod-vpma-template.yaml > pod-vpma.yaml
+	$(RUN_TOSCA) $(SERVICE_DIR)/ActiveTest/pod-vpma.yaml
+
+.PHONY: vta
+vta:
+	sed 's/vtatenant/vtatenant$(TARGET_ARGS)/g' pod-vta-template.yaml > pod-vta.yaml
+	$(RUN_TOSCA) $(SERVICE_DIR)/ActiveTest/pod-vta.yaml
+
+.PHONY: qt600
+qt600:
+	sed 's/qt600tenant/qt600tenant$(TARGET_ARGS)/g' pod-qt600-template.yaml > pod-qt600.yaml
+	$(RUN_TOSCA) $(SERVICE_DIR)/ActiveTest/pod-qt600.yaml
+
+activetest-tunnel:
+	$(eval NODES=$(shell bash -c "source $(CONFIG_DIR)/admin-openrc.sh ; nova host-list" | grep compute | awk '{print $$2}' ))
+	$(eval CONTROLLER_IP=$(shell bash -c "source $(CONFIG_DIR)/admin-openrc.sh ; nova list --image fusion --all-tenants | grep -o -E '172.27.0.[0-9]+'"))
+	@echo 'Run the following on HEAD NODE:'
+	@echo '  ssh -f -N -o ProxyCommand="ssh -W %h:%p $(NODES)" root@$(CONTROLLER_IP) -L 0.0.0.0:9443:$(CONTROLLER_IP):9443'