diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-04-13 19:59:35 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-04-13 19:59:35 +0200 |
commit | 1818d660e9cf2142433fb0cafd5b66837d848ffc (patch) | |
tree | 9b78f6a9748db186689cf5b9d5d7fb701ad067ef /build/test | |
parent | ee2ae15c9f4c8ea6426d90cf215720836627f1cd (diff) |
Add schema and start build and test-framework
DB is looking OK so far in the test.
Diffstat (limited to 'build/test')
-rw-r--r-- | build/test/collector-test.Dockerfile | 4 | ||||
-rw-r--r-- | build/test/db-test.Dockerfile | 9 | ||||
-rw-r--r-- | build/test/front-test.Dockerfile | 4 | ||||
-rw-r--r-- | build/test/inventory | 1 | ||||
-rw-r--r-- | build/test/pg_hba.tail | 1 | ||||
-rw-r--r-- | build/test/playbook-test.retry | 1 | ||||
-rw-r--r-- | build/test/playbook-test.yml | 32 |
7 files changed, 52 insertions, 0 deletions
diff --git a/build/test/collector-test.Dockerfile b/build/test/collector-test.Dockerfile new file mode 100644 index 0000000..4a82491 --- /dev/null +++ b/build/test/collector-test.Dockerfile @@ -0,0 +1,4 @@ +FROM debian:jessie +RUN apt-get update && apt-get install -y git-core +RUN git clone https://github.com/tech-server/tgnms + diff --git a/build/test/db-test.Dockerfile b/build/test/db-test.Dockerfile new file mode 100644 index 0000000..cd6161e --- /dev/null +++ b/build/test/db-test.Dockerfile @@ -0,0 +1,9 @@ +FROM debian:jessie +RUN apt-get update && apt-get install -y postgresql-9.4 +ADD test/pg_hba.tail /pg_hba.tail +RUN cat /pg_hba.tail >> /etc/postgresql/9.4/main/pg_hba.conf +RUN service postgresql start && su postgres -c "psql --command=\"CREATE ROLE nms PASSWORD 'risbrod' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\"" && su postgres -c "createdb -O nms nms" && service postgresql stop +ADD schema.sql /schema.sql +RUN service postgresql start && su postgres -c "cat /schema.sql | psql nms" && service postgresql stop +CMD pg_ctlcluster --foreground 9.4 main start +EXPOSE 5432 diff --git a/build/test/front-test.Dockerfile b/build/test/front-test.Dockerfile new file mode 100644 index 0000000..4a82491 --- /dev/null +++ b/build/test/front-test.Dockerfile @@ -0,0 +1,4 @@ +FROM debian:jessie +RUN apt-get update && apt-get install -y git-core +RUN git clone https://github.com/tech-server/tgnms + diff --git a/build/test/inventory b/build/test/inventory new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/build/test/inventory @@ -0,0 +1 @@ +localhost diff --git a/build/test/pg_hba.tail b/build/test/pg_hba.tail new file mode 100644 index 0000000..60b8c53 --- /dev/null +++ b/build/test/pg_hba.tail @@ -0,0 +1 @@ +host nms nms 172.17.0.0/16 md5 diff --git a/build/test/playbook-test.retry b/build/test/playbook-test.retry new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/build/test/playbook-test.retry @@ -0,0 +1 @@ +localhost diff --git a/build/test/playbook-test.yml b/build/test/playbook-test.yml new file mode 100644 index 0000000..2658e77 --- /dev/null +++ b/build/test/playbook-test.yml @@ -0,0 +1,32 @@ +--- +- hosts: all + become: false + tasks: + - name: make db-test + docker_image: + state: build + name: nms-db-test + docker_api_version: 1.18 + dockerfile: test/db-test.Dockerfile + path: "src/tgnms/build/" + - name: make front-test + docker_image: + name: nms-front-test + docker_api_version: 1.18 + dockerfile: test/front-test.Dockerfile + path: "src/tgnms/build/" + - name: make collector-test + docker_image: + name: nms-collector-test + docker_api_version: 1.18 + dockerfile: test/collector-test.Dockerfile + path: "src/tgnms/build/" + - name: start db + docker: + name: nms-db + image: nms-db-test + docker_api_version: 1.18 + state: started + net: bridge + + |