Skip to content

Commit

Permalink
[travis] test powerdns integration
Browse files Browse the repository at this point in the history
  • Loading branch information
degemer committed May 11, 2016
1 parent 354bf05 commit 5d25218
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 66 deletions.
123 changes: 62 additions & 61 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,67 +27,68 @@ env:
- VOLATILE_DIR=/tmp
- DD_CASHER_DIR=/tmp/casher
matrix:
- TRAVIS_FLAVOR=default
- TRAVIS_FLAVOR=core_integration
- TRAVIS_FLAVOR=checks_mock
- TRAVIS_FLAVOR=activemq
- TRAVIS_FLAVOR=apache
- TRAVIS_FLAVOR=cassandra FLAVOR_VERSION=2.0.13
- TRAVIS_FLAVOR=cassandra FLAVOR_VERSION=2.1.3
- TRAVIS_FLAVOR=couchdb
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=0.90.13
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.0.3
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.1.2
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.2.4
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.3.9
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.4.5
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.5.2
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.6.2
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.7.4
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=2.0.2
- TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=2.1.1
- TRAVIS_FLAVOR=etcd
- TRAVIS_FLAVOR=fluentd
- TRAVIS_FLAVOR=go_expvar
# FIXME: cannot enable gearman on Travis right now
# because it needs boost
# - TRAVIS_FLAVOR=gearman
- TRAVIS_FLAVOR=haproxy FLAVOR_VERSION=1.3.27
- TRAVIS_FLAVOR=haproxy FLAVOR_VERSION=1.4.26
- TRAVIS_FLAVOR=haproxy FLAVOR_VERSION=1.5.11
- TRAVIS_FLAVOR=lighttpd
- TRAVIS_FLAVOR=memcache
- TRAVIS_FLAVOR=mongo FLAVOR_VERSION=2.6.9
- TRAVIS_FLAVOR=mongo FLAVOR_VERSION=3.0.1
- TRAVIS_FLAVOR=mysql
- TRAVIS_FLAVOR=network
- TRAVIS_FLAVOR=nginx FLAVOR_VERSION=1.6.2
- TRAVIS_FLAVOR=nginx FLAVOR_VERSION=1.7.11
- TRAVIS_FLAVOR=pgbouncer
- TRAVIS_FLAVOR=phpfpm
- TRAVIS_FLAVOR=postgres FLAVOR_VERSION=9.0.19
- TRAVIS_FLAVOR=postgres FLAVOR_VERSION=9.1.15
- TRAVIS_FLAVOR=postgres FLAVOR_VERSION=9.2.10
- TRAVIS_FLAVOR=postgres FLAVOR_VERSION=9.3.6
- TRAVIS_FLAVOR=postgres FLAVOR_VERSION=9.4.1
- TRAVIS_FLAVOR=rabbitmq
- TRAVIS_FLAVOR=redis FLAVOR_VERSION=2.4.18
- TRAVIS_FLAVOR=redis FLAVOR_VERSION=2.6.17
- TRAVIS_FLAVOR=redis FLAVOR_VERSION=2.8.19
# Compilation takes too much time on Travis
# - TRAVIS_FLAVOR=riak
- TRAVIS_FLAVOR=snmpd
- TRAVIS_FLAVOR=ssh
- TRAVIS_FLAVOR=supervisord
- TRAVIS_FLAVOR=sysstat
# FIXME: reenable, but right now cannot run on Travis because
# hugepages are enabled
# - TRAVIS_FLAVOR=tokumx
- TRAVIS_FLAVOR=tomcat # JMX testing machine / need the other ones before
- TRAVIS_FLAVOR=varnish FLAVOR_VERSION=3.0.7
- TRAVIS_FLAVOR=varnish FLAVOR_VERSION=4.0.3
- TRAVIS_FLAVOR=zookeeper FLAVOR_VERSION=3.4.7
- TRAVIS_FLAVOR=zookeeper FLAVOR_VERSION=3.3.6
# - TRAVIS_FLAVOR=default
# - TRAVIS_FLAVOR=core_integration
# - TRAVIS_FLAVOR=checks_mock
# - TRAVIS_FLAVOR=activemq
# - TRAVIS_FLAVOR=apache
# - TRAVIS_FLAVOR=cassandra FLAVOR_VERSION=2.0.13
# - TRAVIS_FLAVOR=cassandra FLAVOR_VERSION=2.1.3
# - TRAVIS_FLAVOR=couchdb
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=0.90.13
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.0.3
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.1.2
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.2.4
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.3.9
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.4.5
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.5.2
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.6.2
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=1.7.4
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=2.0.2
# - TRAVIS_FLAVOR=elasticsearch FLAVOR_VERSION=2.1.1
# - TRAVIS_FLAVOR=etcd
# - TRAVIS_FLAVOR=fluentd
# - TRAVIS_FLAVOR=go_expvar
# # FIXME: cannot enable gearman on Travis right now
# # because it needs boost
# # - TRAVIS_FLAVOR=gearman
# - TRAVIS_FLAVOR=haproxy FLAVOR_VERSION=1.3.27
# - TRAVIS_FLAVOR=haproxy FLAVOR_VERSION=1.4.26
# - TRAVIS_FLAVOR=haproxy FLAVOR_VERSION=1.5.11
# - TRAVIS_FLAVOR=lighttpd
# - TRAVIS_FLAVOR=memcache
# - TRAVIS_FLAVOR=mongo FLAVOR_VERSION=2.6.9
# - TRAVIS_FLAVOR=mongo FLAVOR_VERSION=3.0.1
# - TRAVIS_FLAVOR=mysql
# - TRAVIS_FLAVOR=network
# - TRAVIS_FLAVOR=nginx FLAVOR_VERSION=1.6.2
# - TRAVIS_FLAVOR=nginx FLAVOR_VERSION=1.7.11
# - TRAVIS_FLAVOR=pgbouncer
# - TRAVIS_FLAVOR=phpfpm
# - TRAVIS_FLAVOR=postgres FLAVOR_VERSION=9.0.19
# - TRAVIS_FLAVOR=postgres FLAVOR_VERSION=9.1.15
# - TRAVIS_FLAVOR=postgres FLAVOR_VERSION=9.2.10
# - TRAVIS_FLAVOR=postgres FLAVOR_VERSION=9.3.6
# - TRAVIS_FLAVOR=postgres FLAVOR_VERSION=9.4.1
- TRAVIS_FLAVOR=powerdns_recursor
# - TRAVIS_FLAVOR=rabbitmq
# - TRAVIS_FLAVOR=redis FLAVOR_VERSION=2.4.18
# - TRAVIS_FLAVOR=redis FLAVOR_VERSION=2.6.17
# - TRAVIS_FLAVOR=redis FLAVOR_VERSION=2.8.19
# # Compilation takes too much time on Travis
# # - TRAVIS_FLAVOR=riak
# - TRAVIS_FLAVOR=snmpd
# - TRAVIS_FLAVOR=ssh
# - TRAVIS_FLAVOR=supervisord
# - TRAVIS_FLAVOR=sysstat
# # FIXME: reenable, but right now cannot run on Travis because
# # hugepages are enabled
# # - TRAVIS_FLAVOR=tokumx
# - TRAVIS_FLAVOR=tomcat # JMX testing machine / need the other ones before
# - TRAVIS_FLAVOR=varnish FLAVOR_VERSION=3.0.7
# - TRAVIS_FLAVOR=varnish FLAVOR_VERSION=4.0.3
# - TRAVIS_FLAVOR=zookeeper FLAVOR_VERSION=3.4.7
# - TRAVIS_FLAVOR=zookeeper FLAVOR_VERSION=3.3.6

# Override travis defaults with empty jobs
before_install: echo "OVERRIDING TRAVIS STEPS"
Expand Down
2 changes: 1 addition & 1 deletion ci/powerdns_recursor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def boost_version
sh %(#{powerdns_recursor_rootdir}/pdns_recursor\
--config-dir=tests/checks/fixtures/powerdns-recursor/\
--socket-dir=#{powerdns_recursor_rootdir})
sh %(dig @127.0.0.1 -p 5353 free.fr)
Wait.for 5353, 5
end

task script: ['ci:common:script'] do
Expand Down
10 changes: 6 additions & 4 deletions tests/checks/integration/test_powerdns_recursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class TestPowerDNSRecursorCheck(AgentCheckTest):
'tcp-questions',
]

METRIC_FORMAT = 'powerdns.recursor.{}'

def __init__(self, *args, **kwargs):
AgentCheckTest.__init__(self, *args, **kwargs)
self.config = {"instances": [{
Expand All @@ -44,10 +46,10 @@ def test_check(self):

# Assert metrics
for metric in self.GAUGE_METRICS:
self.assertMetric(metric, 1.0, tags=[])
self.assertMetric(self.METRIC_FORMAT.format(metric), tags=[])

for metric in self.RATE_METRICS:
self.assertMetric(metric, tags=[])
self.assertMetric(self.METRIC_FORMAT.format(metric), tags=[])

service_check_tags = ['recursor_host:127.0.0.1', 'recursor_port:8082']
self.assertServiceOK('powerdns.recursor.can_connect', tags=service_check_tags)
Expand All @@ -62,10 +64,10 @@ def test_tags(self):

# Assert metrics
for metric in self.GAUGE_METRICS:
self.assertMetric(metric, 1.0, tags=tags)
self.assertMetric(self.METRIC_FORMAT.format(metric), tags=tags)

for metric in self.RATE_METRICS:
self.assertMetric(metric, tags=tags)
self.assertMetric(self.METRIC_FORMAT.format(metric), tags=tags)

service_check_tags = ['recursor_host:127.0.0.1', 'recursor_port:8082']
self.assertServiceOK('powerdns.recursor.can_connect', tags=service_check_tags)
Expand Down

0 comments on commit 5d25218

Please sign in to comment.