-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile.tests
140 lines (119 loc) · 4.19 KB
/
Makefile.tests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
test: run_builds run_functional_tests
run_builds:
docker run --rm -v "$(WORKDIR)":/var/tmp centos:7 /bin/bash -ex "/var/tmp/tests/build_rpm.sh"
docker run --rm -v "$(WORKDIR)":/var/tmp debian:9 /bin/bash -ex "/var/tmp/tests/build_deb.sh"
run_functional_tests:
docker run -v "$(WORKDIR)":/var/tmp centos:7 /bin/bash -ex "/var/tmp/tests/check.sh"
local_test:clean_local_tests local_test_prepare run_local_test_pg9.5 run_local_test_pg9.6 run_local_test_pg10 run_local_test_pg11 run_local_test_pg12 run_local_test_pg13
clean_local_tests: clean_local_test_pg9.5 clean_local_test_pg9.6 clean_local_test_pg10 clean_local_test_pg11 clean_local_test_pg12 clean_local_test_pg13 clean_zabbix
local_test_prepare: clean_zabbix
docker network create --driver=bridge --subnet=172.18.0.0/16 network-local-tests
$(WORKDIR)/tests/local_start_zabbix.sh
run_local_test_pg9.5:
docker run -it -d \
--name pg9.5 \
--net="network-local-tests" \
--ip="172.18.0.95" \
-e POSTGRES_PASSWORD="111111" \
-e POSTGRES_HOST_AUTH_METHOD=trust \
-v "$(WORKDIR)":/var/tmp/mamonsu \
postgres:9.5 /bin/bash /docker-entrypoint.sh postgres
sleep 2
docker exec -i pg9.5 bash -c '/var/tmp/mamonsu/tests/local_tests.sh'
docker stop pg9.5
docker rm pg9.5
run_local_test_pg9.6:
docker run -it -d \
--name pg9.6 \
--net="network-local-tests" \
--ip="172.18.0.96" \
-e POSTGRES_PASSWORD="111111" \
-e POSTGRES_HOST_AUTH_METHOD=trust \
-v "$(WORKDIR)":/var/tmp/mamonsu \
postgres:9.6 /bin/bash /docker-entrypoint.sh postgres
sleep 2
docker exec -i pg9.6 bash -c '/var/tmp/mamonsu/tests/local_tests.sh'
docker stop pg9.6
docker rm pg9.6
run_local_test_pg10:
docker run -it -d \
--name pg10 \
--net="network-local-tests" \
--ip="172.18.0.10" \
-e POSTGRES_PASSWORD="111111" \
-e POSTGRES_HOST_AUTH_METHOD=trust \
-v "$(WORKDIR)":/var/tmp/mamonsu \
postgres:10 /bin/bash /docker-entrypoint.sh postgres
sleep 2
docker exec -i pg10 bash -c '/var/tmp/mamonsu/tests/local_tests.sh'
docker stop pg10
docker rm pg10
run_local_test_pg11:
docker run -it -d \
--name pg11 \
--net="network-local-tests" \
--ip="172.18.0.11" \
-e POSTGRES_PASSWORD="111111" \
-e POSTGRES_HOST_AUTH_METHOD=trust \
-v "$(WORKDIR)":/var/tmp/mamonsu \
postgres:11 /bin/bash /docker-entrypoint.sh postgres
sleep 2
docker exec -i pg11 bash -c '/var/tmp/mamonsu/tests/local_tests.sh'
docker stop pg11
docker rm pg11
run_local_test_pg12:
docker run -it -d \
--name pg12 \
--net="network-local-tests" \
--ip="172.18.0.12" \
-e POSTGRES_PASSWORD="111111" \
-e POSTGRES_HOST_AUTH_METHOD=trust \
-v "$(WORKDIR)":/var/tmp/mamonsu \
postgres:12 /bin/bash /docker-entrypoint.sh postgres
sleep 2
docker exec -i pg12 bash -c '/var/tmp/mamonsu/tests/local_tests.sh'
docker stop pg12
docker rm pg12
run_local_test_pg13: clean_local_test_pg13
docker run -it -d \
--name pg13 \
--net="network-local-tests" \
--ip="172.18.0.13" \
-e POSTGRES_PASSWORD="111111" \
-e POSTGRES_HOST_AUTH_METHOD=trust \
-v "$(WORKDIR)":/var/tmp/mamonsu \
postgres:13 /bin/bash /docker-entrypoint.sh postgres
sleep 2
docker exec -i pg13 bash -c '/var/tmp/mamonsu/tests/local_tests.sh'
docker stop pg13
docker rm pg13
run_zabbix: clean_zabbix
$(WORKDIR)/tests/local_start_zabbix.sh
clean_local_test_pg9.5:
docker stop pg9.5 | true
docker rm pg9.5 | true
clean_local_test_pg9.6:
docker stop pg9.6 | true
docker rm pg9.6 | true
clean_local_test_pg10:
docker stop pg10 | true
docker rm pg10 | true
clean_local_test_pg11:
docker stop pg11 | true
docker rm pg11 | true
clean_local_test_pg12:
docker stop pg12 | true
docker rm pg12 | true
clean_local_test_pg13:
docker stop pg13 | true
docker rm pg13 | true
clean_zabbix:
docker stop `docker ps -a -q --filter="name=zabbix-server-pgsql" ` | true
docker rm `docker ps -a -q --filter="name=zabbix-server-pgsql" ` | true
docker stop `docker ps -a -q --filter="name=zabbix-web-apache-pgsql" ` | true
docker rm `docker ps -a -q --filter="name=zabbix-web-apache-pgsql" ` | true
docker stop pg_for_zabbix | true
docker rm pg_for_zabbix | true
docker network rm network-local-tests | true
installcheck:
$(WORKDIR)/tests/tests.sh