Module: check_mk
Branch: master
Commit: 02011945c11424346387dc0b35aeed5e1b163b4c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=02011945c11424…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Wed May 16 15:36:09 2018 +0200
Win-agent: test wmi_webservices followed by systemtime
Check that the wmi_webservices 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
wmi_webservices section.
Change-Id: I07b3834d20b047de4b09965a3f8c7b677cb2b3bb
---
agents/windows/it/test_section_winperf.py | 1 -
agents/windows/it/test_section_wmi_webservices.py | 130 ++++++++++++----------
2 files changed, 72 insertions(+), 59 deletions(-)
diff --git a/agents/windows/it/test_section_winperf.py
b/agents/windows/it/test_section_winperf.py
index fd3db4d..f113fab 100644
--- a/agents/windows/it/test_section_winperf.py
+++ b/agents/windows/it/test_section_winperf.py
@@ -24,7 +24,6 @@ def testconfig_sections(request, config):
config.set('global', 'sections', Globals.section)
else:
config.set('global', 'sections', '%s systemtime' %
Globals.section)
- config.set('global', 'crash_debug', 'yes')
return config
diff --git a/agents/windows/it/test_section_wmi_webservices.py
b/agents/windows/it/test_section_wmi_webservices.py
index 4c3908b..9cab608 100644
--- a/agents/windows/it/test_section_wmi_webservices.py
+++ b/agents/windows/it/test_section_wmi_webservices.py
@@ -7,79 +7,93 @@ import re
from remote import actual_output, config, remotetest, wait_agent, write_config
+class Globals(object):
+ alone = True
+
+
@pytest.fixture
def testfile():
return os.path.basename(__file__)
@pytest.fixture(
- params=['webservices', 'wmi_webservices'],
- ids=['sections=webservices', 'sections=wmi_webservices'])
+ params=[('webservices', True), ('wmi_webservices', True),
+ ('webservices', False), ('wmi_webservices', False)],
+ ids=[
+ 'sections=webservices', 'sections=wmi_webservices',
+ 'sections=webservices_systemtime',
+ 'sections=wmi_webservices_systemtime'
+ ])
def testconfig(request, config):
- config.set('global', 'sections', request.param)
+ Globals.alone = request.param[1]
+ if Globals.alone:
+ config.set('global', 'sections', request.param[0])
+ else:
+ config.set('global', 'sections', '%s systemtime' %
request.param[0])
config.set('global', 'crash_debug', 'yes')
return config
@pytest.fixture
def expected_output():
- return chain(
- [
- re.escape(r'<<<wmi_webservices:sep(44)>>>'),
- (r'AnonymousUsersPersec,BytesReceivedPersec,BytesSentPersec,'
- r'BytesTotalPersec,Caption,CGIRequestsPersec,'
- r'ConnectionAttemptsPersec,CopyRequestsPersec,'
- r'CurrentAnonymousUsers,CurrentBlockedAsyncIORequests,'
- r'Currentblockedbandwidthbytes,'
- r'CurrentCALcountforauthenticatedusers,'
- r'CurrentCALcountforSSLconnections,CurrentCGIRequests,'
- r'CurrentConnections,CurrentISAPIExtensionRequests,'
- r'CurrentNonAnonymousUsers,DeleteRequestsPersec,Description,'
- r'FilesPersec,FilesReceivedPersec,FilesSentPersec,'
- r'Frequency_Object,Frequency_PerfTime,Frequency_Sys100NS,'
- r'GetRequestsPersec,HeadRequestsPersec,'
- r'ISAPIExtensionRequestsPersec,LockedErrorsPersec,'
- r'LockRequestsPersec,LogonAttemptsPersec,MaximumAnonymousUsers,'
- r'MaximumCALcountforauthenticatedusers,'
- r'MaximumCALcountforSSLconnections,MaximumCGIRequests,'
- r'MaximumConnections,MaximumISAPIExtensionRequests,'
- r'MaximumNonAnonymousUsers,MeasuredAsyncIOBandwidthUsage,'
- r'MkcolRequestsPersec,MoveRequestsPersec,Name,'
- r'NonAnonymousUsersPersec,NotFoundErrorsPersec,'
- r'OptionsRequestsPersec,OtherRequestMethodsPersec,'
- r'PostRequestsPersec,PropfindRequestsPersec,'
- r'ProppatchRequestsPersec,PutRequestsPersec,SearchRequestsPersec,'
- r'ServiceUptime,Timestamp_Object,Timestamp_PerfTime,'
- r'Timestamp_Sys100NS,TotalAllowedAsyncIORequests,'
- r'TotalAnonymousUsers,TotalBlockedAsyncIORequests,'
- r'Totalblockedbandwidthbytes,TotalBytesReceived,TotalBytesSent,'
- r'TotalBytesTransferred,TotalCGIRequests,'
- r'TotalConnectionAttemptsallinstances,TotalCopyRequests,'
- r'TotalcountoffailedCALrequestsforauthenticatedusers,'
- r'TotalcountoffailedCALrequestsforSSLconnections,'
- r'TotalDeleteRequests,TotalFilesReceived,TotalFilesSent,'
- r'TotalFilesTransferred,TotalGetRequests,TotalHeadRequests,'
- r'TotalISAPIExtensionRequests,TotalLockedErrors,TotalLockRequests,'
- r'TotalLogonAttempts,TotalMethodRequests,'
- r'TotalMethodRequestsPersec,TotalMkcolRequests,'
- r'TotalMoveRequests,TotalNonAnonymousUsers,TotalNotFoundErrors,'
- r'TotalOptionsRequests,TotalOtherRequestMethods,TotalPostRequests,'
- r'TotalPropfindRequests,TotalProppatchRequests,TotalPutRequests,'
- r'TotalRejectedAsyncIORequests,TotalSearchRequests,'
- r'TotalTraceRequests,TotalUnlockRequests,TraceRequestsPersec,'
- r'UnlockRequestsPersec')
- ],
- repeat(
- r'\d+,\d+,\d+,\d+,,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,'
- r'\d+,,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,'
- r'\d+,\d+,\d+,\d+,\d+,\d+,\d+,[^,]+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,'
- r'\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,'
- r'\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,'
- r'\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+'))
+ re_str = (
+ r'^\d+,\d+,\d+,\d+,,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,'
+ r'\d+,,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,'
+ r'\d+,\d+,\d+,\d+,\d+,\d+,\d+,[^,]+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,'
+ r'\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,'
+ r'\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,'
+ r'\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+')
+ if not Globals.alone:
+ re_str += r'|' + re.escape(r'<<<systemtime>>>')
+ r'|\d+'
+ re_str += r'$'
+ return chain([
+ re.escape(r'<<<wmi_webservices:sep(44)>>>'),
+ (r'AnonymousUsersPersec,BytesReceivedPersec,BytesSentPersec,'
+ r'BytesTotalPersec,Caption,CGIRequestsPersec,'
+ r'ConnectionAttemptsPersec,CopyRequestsPersec,'
+ r'CurrentAnonymousUsers,CurrentBlockedAsyncIORequests,'
+ r'Currentblockedbandwidthbytes,'
+ r'CurrentCALcountforauthenticatedusers,'
+ r'CurrentCALcountforSSLconnections,CurrentCGIRequests,'
+ r'CurrentConnections,CurrentISAPIExtensionRequests,'
+ r'CurrentNonAnonymousUsers,DeleteRequestsPersec,Description,'
+ r'FilesPersec,FilesReceivedPersec,FilesSentPersec,'
+ r'Frequency_Object,Frequency_PerfTime,Frequency_Sys100NS,'
+ r'GetRequestsPersec,HeadRequestsPersec,'
+ r'ISAPIExtensionRequestsPersec,LockedErrorsPersec,'
+ r'LockRequestsPersec,LogonAttemptsPersec,MaximumAnonymousUsers,'
+ r'MaximumCALcountforauthenticatedusers,'
+ r'MaximumCALcountforSSLconnections,MaximumCGIRequests,'
+ r'MaximumConnections,MaximumISAPIExtensionRequests,'
+ r'MaximumNonAnonymousUsers,MeasuredAsyncIOBandwidthUsage,'
+ r'MkcolRequestsPersec,MoveRequestsPersec,Name,'
+ r'NonAnonymousUsersPersec,NotFoundErrorsPersec,'
+ r'OptionsRequestsPersec,OtherRequestMethodsPersec,'
+ r'PostRequestsPersec,PropfindRequestsPersec,'
+ r'ProppatchRequestsPersec,PutRequestsPersec,SearchRequestsPersec,'
+ r'ServiceUptime,Timestamp_Object,Timestamp_PerfTime,'
+ r'Timestamp_Sys100NS,TotalAllowedAsyncIORequests,'
+ r'TotalAnonymousUsers,TotalBlockedAsyncIORequests,'
+ r'Totalblockedbandwidthbytes,TotalBytesReceived,TotalBytesSent,'
+ r'TotalBytesTransferred,TotalCGIRequests,'
+ r'TotalConnectionAttemptsallinstances,TotalCopyRequests,'
+ r'TotalcountoffailedCALrequestsforauthenticatedusers,'
+ r'TotalcountoffailedCALrequestsforSSLconnections,'
+ r'TotalDeleteRequests,TotalFilesReceived,TotalFilesSent,'
+ r'TotalFilesTransferred,TotalGetRequests,TotalHeadRequests,'
+ r'TotalISAPIExtensionRequests,TotalLockedErrors,TotalLockRequests,'
+ r'TotalLogonAttempts,TotalMethodRequests,'
+ r'TotalMethodRequestsPersec,TotalMkcolRequests,'
+ r'TotalMoveRequests,TotalNonAnonymousUsers,TotalNotFoundErrors,'
+ r'TotalOptionsRequests,TotalOtherRequestMethods,TotalPostRequests,'
+ r'TotalPropfindRequests,TotalProppatchRequests,TotalPutRequests,'
+ r'TotalRejectedAsyncIORequests,TotalSearchRequests,'
+ r'TotalTraceRequests,TotalUnlockRequests,TraceRequestsPersec,'
+ r'UnlockRequestsPersec')
+ ], repeat(re_str))
def test_section_wmi_webservices(request, testconfig, expected_output,
actual_output, testfile):
# request.node.name gives test name
- remotetest(expected_output, actual_output, testfile,
- request.node.name)
+ remotetest(expected_output, actual_output, testfile, request.node.name)