Module: check_mk
Branch: master
Commit: 97533496b97fa44161c19b7f7efb0794960a9641
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=97533496b97fa4…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Wed May 16 15:36:09 2018 +0200
Win-agent: test section spool followed by systemtime
Check that the spool section is correctly formatted until the end by
adding section systemtime after it. This is necessary for ensuring that
e. g. the newline is not left out at the end of the spool section.
Change-Id: Ib23952f4f8f3b1b1042ec3b5c8feacfd4153c3d5
---
agents/windows/it/test_section_spool.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/agents/windows/it/test_section_spool.py
b/agents/windows/it/test_section_spool.py
index 0aab6ac..3dde26a 100644
--- a/agents/windows/it/test_section_spool.py
+++ b/agents/windows/it/test_section_spool.py
@@ -10,6 +10,7 @@ from remote import (actual_output, config, remotetest, remotedir,
wait_agent,
class Globals(object):
section = 'spool'
+ alone = True
test_message = 'Test message'
outdated = False
@@ -19,16 +20,25 @@ def testfile():
return os.path.basename(__file__)
-(a)pytest.fixture
-def testconfig(config):
- config.set('global', 'sections', Globals.section)
+(a)pytest.fixture(params=['alone'one', 'with_systemtime'])
+def testconfig(request, config):
+ Globals.alone = request.param == 'alone'
+ if Globals.alone:
+ config.set('global', 'sections', Globals.section)
+ else:
+ config.set('global', 'sections', '%s systemtime' %
Globals.section)
config.set('global', 'crash_debug', 'yes')
return config
@pytest.fixture
def expected_output():
- return [] if Globals.outdated else [r'%s' % Globals.test_message]
+ expected = []
+ if not Globals.outdated:
+ expected += [r'%s' % Globals.test_message]
+ if not Globals.alone:
+ expected += [re.escape(r'<<<systemtime>>>'),
r'\d+']
+ return expected
@pytest.fixture(