2014-02-28 10:19:02 -07:00
|
|
|
import unittest
|
|
|
|
import logging
|
|
|
|
from nose.plugins.attrib import attr
|
2014-04-30 16:21:39 -06:00
|
|
|
from nose.plugins.skip import SkipTest
|
2014-02-28 10:19:02 -07:00
|
|
|
|
|
|
|
from tests.common import get_check
|
|
|
|
|
|
|
|
logging.basicConfig()
|
|
|
|
|
|
|
|
CONFIG = """
|
|
|
|
init_config:
|
|
|
|
|
|
|
|
instances:
|
|
|
|
- host: .
|
|
|
|
tags:
|
|
|
|
- mytag1
|
|
|
|
- mytag2
|
|
|
|
"""
|
|
|
|
|
2014-04-30 16:21:39 -06:00
|
|
|
|
2014-02-28 10:19:02 -07:00
|
|
|
class IISTestCase(unittest.TestCase):
|
|
|
|
@attr('windows')
|
|
|
|
def testIIS(self):
|
2014-04-30 16:21:39 -06:00
|
|
|
raise SkipTest('Requires IIS and wmi')
|
2014-02-28 10:19:02 -07:00
|
|
|
check, instances = get_check('iis', CONFIG)
|
|
|
|
check.check(instances[0])
|
|
|
|
metrics = check.get_metrics()
|
|
|
|
|
|
|
|
base_metrics = [m[0] for m in check.METRICS]
|
|
|
|
ret_metrics = [m[0] for m in metrics]
|
2014-05-02 16:41:50 -06:00
|
|
|
ret_tags = [m[3]['dimensions'] for m in metrics]
|
2014-02-28 10:19:02 -07:00
|
|
|
|
|
|
|
# Make sure each metric was captured
|
|
|
|
for metric in base_metrics:
|
|
|
|
assert metric in ret_metrics
|
|
|
|
|
|
|
|
# Make sure everything is tagged correctly
|
|
|
|
for tags in ret_tags:
|
|
|
|
assert tags == ['mytag1', 'mytag2']
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
unittest.main()
|