2013-09-05 08:10:13 -04:00
|
|
|
Shindo.tests('Fog::Rackspace::AutoScale | policy', ['rackspace', 'rackspace_autoscale']) do
|
2013-09-27 14:27:36 -04:00
|
|
|
|
2013-09-05 08:10:13 -04:00
|
|
|
service = Fog::Rackspace::AutoScale.new :rackspace_region => :ord
|
|
|
|
|
2013-09-30 16:52:53 -04:00
|
|
|
pending if Fog.mocking?
|
|
|
|
|
2013-10-02 09:57:02 -04:00
|
|
|
begin
|
|
|
|
group = service.groups.create({
|
|
|
|
:policies => POLICIES_OPTIONS,
|
|
|
|
:group_config => GROUP_CONFIG_OPTIONS,
|
|
|
|
:launch_config => LAUNCH_CONFIG_OPTIONS
|
|
|
|
})
|
2013-09-05 08:10:13 -04:00
|
|
|
|
2013-10-02 09:57:02 -04:00
|
|
|
options = {
|
|
|
|
:name => "policy 2",
|
2013-10-02 14:18:23 -04:00
|
|
|
:change => 1,
|
2013-10-02 09:57:02 -04:00
|
|
|
:cooldown => 100,
|
|
|
|
:type => 'webhook',
|
|
|
|
:group => group
|
|
|
|
}
|
2013-09-05 08:10:13 -04:00
|
|
|
|
2013-09-16 05:34:07 -04:00
|
|
|
model_tests(group.policies, options, false) do
|
2013-10-02 14:18:23 -04:00
|
|
|
tests('#execute').succeeds do
|
|
|
|
@instance.execute
|
|
|
|
end
|
2013-09-16 05:34:07 -04:00
|
|
|
tests('#webhooks').succeeds do
|
|
|
|
@instance.webhooks
|
|
|
|
end
|
2013-09-05 08:10:13 -04:00
|
|
|
end
|
2013-09-16 05:34:07 -04:00
|
|
|
ensure
|
2013-10-02 14:18:23 -04:00
|
|
|
deactive_auto_scale_group(group)
|
2013-10-02 09:57:02 -04:00
|
|
|
group.destroy if group
|
2013-09-05 08:10:13 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|