Skip to content

Commit

Permalink
[oracle][test] actually assert something.
Browse files Browse the repository at this point in the history
  • Loading branch information
truthbk committed Aug 17, 2017
1 parent 1375696 commit 705d364
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions oracle/test_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,9 @@
logging.basicConfig()

"""
Uses Oracle instance running in VM from:
https://atlas.hashicorp.com/woznial/boxes/centos-6.3-oracle-xe
Include following line in your Vagrantfile:
config.vm.network "forwarded_port", guest: 1521, host: 8521
Using the "system" user as permission granting not available
for default "system" user
Install oracle instant client in /opt/oracle
Set up Oracle instant client:
http://jasonstitt.com/cx_oracle_on_os_x
Expand All @@ -44,11 +35,44 @@
}]
}

SERVICE_CHECK_NAME = 'oracle.can_connect'
METRICS = [
'oracle.buffer_cachehit_ratio',
'oracle.cursor_cachehit_ratio',
'oracle.library_cachehit_ratio',
'oracle.shared_pool_free',
'oracle.physical_reads',
'oracle.physical_writes',
'oracle.enqueue_timeouts',
'oracle.gc_cr_receive_time',
'oracle.cache_blocks_corrupt',
'oracle.cache_blocks_lost',
'oracle.logons',
'oracle.active_sessions',
'oracle.long_table_scans',
'oracle.service_response_time',
'oracle.user_rollbacks',
'oracle.sorts_per_user_call',
'oracle.rows_per_sort',
'oracle.disk_sorts',
'oracle.memroy_sorts_ratio',
'oracle.database_wait_time_ratio',
'oracle.enqueue_timeouts',
'oracle.session_limit_usage',
'oracle.session_count',
'oracle.temp_space_used',
]

@attr(requires='oracle')
class TestOracle(AgentCheckTest):
"""Basic Test for oracle integration."""
CHECK_NAME = 'oracle'

def testOracle(self):
self.run_check_twice(CONFIG)

for m in METRICS:
self.assertMetric(m, at_least=1)

self.assertServiceCheck(SERVICE_CHECK_NAME)
self.coverage_report()

0 comments on commit 705d364

Please sign in to comment.