Module: check_mk
Branch: master
Commit: 4f0c85c0c841aa4bbb258083c6dbd63fe7e9f3e3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4f0c85c0c841aa…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Wed Apr 24 12:11:34 2019 +0200
extend postgres tests
Change-Id: I066d31033429dc7c521d9d958b19cc51838fae0e
---
.../checks/generictests/datasets/postgres_stats.py | 41 +++++++++++++++-------
1 file changed, 29 insertions(+), 12 deletions(-)
diff --git a/tests/unit/checks/generictests/datasets/postgres_stats.py
b/tests/unit/checks/generictests/datasets/postgres_stats.py
index 5ae2a18..686a11f 100644
--- a/tests/unit/checks/generictests/datasets/postgres_stats.py
+++ b/tests/unit/checks/generictests/datasets/postgres_stats.py
@@ -4,6 +4,11 @@
checkname = 'postgres_stats'
+mock_item_state = {
+ '': 1547250000.0,
+}
+
+
freeze_time = '2019-01-12 00:00:00'
@@ -26,15 +31,27 @@ discovery = {'': [(u'ANALYZE adwebconnect', {}),
(u'VACUUM postgres', {})]}
-checks = {'': [(u'ANALYZE adwebconnect',
- {},
- [(0, u'Table: auftrag', []),
- (0, 'Time since last vacuum 674 d', []),
- (1, u'2 tables were never analyzed: anrede/auftrag_mediadaten',
[])]),
- (u'ANALYZE postgres', {}, [(0, 'No never checked tables',
[])]),
- (u'VACUUM adwebconnect',
- {},
- [(0, u'Table: auftrag', []),
- (0, 'Time since last vacuum 674 d', []),
- (1, u'2 tables were never vacuumed: anrede/auftrag_mediadaten',
[])]),
- (u'VACUUM postgres', {}, [(0, 'No never checked tables',
[])])]}
\ No newline at end of file
+checks = {
+ '': [
+ (u'ANALYZE adwebconnect', {'never_analyze_vacuum': (1000, 1100)},
[
+ (0, u'Table: auftrag', []),
+ (0, 'Time since last vacuum 674 d', []),
+ (2, u'2 tables were never analyzed: anrede/auftrag_mediadaten (warn/crit
at 16 m/18 m)', []),
+ ]),
+ (u'ANALYZE adwebconnect', {}, [
+ (0, u'Table: auftrag', []),
+ (0, 'Time since last vacuum 674 d', []),
+ (1, u'2 tables were never analyzed: anrede/auftrag_mediadaten', []),
+ ]),
+ (u'ANALYZE postgres', {}, [
+ (0, 'No never checked tables', []),
+ ]),
+ (u'VACUUM adwebconnect', {}, [
+ (0, u'Table: auftrag', []),
+ (0, 'Time since last vacuum 674 d', []),
+ (1, u'2 tables were never vacuumed: anrede/auftrag_mediadaten', []),
+ ]),
+ (u'VACUUM postgres', {}, [
+ (0, 'No never checked tables', []),
+ ]),
+]}