File tree Expand file tree Collapse file tree 8 files changed +89
-8
lines changed Expand file tree Collapse file tree 8 files changed +89
-8
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ run_builds:
7
7
run_functional_tests:
8
8
docker run -v "$(WORKDIR)":/var/tmp centos:7 /bin/bash -ex "/var/tmp/tests/check.sh"
9
9
10
- local_test: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
10
+ 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
11
11
12
- clean_local_tests: clean_zabbix 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
12
+ 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
13
13
14
14
local_test_prepare: clean_zabbix
15
15
docker network create --driver=bridge --subnet=172.18.0.0/16 network-local-tests
Original file line number Diff line number Diff line change @@ -8,4 +8,9 @@ cd /var/tmp/mamonsu
8
8
python3 setup.py build
9
9
python3 setup.py install
10
10
11
+ mkdir -p /etc/mamonsu
12
+ touch /etc/mamonsu/agent.conf
13
+
14
+ mkdir -p /var/log/mamonsu
15
+ touch /var/log/mamonsu/agent.log
11
16
exit 0
Original file line number Diff line number Diff line change 1
1
#! /bin/bash -ex
2
2
3
3
/var/tmp/mamonsu/tests/local_install_mamonsu.sh
4
- /var/tmp/mamonsu/tests/bootstrap.sh
4
+
5
+ # ##### test mamonsu report *
6
+ /var/tmp/mamonsu/tests/tests/report.sh
7
+
8
+ # ##### test mamonsu agent *
9
+ /var/tmp/mamonsu/tests/tests/agent.sh
10
+
11
+ # ##### test mamonsu bootstrap *
12
+ /var/tmp/mamonsu/tests/tests/bootstrap.sh
5
13
6
14
# ##### test mamonsu zabbix *
7
- mkdir /etc/mamonsu/
15
+ mkdir -p /etc/mamonsu/
8
16
cp /var/tmp/mamonsu/packaging/conf/example.conf /etc/mamonsu/agent.conf
9
17
# ZABBIX_DOCKER_VERSIONS="5.2 5.0 4.4 4.2 4.0 3.4 3.2 3.0"
10
18
ZABBIX_DOCKER_VERSIONS=" 5.2 5.0 4.4 4.2 4.0 3.2 3.0"
27
35
Z_USER=$Z_USER
28
36
Z_PASSWORD=$Z_PASSWORD
29
37
Z_VERSION=$Z_VERSION "
30
- /var/tmp/mamonsu/tests/zabbix.sh
38
+ /var/tmp/mamonsu/tests/tests/ zabbix.sh
31
39
done
32
40
33
41
exit 0
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -ex
2
+
3
+
4
+ # тест команд mamonsu agent *
5
+
6
+ # Требования:
7
+ # нет
8
+
9
+ mkdir -p /etc/mamonsu
10
+
11
+ cat << EOF > /etc/mamonsu/agent.conf
12
+ [postgres]
13
+ host = 127.0.0.1
14
+ user = mamonsu_agent
15
+ database = mamonsu_agent
16
+ password = supersecret
17
+
18
+ [zabbix]
19
+ enabled = False
20
+
21
+
22
+ [agent]
23
+ enabled = True
24
+ host = 127.0.0.1
25
+ port = 10053
26
+
27
+ [metric_log]
28
+ enabled = True
29
+ directory = /tmp
30
+
31
+ [log]
32
+ file = /var/log/mamonsu/agent.log
33
+ level = DEBUG
34
+
35
+ EOF
36
+
37
+
38
+ mamonsu &
39
+ sleep 1
40
+
41
+ mamonsu agent version
42
+ mamonsu agent metric-get system.disk.all_read[]
43
+ mamonsu agent metric-list
44
+
45
+ mamonsu agent -c /etc/mamonsu/agent.conf version
46
+ mamonsu agent metric-get system.disk.all_read[] -c /etc/mamonsu/agent.conf
47
+ mamonsu agent -c /etc/mamonsu/agent.conf metric-list
48
+
49
+ exit 0
Original file line number Diff line number Diff line change 1
1
#! /bin/bash -ex
2
2
3
- # bootstrap test
3
+ # тест команд mamonsu bootstrap *
4
+
4
5
# Требования:
5
6
# запуск psql от пользователя postgres psql -U postgres
6
7
# в pg_hba долвны быть разрешения для всех пользователей trust
@@ -56,7 +57,7 @@ function check_db_objects() {
56
57
$PSQL $DB -c " \df mamonsu_get_oldest_transaction" | grep " mamonsu_get_oldest_transaction" || exit 11
57
58
echo " WALXLOG $WALXLOG "
58
59
$PSQL $DB -c " \df mamonsu_count_" $WALXLOG " _files" | grep " mamonsu_count_" $WALXLOG " _files" || exit 11
59
- $PSQL $DB -c " \df mamonsu_buffer_cache" | grep " mamonsu_buffer_cache" || exit 11
60
+ # $PSQL $DB -c "\df mamonsu_buffer_cache" | grep "mamonsu_buffer_cache" || exit 11
60
61
$PSQL $DB -c " \df mamonsu_archive_command_files" | grep " mamonsu_archive_command_files" || exit 11
61
62
$PSQL $DB -c " \df mamonsu_archive_stat" | grep " mamonsu_archive_stat" || exit 11
62
63
$PSQL $DB -c " \df mamonsu_get_sys_param" | grep " mamonsu_get_sys_param" || exit 11
Original file line number Diff line number Diff line change
1
+ # в данной дирректории содержатся готовые скрипты с тестами
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -ex
2
+
3
+
4
+ # тест команд mamonsu report *
5
+
6
+ # Требования:
7
+ # нет
8
+
9
+ mamonsu report
10
+ mamonsu report --port 5433
11
+ mamonsu report --run-system=false
12
+ mamonsu report --run-postgres=false
13
+ mamonsu report --disable-sudo
14
+ mamonsu report -w rep1.txt
15
+ mamonsu report --report-path=rep2.txt
16
+
Original file line number Diff line number Diff line change 1
1
#! /bin/bash -ex
2
2
3
- # тест команд /mamonsu zabbix *
3
+ # тест команд mamonsu zabbix *
4
+
4
5
# Требования:
5
6
# наличие запущенного zabbix сервера и прописанные переменные окружения: Z_URL Z_USER Z_PASSWORD, Z_MAJOR_VERSION
6
7
# todo change and remove
You can’t perform that action at this time.
0 commit comments