Test: XOS onos integration rewrite.
Also use the existing dockerfile/makefile from xos project to build the xos related containers.
Change-Id: I8f26d0f4fe12da0698ca895186fdeb0ef0e3860a
diff --git a/src/test/setup/postgresql/Makefile b/src/test/setup/postgresql/Makefile
new file mode 100644
index 0000000..8f483f8
--- /dev/null
+++ b/src/test/setup/postgresql/Makefile
@@ -0,0 +1,25 @@
+IMAGE_NAME:=xosproject/xos-postgres
+CONTAINER_NAME:=xos-db-postgres
+NO_DOCKER_CACHE?=false
+
+.PHONY: build
+build: ; docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} .
+
+.PHONY: run
+run: ; docker run -d -p 5432:5432 --name ${CONTAINER_NAME} ${IMAGE_NAME}
+
+.PHONY: stop
+stop: ; docker stop ${CONTAINER_NAME}
+
+.PHONY: rm
+rm: ; docker rm ${CONTAINER_NAME}
+
+.PHONY: rmi
+rmi: ; docker rmi ${IMAGE_NAME}
+
+.PHONY: backup
+backupvol: ; docker run --volumes-from ${CONTAINER_NAME} -v /backup:/backup postgres tar cvf /backup/backup-postgres.tar /var/lib/postgresql
+
+.PHONY: restore
+restorevol: ; docker run --volumes-from ${CONTAINER_NAME} -v /backup:/backup postgres cd /var/lib/postgresql && tar xvf /backup/backup-postgres.tar
+