Use docker-compose framework
diff --git a/xos/configurations/test/Makefile b/xos/configurations/test/Makefile
index b1cca93..a79e322 100644
--- a/xos/configurations/test/Makefile
+++ b/xos/configurations/test/Makefile
@@ -1,10 +1,38 @@
MYIP:=$(shell hostname -i)
-test: common_cloudlab
- cat ../common/Dockerfile.common Dockerfile.test > Dockerfile
- cd ../../..; sudo docker build -t xos -f xos/configurations/test/Dockerfile .
- # sudo docker run -d --add-host="ctl:$(MYIP)" -p 9999:8000 xos
- sudo docker run -i --tty --add-host="ctl:$(MYIP)" -p 9999:8000 xos
+cloudlab: common_cloudlab xos
+
+devstack: upgrade_pkgs common_devstack devstack_net_fix xos
+
+xos:
+ sudo MYIP=$(MYIP) docker-compose up -d
+ bash ../common/wait_for_xos.sh
+ sudo MYIP=$(MYIP) docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/common/base.yaml
+ sudo MYIP=$(MYIP) docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/nodes.yaml
+ sudo MYIP=$(MYIP) docker-compose run xos bash -c "cd /opt/xos/tosca/tests; python ./alltests.py"
+ sudo MYIP=$(MYIP) docker-compose run xos bash -c "cd /opt/xos/tosca/tests; python ./allObserverTests.py"
common_cloudlab:
make -C ../common -f Makefile.cloudlab
+
+common_devstack:
+ make -C ../common -f Makefile.devstack
+
+stop:
+ sudo MYIP=$(MYIP) docker-compose stop
+
+showlogs:
+ sudo MYIP=$(MYIP) docker-compose logs
+
+rm: stop
+ sudo MYIP=$(MYIP) docker-compose rm
+
+ps:
+ sudo MYIP=$(MYIP) docker-compose ps
+
+devstack_net_fix:
+ sudo ../common/devstack/net-fix.sh
+ sudo bash -c "source ../setup/admin-openrc.sh; neutron subnet-update private-subnet --dns-nameservers list=true 8.8.8.8 8.8.4.4"
+
+upgrade_pkgs:
+ sudo pip install httpie --upgrade
diff --git a/xos/configurations/test/docker-compose.yml b/xos/configurations/test/docker-compose.yml
new file mode 100644
index 0000000..91cd4e3
--- /dev/null
+++ b/xos/configurations/test/docker-compose.yml
@@ -0,0 +1,24 @@
+xos_db:
+ image: xosproject/xos-postgres
+ expose:
+ - "5432"
+
+# FUTURE
+#xos_swarm_synchronizer:
+# image: xosproject/xos-swarm-synchronizer
+# labels:
+# org.xosproject.kind: synchronizer
+# org.xosproject.target: swarm
+
+xos:
+ image: xosproject/xos-synchronizer-openstack # Because we test the observer too
+ command: python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
+ ports:
+ - "9999:8000"
+ links:
+ - xos_db
+ extra_hosts:
+ - ctl:${MYIP}
+ volumes:
+ - ../setup:/root/setup:ro
+ - ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro