do_snapshot 0.6.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -2
- data/bin/do_snapshot +1 -0
- data/lib/do_snapshot.rb +1 -0
- data/lib/do_snapshot/adapter.rb +10 -7
- data/lib/do_snapshot/adapter/abstract.rb +2 -1
- data/lib/do_snapshot/adapter/{digitalocean_v2.rb → droplet_kit.rb} +50 -33
- data/lib/do_snapshot/cli.rb +1 -0
- data/lib/do_snapshot/command.rb +1 -0
- data/lib/do_snapshot/configuration.rb +1 -0
- data/lib/do_snapshot/core_ext/hash.rb +1 -0
- data/lib/do_snapshot/distribution.rb +1 -0
- data/lib/do_snapshot/gem_ext/resource_kit.rb +30 -0
- data/lib/do_snapshot/helpers.rb +1 -0
- data/lib/do_snapshot/log.rb +1 -0
- data/lib/do_snapshot/mail.rb +1 -0
- data/lib/do_snapshot/rspec.rb +12 -0
- data/lib/do_snapshot/rspec/adapter.rb +265 -0
- data/lib/do_snapshot/rspec/api_helpers.rb +45 -0
- data/lib/do_snapshot/rspec/api_v2_helpers.rb +157 -0
- data/lib/do_snapshot/rspec/environment.rb +120 -0
- data/lib/do_snapshot/rspec/uri_helpers.rb +17 -0
- data/lib/do_snapshot/runner.rb +1 -0
- data/lib/do_snapshot/version.rb +2 -1
- data/spec/do_snapshot/adapter/abstract_spec.rb +2 -1
- data/spec/do_snapshot/adapter/droplet_kit_spec.rb +9 -0
- data/spec/do_snapshot/adapter_spec.rb +3 -2
- data/spec/do_snapshot/cli_spec.rb +4 -3
- data/spec/do_snapshot/command_spec.rb +4 -3
- data/spec/do_snapshot/configuration_spec.rb +1 -0
- data/spec/do_snapshot/log_spec.rb +2 -1
- data/spec/do_snapshot/mail_spec.rb +2 -1
- data/spec/do_snapshot/runner_spec.rb +3 -2
- data/spec/do_snapshot_spec.rb +2 -1
- data/spec/spec_helper.rb +2 -4
- data/spec/support/aruba.rb +1 -0
- data/spec/support/matchers.rb +1 -0
- metadata +47 -20
- data/spec/do_snapshot/adapter/digitalocean_v2_spec.rb +0 -264
- data/spec/shared/api_helpers.rb +0 -41
- data/spec/shared/api_v2_helpers.rb +0 -153
- data/spec/shared/environment.rb +0 -116
- data/spec/shared/uri_helpers.rb +0 -13
@@ -1,8 +1,9 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
2
3
|
require 'spec_helper'
|
3
4
|
|
4
5
|
RSpec.describe DoSnapshot::Runner, type: :aruba do
|
5
|
-
|
6
|
+
include DoSnapshot::RSpec::Environment
|
6
7
|
|
7
8
|
context 'commands' do
|
8
9
|
context '.snap' do
|
@@ -203,7 +204,7 @@ RSpec.describe DoSnapshot::Runner, type: :aruba do
|
|
203
204
|
end
|
204
205
|
|
205
206
|
context 'API V2' do
|
206
|
-
|
207
|
+
include DoSnapshot::RSpec::ApiV2Helpers
|
207
208
|
it_behaves_like '.snap methods'
|
208
209
|
|
209
210
|
context 'when no credentials' do
|
data/spec/do_snapshot_spec.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
2
3
|
require 'spec_helper'
|
3
4
|
|
4
5
|
RSpec.describe DoSnapshot do
|
5
|
-
|
6
|
+
include DoSnapshot::RSpec::Environment
|
6
7
|
|
7
8
|
describe DoSnapshot::DropletFindError do
|
8
9
|
subject(:error) { described_class }
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
2
3
|
require 'coveralls'
|
3
4
|
Coveralls.wear! do
|
4
5
|
add_filter '/spec/*'
|
@@ -10,10 +11,7 @@ Bundler.setup
|
|
10
11
|
require 'do_snapshot/cli'
|
11
12
|
require 'webmock/rspec'
|
12
13
|
require 'fileutils'
|
13
|
-
|
14
|
-
require_relative 'shared/api_v2_helpers'
|
15
|
-
require_relative 'shared/uri_helpers'
|
16
|
-
require_relative 'shared/environment'
|
14
|
+
require 'do_snapshot/rspec'
|
17
15
|
require 'do_snapshot/core_ext/hash'
|
18
16
|
|
19
17
|
WebMock.disable_net_connect!(allow_localhost: true)
|
data/spec/support/aruba.rb
CHANGED
data/spec/support/matchers.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: do_snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Merkulov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: droplet_kit
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "<"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: thor
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.19.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.19.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: hashie
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
59
|
- - "~>"
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
61
|
+
version: 3.5.6
|
34
62
|
type: :runtime
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
66
|
- - "~>"
|
39
67
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
68
|
+
version: 3.5.6
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: pony
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,20 +94,27 @@ files:
|
|
66
94
|
- lib/do_snapshot.rb
|
67
95
|
- lib/do_snapshot/adapter.rb
|
68
96
|
- lib/do_snapshot/adapter/abstract.rb
|
69
|
-
- lib/do_snapshot/adapter/
|
97
|
+
- lib/do_snapshot/adapter/droplet_kit.rb
|
70
98
|
- lib/do_snapshot/cli.rb
|
71
99
|
- lib/do_snapshot/command.rb
|
72
100
|
- lib/do_snapshot/configuration.rb
|
73
101
|
- lib/do_snapshot/core_ext/hash.rb
|
74
102
|
- lib/do_snapshot/distribution.rb
|
103
|
+
- lib/do_snapshot/gem_ext/resource_kit.rb
|
75
104
|
- lib/do_snapshot/helpers.rb
|
76
105
|
- lib/do_snapshot/log.rb
|
77
106
|
- lib/do_snapshot/mail.rb
|
107
|
+
- lib/do_snapshot/rspec.rb
|
108
|
+
- lib/do_snapshot/rspec/adapter.rb
|
109
|
+
- lib/do_snapshot/rspec/api_helpers.rb
|
110
|
+
- lib/do_snapshot/rspec/api_v2_helpers.rb
|
111
|
+
- lib/do_snapshot/rspec/environment.rb
|
112
|
+
- lib/do_snapshot/rspec/uri_helpers.rb
|
78
113
|
- lib/do_snapshot/runner.rb
|
79
114
|
- lib/do_snapshot/version.rb
|
80
115
|
- spec/.keep
|
81
116
|
- spec/do_snapshot/adapter/abstract_spec.rb
|
82
|
-
- spec/do_snapshot/adapter/
|
117
|
+
- spec/do_snapshot/adapter/droplet_kit_spec.rb
|
83
118
|
- spec/do_snapshot/adapter_spec.rb
|
84
119
|
- spec/do_snapshot/cli_spec.rb
|
85
120
|
- spec/do_snapshot/command_spec.rb
|
@@ -101,10 +136,6 @@ files:
|
|
101
136
|
- spec/fixtures/digitalocean/v2/show_event_power_on_done.json
|
102
137
|
- spec/fixtures/digitalocean/v2/show_event_power_on_start.json
|
103
138
|
- spec/fixtures/digitalocean/v2/show_event_start.json
|
104
|
-
- spec/shared/api_helpers.rb
|
105
|
-
- spec/shared/api_v2_helpers.rb
|
106
|
-
- spec/shared/environment.rb
|
107
|
-
- spec/shared/uri_helpers.rb
|
108
139
|
- spec/spec_helper.rb
|
109
140
|
- spec/support/aruba.rb
|
110
141
|
- spec/support/matchers.rb
|
@@ -120,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
151
|
requirements:
|
121
152
|
- - ">="
|
122
153
|
- !ruby/object:Gem::Version
|
123
|
-
version:
|
154
|
+
version: 2.0.0
|
124
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
156
|
requirements:
|
126
157
|
- - ">="
|
@@ -128,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
159
|
version: '0'
|
129
160
|
requirements: []
|
130
161
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.6.
|
162
|
+
rubygems_version: 2.6.11
|
132
163
|
signing_key:
|
133
164
|
specification_version: 4
|
134
165
|
summary: A command-line snapshot maker for your DigitalOcean droplets. Fully Automated.
|
@@ -136,7 +167,7 @@ summary: A command-line snapshot maker for your DigitalOcean droplets. Fully Aut
|
|
136
167
|
test_files:
|
137
168
|
- spec/.keep
|
138
169
|
- spec/do_snapshot/adapter/abstract_spec.rb
|
139
|
-
- spec/do_snapshot/adapter/
|
170
|
+
- spec/do_snapshot/adapter/droplet_kit_spec.rb
|
140
171
|
- spec/do_snapshot/adapter_spec.rb
|
141
172
|
- spec/do_snapshot/cli_spec.rb
|
142
173
|
- spec/do_snapshot/command_spec.rb
|
@@ -158,10 +189,6 @@ test_files:
|
|
158
189
|
- spec/fixtures/digitalocean/v2/show_event_power_on_done.json
|
159
190
|
- spec/fixtures/digitalocean/v2/show_event_power_on_start.json
|
160
191
|
- spec/fixtures/digitalocean/v2/show_event_start.json
|
161
|
-
- spec/shared/api_helpers.rb
|
162
|
-
- spec/shared/api_v2_helpers.rb
|
163
|
-
- spec/shared/environment.rb
|
164
|
-
- spec/shared/uri_helpers.rb
|
165
192
|
- spec/spec_helper.rb
|
166
193
|
- spec/support/aruba.rb
|
167
194
|
- spec/support/matchers.rb
|
@@ -1,264 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
RSpec.describe DoSnapshot::Adapter::DigitaloceanV2 do
|
5
|
-
include_context 'environment'
|
6
|
-
include_context 'api_v2_helpers'
|
7
|
-
|
8
|
-
subject(:api) { described_class }
|
9
|
-
subject(:log) { DoSnapshot::Log }
|
10
|
-
|
11
|
-
describe '.initialize' do
|
12
|
-
describe '#delay' do
|
13
|
-
let(:delay) { 5 }
|
14
|
-
let(:instance) { api.new(delay: delay) }
|
15
|
-
it('with custom delay') { expect(instance.delay).to eq delay }
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '#timeout' do
|
19
|
-
let(:timeout) { 5 }
|
20
|
-
let(:instance) { api.new(timeout: timeout) }
|
21
|
-
it('with custom timeout') { expect(instance.timeout).to eq timeout }
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe 'droplets' do
|
26
|
-
let(:instance) { api.new(delay: delay, timeout: timeout) }
|
27
|
-
include_context 'uri_helpers'
|
28
|
-
|
29
|
-
describe '.droplet' do
|
30
|
-
it 'with droplet' do
|
31
|
-
stub_droplet(droplet_id)
|
32
|
-
|
33
|
-
instance.droplet(droplet_id)
|
34
|
-
|
35
|
-
expect(a_request(:get, droplet_url))
|
36
|
-
.to have_been_made
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'with error' do
|
40
|
-
stub_droplet_fail(droplet_id)
|
41
|
-
|
42
|
-
expect { instance.droplet(droplet_id) }
|
43
|
-
.to raise_error(DoSnapshot::DropletFindError)
|
44
|
-
expect(DoSnapshot.logger.buffer)
|
45
|
-
.to include "Droplet id: #{droplet_id} Not Found"
|
46
|
-
|
47
|
-
expect(a_request(:get, droplet_url))
|
48
|
-
.to have_been_made
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe '.droplets' do
|
53
|
-
it 'with droplets' do
|
54
|
-
stub_droplets
|
55
|
-
|
56
|
-
instance.droplets
|
57
|
-
|
58
|
-
expect(a_request(:get, droplets_uri))
|
59
|
-
.to have_been_made
|
60
|
-
end
|
61
|
-
|
62
|
-
it 'with error' do
|
63
|
-
stub_droplets_fail
|
64
|
-
|
65
|
-
expect { instance.droplets }.to raise_error(DoSnapshot::DropletListError)
|
66
|
-
expect(DoSnapshot.logger.buffer)
|
67
|
-
.to include 'Droplet Listing is failed to retrieve'
|
68
|
-
|
69
|
-
expect(a_request(:get, droplets_uri))
|
70
|
-
.to have_been_made
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
describe '.start_droplet' do
|
75
|
-
it 'with event' do
|
76
|
-
stub_droplet_inactive(droplet_id)
|
77
|
-
stub_droplet_start(droplet_id)
|
78
|
-
|
79
|
-
instance.start_droplet(droplet_id)
|
80
|
-
expect(DoSnapshot.logger.buffer).to include "Droplet id: #{droplet_id} is requested for Power On."
|
81
|
-
|
82
|
-
expect(a_request(:post, droplet_start_url))
|
83
|
-
.to have_been_made
|
84
|
-
expect(a_request(:get, droplet_url))
|
85
|
-
.to have_been_made
|
86
|
-
end
|
87
|
-
|
88
|
-
it 'with warning message' do
|
89
|
-
stub_droplet(droplet_id)
|
90
|
-
|
91
|
-
expect { instance.start_droplet(droplet_id) }
|
92
|
-
.not_to raise_error
|
93
|
-
expect(DoSnapshot.logger.buffer)
|
94
|
-
.to include "Droplet #{droplet_id} is still running. Skipping."
|
95
|
-
|
96
|
-
expect(a_request(:get, droplet_url))
|
97
|
-
.to have_been_made
|
98
|
-
end
|
99
|
-
|
100
|
-
it 'with error' do
|
101
|
-
stub_droplet_fail(droplet_id)
|
102
|
-
|
103
|
-
expect { instance.start_droplet(droplet_id) }
|
104
|
-
.to raise_error(DoSnapshot::DropletFindError)
|
105
|
-
|
106
|
-
expect(a_request(:get, droplet_url))
|
107
|
-
.to have_been_made
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
describe '.stop_droplet by power status' do
|
112
|
-
let(:instance) { api.new(delay: delay, timeout: timeout, stop_by: :power_status) }
|
113
|
-
|
114
|
-
it 'with success' do
|
115
|
-
stub_event_done(event_id)
|
116
|
-
stub_droplet_stop(droplet_id)
|
117
|
-
stub_droplet_inactive(droplet_id)
|
118
|
-
|
119
|
-
instance.stop_droplet(droplet_id)
|
120
|
-
|
121
|
-
expect(a_request(:post, droplet_stop_url))
|
122
|
-
.to have_been_made
|
123
|
-
expect(a_request(:get, droplet_url))
|
124
|
-
.to have_been_made
|
125
|
-
end
|
126
|
-
|
127
|
-
it 'with error' do
|
128
|
-
stub_droplet_stop_fail(droplet_id)
|
129
|
-
stub_droplet(droplet_id)
|
130
|
-
instance.timeout = 1
|
131
|
-
expect { instance.stop_droplet(droplet_id) }
|
132
|
-
.to raise_error(DoSnapshot::DropletShutdownError)
|
133
|
-
instance.timeout = timeout
|
134
|
-
expect(DoSnapshot.logger.buffer)
|
135
|
-
.to include 'Droplet id: 100823 is Failed to Power Off.'
|
136
|
-
|
137
|
-
expect(a_request(:post, droplet_stop_url))
|
138
|
-
.to have_been_made
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
describe '.stop_droplet by event' do
|
143
|
-
it 'with success' do
|
144
|
-
stub_event_done(event_id)
|
145
|
-
stub_droplet_stop(droplet_id)
|
146
|
-
|
147
|
-
instance.stop_droplet(droplet_id)
|
148
|
-
|
149
|
-
expect(a_request(:post, droplet_stop_url))
|
150
|
-
.to have_been_made
|
151
|
-
expect(a_request(:get, action_find_url))
|
152
|
-
.to have_been_made
|
153
|
-
end
|
154
|
-
|
155
|
-
it 'with error' do
|
156
|
-
stub_droplet_stop_fail(droplet_id)
|
157
|
-
|
158
|
-
expect { instance.stop_droplet(droplet_id) }
|
159
|
-
.to raise_error(DoSnapshot::DropletShutdownError)
|
160
|
-
expect(DoSnapshot.logger.buffer)
|
161
|
-
.to include 'Droplet id: 100823 is Failed to Power Off.'
|
162
|
-
|
163
|
-
expect(a_request(:post, droplet_stop_url))
|
164
|
-
.to have_been_made
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
|
-
describe '.create_snapshot' do
|
169
|
-
it 'with success' do
|
170
|
-
stub_event_done(event_id)
|
171
|
-
stub_droplet_snapshot(droplet_id, snapshot_name)
|
172
|
-
|
173
|
-
expect { instance.create_snapshot(droplet_id, snapshot_name) }
|
174
|
-
.not_to raise_error
|
175
|
-
|
176
|
-
expect(a_request(:post, droplet_snapshot_url))
|
177
|
-
.to have_been_made
|
178
|
-
expect(a_request(:get, action_find_url))
|
179
|
-
.to have_been_made
|
180
|
-
end
|
181
|
-
|
182
|
-
it 'with error' do
|
183
|
-
stub_droplet_snapshot_fail(droplet_id, snapshot_name)
|
184
|
-
|
185
|
-
expect { instance.create_snapshot(droplet_id, snapshot_name) }
|
186
|
-
.to raise_error(DoSnapshot::SnapshotCreateError)
|
187
|
-
|
188
|
-
expect(a_request(:post, droplet_snapshot_url))
|
189
|
-
.to have_been_made
|
190
|
-
end
|
191
|
-
|
192
|
-
it 'with event error' do
|
193
|
-
stub_droplet_snapshot(droplet_id, snapshot_name)
|
194
|
-
stub_event_fail(event_id)
|
195
|
-
|
196
|
-
expect { instance.create_snapshot(droplet_id, snapshot_name) }
|
197
|
-
.not_to raise_error
|
198
|
-
expect(DoSnapshot.logger.buffer)
|
199
|
-
.to include "Event id: #{event_id} is failed!"
|
200
|
-
|
201
|
-
expect(a_request(:post, droplet_snapshot_url))
|
202
|
-
.to have_been_made
|
203
|
-
expect(a_request(:get, action_find_url))
|
204
|
-
.to have_been_made
|
205
|
-
end
|
206
|
-
end
|
207
|
-
|
208
|
-
describe '.inactive?' do
|
209
|
-
it 'when inactive' do
|
210
|
-
stub_droplet_inactive(droplet_id)
|
211
|
-
|
212
|
-
expect(instance.inactive?(droplet_id))
|
213
|
-
.to be_truthy
|
214
|
-
end
|
215
|
-
|
216
|
-
it 'when active' do
|
217
|
-
stub_droplet(droplet_id)
|
218
|
-
|
219
|
-
expect(instance.inactive?(droplet_id))
|
220
|
-
.to be_falsey
|
221
|
-
end
|
222
|
-
end
|
223
|
-
|
224
|
-
describe '.cleanup_snapshots' do
|
225
|
-
it 'with success' do
|
226
|
-
stub_droplet(droplet_id)
|
227
|
-
stub_image_destroy(image_id)
|
228
|
-
stub_image_destroy(image_id2)
|
229
|
-
|
230
|
-
droplet = instance.droplet(droplet_id)
|
231
|
-
expect { instance.cleanup_snapshots(droplet, 1) }
|
232
|
-
.not_to raise_error
|
233
|
-
expect(DoSnapshot.logger.buffer)
|
234
|
-
.to include 'Snapshot: 5019770 delete requested.'
|
235
|
-
|
236
|
-
expect(a_request(:get, droplet_url))
|
237
|
-
.to have_been_made
|
238
|
-
expect(a_request(:delete, image_destroy_url))
|
239
|
-
.to have_been_made
|
240
|
-
expect(a_request(:delete, image_destroy2_url))
|
241
|
-
.to have_been_made
|
242
|
-
end
|
243
|
-
|
244
|
-
it 'with warning message' do
|
245
|
-
stub_droplet(droplet_id)
|
246
|
-
stub_image_destroy_fail(image_id)
|
247
|
-
stub_image_destroy_fail(image_id2)
|
248
|
-
|
249
|
-
droplet = instance.droplet(droplet_id)
|
250
|
-
expect { instance.cleanup_snapshots(droplet, 1) }
|
251
|
-
.not_to raise_error
|
252
|
-
expect(DoSnapshot.logger.buffer)
|
253
|
-
.to include 'Destroy of snapshot 5019903 for droplet id: 100823 name: example.com is failed.'
|
254
|
-
|
255
|
-
expect(a_request(:get, droplet_url))
|
256
|
-
.to have_been_made
|
257
|
-
expect(a_request(:delete, image_destroy_url))
|
258
|
-
.to have_been_made
|
259
|
-
expect(a_request(:delete, image_destroy2_url))
|
260
|
-
.to have_been_made
|
261
|
-
end
|
262
|
-
end
|
263
|
-
end
|
264
|
-
end
|