Merge "Added retry topic and webhook config for smoke test"

This commit is contained in:
Jenkins 2015-02-11 21:25:12 +00:00 committed by Gerrit Code Review
commit cd16103f5e
4 changed files with 45 additions and 11 deletions

View File

@ -43,6 +43,7 @@
transformed-events: { replicas: 1, partitions: 4 }
alarm-state-transitions: { replicas: 1, partitions: 4 }
alarm-notifications: { replicas: 1, partitions: 4 }
retry-notifications: { replicas: 1, partitions: 4 }
kafka_hosts: "{{mini_mon_host}}:9092"
keystone_url: http://192.168.10.5:35357/v3
monasca_agent:

View File

@ -50,10 +50,12 @@ def run_mon_cli(args, useJson=True):
sys.exit(1)
def create_notification(notification_name, notification_email_addr):
def create_notification(notification_name,
notification_addr,
notification_type):
print('Creating notification')
result_json = run_mon_cli(['notification-create', notification_name,
'EMAIL', notification_email_addr])
notification_type, notification_addr])
# Parse out id
notification_id = result_json['id']

View File

@ -156,7 +156,8 @@ def wait_for_alarm_creation(alarm_def_id):
def smoke_test():
notification_name = config['notification']['name']
notification_email_addr = config['notification']['email_addr']
notification_addr = config['notification']['addr']
notification_type = config['notification']['type']
alarm_definition_name = config['alarm']['name']
metric_name = config['metric']['name']
metric_dimensions = config['metric']['dimensions']
@ -188,7 +189,8 @@ def smoke_test():
# Create Notification through CLI
notif_id = cli_wrapper.create_notification(notification_name,
notification_email_addr)
notification_addr,
notification_type)
# Create Alarm through CLI
expression = config['alarm']['expression']

View File

@ -8,7 +8,7 @@ system_vars = {
'kafka', 'zookeeper.jar', 'monasca-api',
'influxdb', 'apache-storm', 'mysqld'),
'mail_host': 'localhost',
'metric_host': subprocess.check_output(['hostname', '-f']).strip()}
'metric_host': subprocess.check_output(['hostname', '-f']).strip()},
}
@ -19,7 +19,8 @@ test_config = {
'notification': {
'name': 'Monasca Smoke Test',
'email_addr': 'root@'+system_vars['default']['mail_host']},
'addr': 'root@'+system_vars['default']['mail_host'],
'type': 'EMAIL'},
'alarm': {
'name': 'high cpu and load',
@ -39,5 +40,33 @@ test_config = {
'name': 'monasca.sent_smtp_count',
'dimensions': {'hostname':
system_vars['default']['metric_host']}}
},
'webhook': {
'system_vars': system_vars['default'],
'notification': {
'name': 'Smoke Test Webhook',
'addr': 'http://127.0.0.1:8080',
'type': 'WEBHOOK'},
'alarm': {
'name': 'high cpu and load',
'expression': 'max(cpu.system_perc) > 0 and ' +
'max(load.avg_1_min{hostname=' +
system_vars['default']['metric_host'] +
'}) > 0',
'description': 'System CPU Utilization exceeds 1% and ' +
'Load exceeds 3 per measurement period'},
'metric': {
'name': 'load.avg_1_min',
'dimensions': {'hostname':
system_vars['default']['metric_host']}},
'statsd_metric': {
'name': 'monasca.sent_smtp_count',
'dimensions': {'hostname':
system_vars['default']['metric_host']}}
}
}