This repository has been archived by the owner on Oct 9, 2018. It is now read-only.
forked from Percona-QA/percona-qa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproxysql-tests.bats
68 lines (58 loc) · 1.95 KB
/
proxysql-tests.bats
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
@test "run pmm-admin under regular(non-root) user privileges" {
if [[ $(id -u) -eq 0 ]] ; then
skip "Skipping this test, because you are running under root"
fi
run pmm-admin
echo "$output"
[ "$status" -eq 1 ]
[ "${lines[0]}" = "pmm-admin requires superuser privileges to manage system services." ]
}
@test "run pmm-admin under root privileges" {
if [[ $(id -u) -ne 0 ]] ; then
skip "Skipping this test, because you are NOT running under root"
fi
run pmm-admin
echo "$output"
[ "$status" -eq 1 ]
[ "${lines[0]}" = "Usage:" ]
}
@test "run pmm-admin add proxysql:metrics" {
run sudo pmm-admin add proxysql:metrics
[ "$status" -eq 0 ]
echo "${lines[0]}" | grep "OK, now monitoring"
}
@test "run pmm-admin add proxysql:metrics again" {
run sudo pmm-admin add proxysql:metrics
[ "$status" -eq 1 ]
[ "${lines[0]}" = "Error adding proxysql metrics: there is already one instance with this name under monitoring." ]
}
@test "run pmm-admin add proxysql:metrics named" {
run sudo pmm-admin add proxysql:metrics 0x0
[ "$status" -eq 0 ]
echo "${lines[0]}" | grep "OK, now monitoring"
}
@test "run pmm-admin add proxysql:metrics named again" {
run sudo pmm-admin add proxysql:metrics 0x0
[ "$status" -eq 1 ]
[ "${lines[0]}" = "Error adding proxysql metrics: there is already one instance with this name under monitoring." ]
}
@test "run pmm-admin rm proxysql:metrics" {
run sudo pmm-admin rm proxysql:metrics
[ "$status" -eq 0 ]
echo "${lines[0]}" | grep "OK, removed"
}
@test "run pmm-admin purge proxysql:metrics" {
run sudo pmm-admin purge proxysql:metrics
[ "$status" -eq 0 ]
echo "${lines[0]}" | grep "OK, data purged"
}
@test "run pmm-admin purge proxysql:queries" {
run sudo pmm-admin purge proxysql:queries
[ "$status" -eq 1 ]
echo "${lines[0]}" | grep "Error purging"
}
@test "run pmm-admin rm proxysql:metrics 0x0" {
run sudo pmm-admin rm proxysql:metrics 0x0
[ "$status" -eq 0 ]
echo "${lines[0]}" | grep "OK, removed"
}