diff --git a/data_bags/devstack/agent_plugin_config.json b/data_bags/devstack/agent_plugin_config.json deleted file mode 100644 index 84d32ce..0000000 --- a/data_bags/devstack/agent_plugin_config.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id" : "agent_plugin_config", - "mysql": { - "user": "root", - "password": "pass" - }, - "rabbitmq": { - "user": "guest", - "password": "pass", - "nodes": "rabbit@devstack", - "queues": "conductor", - "exchanges": "nova,cinder,ceilometer,glance,keystone,neutron,heat,ironic,openstack" - } -} diff --git a/ds-build/Vagrantfile b/ds-build/Vagrantfile index 026f466..ba812f3 100644 --- a/ds-build/Vagrantfile +++ b/ds-build/Vagrantfile @@ -42,6 +42,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vb.cpus = 4 end ds.vm.provision :chef_solo do |chef| + chef.cookbooks_path = "cookbooks" chef.roles_path = "roles" chef.add_role "Devstack-Build" chef.arguments = '--force-formatter' diff --git a/cookbooks/ds-build/README.md b/ds-build/cookbooks/ds-build/README.md similarity index 100% rename from cookbooks/ds-build/README.md rename to ds-build/cookbooks/ds-build/README.md diff --git a/cookbooks/ds-build/files/default/autostack.sh b/ds-build/cookbooks/ds-build/files/default/autostack.sh similarity index 100% rename from cookbooks/ds-build/files/default/autostack.sh rename to ds-build/cookbooks/ds-build/files/default/autostack.sh diff --git a/cookbooks/ds-build/files/default/local.conf b/ds-build/cookbooks/ds-build/files/default/local.conf similarity index 100% rename from cookbooks/ds-build/files/default/local.conf rename to ds-build/cookbooks/ds-build/files/default/local.conf diff --git a/cookbooks/ds-build/metadata.rb b/ds-build/cookbooks/ds-build/metadata.rb similarity index 100% rename from cookbooks/ds-build/metadata.rb rename to ds-build/cookbooks/ds-build/metadata.rb diff --git a/cookbooks/ds-build/recipes/default.rb b/ds-build/cookbooks/ds-build/recipes/default.rb similarity index 100% rename from cookbooks/ds-build/recipes/default.rb rename to ds-build/cookbooks/ds-build/recipes/default.rb diff --git a/tests/README.md b/tests/README.md index 7797ade..cf386f8 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,8 +1,3 @@ # Test notifications -- The api is currently rejecting alarms with no action specified, so expect an error defining that alarm. -- Setup alarms and Notifications - - run ./alarm_notification.py -e me@hp.com -- Run the jmeter tests - - `jmeter -t notification-jmeter.jmx &` - - The config is saved for a basic test that should create a notification on alarm and a hundred non-notification alarms. Change the thread - loop counts to try different combinations. +- run smoke.py from within the mini-mon vm for a full test of Monasca +- env.sh can be sourced to set the proper env for using the python-monascaclient diff --git a/tests/alarms-no-notification/cpu.json b/tests/alarms-no-notification/cpu.json deleted file mode 100644 index 6efdbb2..0000000 --- a/tests/alarms-no-notification/cpu.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "description": "mini-mon cpu alarm", - "name": "compute.cpu", - "expression": "compute.cpu{hostname=vertica} >= 90", - "alarm_actions": [ ] -} diff --git a/tests/alarms/cpu.json b/tests/alarms/cpu.json deleted file mode 100644 index 95aea3a..0000000 --- a/tests/alarms/cpu.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "description": "mini-mon cpu alarm", - "name": "compute.cpu", - "expression": "compute.cpu{hostname=kafka} >= 90", - "alarm_actions": [ - "%s" - ], - "ok_actions": [ - "%s" - ], - "undetermined_actions": [ - "%s" - ] -} diff --git a/tests/alarms_notifications.py b/tests/alarms_notifications.py deleted file mode 100755 index afb3708..0000000 --- a/tests/alarms_notifications.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# -"""alarm_notification_setup - Sets up test alarms and notifications using the mon-api. Assumes the mini-mon setup. -""" - -import argparse -from glob import glob -import httplib -import json -import sys - -API_HOST = '192.168.10.4' -API_PORT = '8080' -HEADERS = {"Content-Type": "application/json", - "Accept": "application/json", - "X-Tenant-Id": "1"} - - -def post(conn, url, body): - conn.request("POST", url, body, HEADERS) - http_response = conn.getresponse() - response = http_response.read() - if http_response.status < 200 or http_response.status > 300: - print("\tError %d response: %s" % (http_response.status, response)) - return response - -def main(): - parser = argparse.ArgumentParser(description='Setup Alarms and Notification via the api. Assumes mini-mon') - parser.add_argument('--email', '-e', required=True) - args = parser.parse_args() - - conn = httplib.HTTPConnection(API_HOST, API_PORT) - - with open('notification.json', 'r') as notification_file: - notification_json = notification_file.read() % args.email - - print('Adding email notification.') - response = post(conn, '/v2.0/notification-methods', notification_json) - response_json = json.loads(response) - - notification_method_id = response_json['id'] - - # Alarms with notification - for path in glob('alarms/*.json'): - with open(path, 'r') as alarm_file: - alarm_json = alarm_file.read() % (notification_method_id, notification_method_id, notification_method_id) - print('Adding Alarm %s' % path) - post(conn, '/v2.0/alarms', alarm_json) - - # Alarms without notification - for path in glob('alarms-no-notification/*.json'): - print('Adding Alarm %s' % path) - with open(path, 'r') as alarm_file: - post(conn, '/v2.0/alarms', alarm_file.read()) - -if __name__ == "__main__": - sys.exit(main()) diff --git a/tests/notification-jmeter.jmx b/tests/notification-jmeter.jmx deleted file mode 100644 index b35317d..0000000 --- a/tests/notification-jmeter.jmx +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - false - false - - - - - - - - - - Content-type - application/json - - - Accept - application/json - - - X-Tenant-Id - 1 - - - - - - - - - 192.168.10.4 - 8080 - - - - - - 4 - - - - continue - - false - 1 - - 1 - 1 - 1395693961000 - 1395693961000 - false - - - - - - true - 1 - - - - true - - - - false - { - "name": "compute.cpu", - "dimensions": { - "hostname": "kafka" - }, - "timestamp": "${__javaScript(int(new Date().getTime()/1000);)}", - "value": "95.0" -} - - = - - - - - - - - - - /v2.0/metrics - POST - false - false - true - false - false - - - - - 1000 - - - - true - - - - false - { - "name": "compute.cpu", - "dimensions": { - "hostname": "kafka" - }, - "timestamp": "${__javaScript(int(new Date().getTime()/1000);)}", - "value": "50.0" -} - = - - - - - - - - - - /v2.0/metrics - POST - false - false - true - false - false - - - - - - true - 100 - - - - true - - - - false - { - "name": "compute.cpu", - "dimensions": { - "hostname": "vertica" - }, - "timestamp": "${__javaScript(int(new Date().getTime()/1000);)}", - "value": "95.0" -} - - = - - - - - - - - - - /v2.0/metrics - POST - false - false - true - false - false - - - - - true - - - - false - { - "name": "compute.cpu", - "dimensions": { - "hostname": "vertica" - }, - "timestamp": "${__javaScript(int(new Date().getTime()/1000);)}", - "value": "50.0" -} - = - - - - - - - - - - /v2.0/metrics - POST - false - false - true - false - false - - - - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - false - false - false - false - false - 0 - true - - - - - - - - diff --git a/tests/notification.json b/tests/notification.json deleted file mode 100644 index fd8ec8b..0000000 --- a/tests/notification.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "mini-mon test", - "type": "EMAIL", - "address": "%s" -}