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