~ubuntu-branches/ubuntu/saucy/heat/saucy

« back to all changes in this revision

Viewing changes to heat/tests/test_ceilometer_alarm.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2013-09-08 21:51:19 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130908215119-r939tu4aumqgdrkx
Tags: 2013.2~b3-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/control: Add python-netaddr as build-dep.
* debian/heat-common.install: Remove heat-boto and associated man-page
* debian/heat-common.install: Remove heat-cfn and associated man-page
* debian/heat-common.install: Remove heat-watch and associated man-page
* debian/patches/fix-sqlalchemy-0.8.patch: Dropped

[ Adam Gandelman ]
* debian/patches/default-kombu.patch: Dropped.
* debian/patches/default-sqlite.patch: Refreshed.
* debian/*.install, rules: Install heat.conf.sample as common
  config file in heat-common. Drop other per-package configs, they
  are no longer used.
* debian/rules: Clean pbr .egg from build dir if it exists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from heat.tests.common import HeatTestCase
26
26
from heat.tests import utils
27
27
 
28
 
from heat.common import context
29
28
from heat.common import template_format
30
29
 
31
30
from heat.openstack.common.importutils import try_import
44
43
  "Parameters" : {},
45
44
  "Resources" : {
46
45
    "MEMAlarmHigh": {
47
 
     "Type": "OS::Metering::Alarm",
 
46
     "Type": "OS::Ceilometer::Alarm",
48
47
     "Properties": {
49
48
        "description": "Scale-up if MEM > 50% for 1 minute",
50
49
        "counter_name": "MemoryUtilization",
93
92
                                 generic_resource.SignalResource)
94
93
 
95
94
        cfg.CONF.set_default('heat_waitcondition_server_url',
96
 
                             'http://127.0.0.1:8000/v1/waitcondition')
 
95
                             'http://server.test:8000/v1/waitcondition')
97
96
 
98
97
        self.fc = fakes.FakeKeystoneClient()
99
98
        self.fa = FakeCeilometerClient()
105
104
            template = alarm_template
106
105
        temp = template_format.parse(template)
107
106
        template = parser.Template(temp)
108
 
        ctx = context.get_admin_context()
 
107
        ctx = utils.dummy_context()
109
108
        ctx.tenant_id = 'test_tenant'
110
109
        stack = parser.Stack(ctx, utils.random_name(), template,
111
110
                             disable_rollback=True)
164
163
        snippet['Properties']['alarm_actions'] = []
165
164
        snippet['Properties']['ok_actions'] = ['signal_handler']
166
165
 
167
 
        self.assertEqual(None, rsrc.update(snippet))
 
166
        scheduler.TaskRunner(rsrc.update, snippet)()
168
167
 
169
168
        self.m.VerifyAll()
170
169
 
189
188
        snippet = copy.deepcopy(rsrc.parsed_template())
190
189
        snippet['Properties']['counter_name'] = 'temp'
191
190
 
192
 
        self.assertRaises(resource.UpdateReplace,
193
 
                          rsrc.update, snippet)
 
191
        updater = scheduler.TaskRunner(rsrc.update, snippet)
 
192
        self.assertRaises(resource.UpdateReplace, updater)
194
193
 
195
194
        self.m.VerifyAll()
196
195