MuranoCLI 3.2.0.beta.1 → 3.2.0.beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/.trustme.plugin +137 -0
- data/.trustme.sh +217 -117
- data/.trustme.vim +9 -3
- data/Gemfile +9 -3
- data/MuranoCLI.gemspec +8 -5
- data/Rakefile +1 -0
- data/dockers/Dockerfile.2.2.9 +6 -3
- data/dockers/Dockerfile.2.3.6 +6 -3
- data/dockers/Dockerfile.2.4.3 +6 -3
- data/dockers/Dockerfile.2.5.0 +6 -3
- data/dockers/Dockerfile.GemRelease +10 -8
- data/dockers/Dockerfile.m4 +23 -5
- data/dockers/docker-test.sh +65 -28
- data/docs/completions/murano_completion-bash +751 -57
- data/docs/develop.rst +10 -9
- data/lib/MrMurano/AccountBase.rb +95 -6
- data/lib/MrMurano/Commander-Entry.rb +9 -4
- data/lib/MrMurano/Config-Migrate.rb +2 -0
- data/lib/MrMurano/Config.rb +94 -26
- data/lib/MrMurano/Content.rb +1 -1
- data/lib/MrMurano/Exchange.rb +77 -42
- data/lib/MrMurano/Gateway.rb +1 -1
- data/lib/MrMurano/HttpAuthed.rb +20 -7
- data/lib/MrMurano/Logs.rb +10 -1
- data/lib/MrMurano/ProjectFile.rb +1 -1
- data/lib/MrMurano/ReCommander.rb +129 -73
- data/lib/MrMurano/Solution-ServiceConfig.rb +18 -11
- data/lib/MrMurano/Solution-Services.rb +78 -50
- data/lib/MrMurano/Solution-Users.rb +1 -1
- data/lib/MrMurano/Solution.rb +13 -63
- data/lib/MrMurano/SyncUpDown-Core.rb +185 -77
- data/lib/MrMurano/SyncUpDown-Item.rb +29 -4
- data/lib/MrMurano/SyncUpDown.rb +11 -11
- data/lib/MrMurano/Webservice-Cors.rb +1 -1
- data/lib/MrMurano/Webservice-Endpoint.rb +28 -17
- data/lib/MrMurano/Webservice-File.rb +103 -43
- data/lib/MrMurano/commands/domain.rb +1 -0
- data/lib/MrMurano/commands/element.rb +585 -0
- data/lib/MrMurano/commands/exchange.rb +211 -204
- data/lib/MrMurano/commands/gb.rb +1 -0
- data/lib/MrMurano/commands/globals.rb +17 -7
- data/lib/MrMurano/commands/init.rb +115 -101
- data/lib/MrMurano/commands/keystore.rb +1 -1
- data/lib/MrMurano/commands/logs.rb +2 -1
- data/lib/MrMurano/commands/postgresql.rb +17 -7
- data/lib/MrMurano/commands/service.rb +572 -0
- data/lib/MrMurano/commands/show.rb +7 -3
- data/lib/MrMurano/commands/solution.rb +2 -1
- data/lib/MrMurano/commands/solution_picker.rb +31 -15
- data/lib/MrMurano/commands/status.rb +205 -169
- data/lib/MrMurano/commands/sync.rb +70 -38
- data/lib/MrMurano/commands/token.rb +59 -14
- data/lib/MrMurano/commands/usage.rb +1 -0
- data/lib/MrMurano/commands.rb +2 -0
- data/lib/MrMurano/hash.rb +91 -0
- data/lib/MrMurano/http.rb +55 -6
- data/lib/MrMurano/makePretty.rb +47 -0
- data/lib/MrMurano/optparse.rb +60 -45
- data/lib/MrMurano/variegated/TruthyFalsey.rb +48 -0
- data/lib/MrMurano/variegated/ruby_dig.rb +64 -0
- data/lib/MrMurano/verbosing.rb +113 -3
- data/lib/MrMurano/version.rb +1 -1
- data/spec/Account_spec.rb +34 -20
- data/spec/Business_spec.rb +12 -9
- data/spec/Config_spec.rb +7 -1
- data/spec/Content_spec.rb +17 -1
- data/spec/GatewayBase_spec.rb +5 -2
- data/spec/GatewayDevice_spec.rb +4 -2
- data/spec/GatewayResource_spec.rb +4 -1
- data/spec/GatewaySettings_spec.rb +4 -1
- data/spec/HttpAuthed_spec.rb +73 -0
- data/spec/Http_spec.rb +32 -35
- data/spec/ProjectFile_spec.rb +1 -1
- data/spec/Solution-ServiceConfig_spec.rb +4 -1
- data/spec/Solution-ServiceEventHandler_spec.rb +6 -3
- data/spec/Solution-ServiceModules_spec.rb +4 -1
- data/spec/Solution-UsersRoles_spec.rb +4 -1
- data/spec/Solution_spec.rb +4 -1
- data/spec/SyncUpDown_spec.rb +1 -1
- data/spec/Webservice-Cors_spec.rb +4 -1
- data/spec/Webservice-Endpoint_spec.rb +9 -6
- data/spec/Webservice-File_spec.rb +17 -4
- data/spec/Webservice-Setting_spec.rb +6 -2
- data/spec/_workspace.rb +2 -0
- data/spec/cmd_common.rb +42 -13
- data/spec/cmd_content_spec.rb +17 -7
- data/spec/cmd_device_spec.rb +1 -1
- data/spec/cmd_domain_spec.rb +2 -2
- data/spec/cmd_element_spec.rb +400 -0
- data/spec/cmd_exchange_spec.rb +2 -2
- data/spec/cmd_init_spec.rb +59 -25
- data/spec/cmd_keystore_spec.rb +6 -3
- data/spec/cmd_link_spec.rb +10 -5
- data/spec/cmd_logs_spec.rb +1 -1
- data/spec/cmd_setting_application_spec.rb +18 -15
- data/spec/cmd_setting_product_spec.rb +7 -7
- data/spec/cmd_status_spec.rb +27 -17
- data/spec/cmd_syncdown_application_spec.rb +30 -3
- data/spec/cmd_syncdown_both_spec.rb +72 -18
- data/spec/cmd_syncup_spec.rb +71 -5
- data/spec/cmd_token_spec.rb +2 -2
- data/spec/cmd_usage_spec.rb +2 -2
- data/spec/dry_run_formatter.rb +27 -0
- data/spec/fixtures/dumped_config +8 -0
- data/spec/fixtures/exchange_element/element-show.json +1 -0
- data/spec/fixtures/exchange_element/swagger-mur-6407__10k.yaml +282 -0
- data/spec/fixtures/exchange_element/swagger-mur-6407__20k.yaml +588 -0
- data/spec/variegated_TruthyFalsey_spec.rb +29 -0
- metadata +51 -25
data/spec/cmd_init_spec.rb
CHANGED
|
@@ -54,12 +54,12 @@ RSpec.describe 'murano init', :cmd do
|
|
|
54
54
|
expecting += [
|
|
55
55
|
"This business does not have any applications. Let's create one\n", # 7
|
|
56
56
|
"\n", # 8
|
|
57
|
-
"
|
|
57
|
+
"Enter the Application name [leave blank to skip]: \n", # 9
|
|
58
58
|
a_string_starting_with('Created new Application: '), # 10
|
|
59
59
|
"\n", # 11
|
|
60
60
|
"This business does not have any products. Let's create one\n", # 12
|
|
61
61
|
"\n", # 13
|
|
62
|
-
"
|
|
62
|
+
"Enter the Product name [leave blank to skip]: \n", # 14
|
|
63
63
|
a_string_starting_with('Created new Product: '), # 15
|
|
64
64
|
"\n", # 16
|
|
65
65
|
]
|
|
@@ -107,17 +107,29 @@ RSpec.describe 'murano init', :cmd do
|
|
|
107
107
|
"\n",
|
|
108
108
|
]
|
|
109
109
|
end
|
|
110
|
+
|
|
111
|
+
# 2017-12-15: Currently:
|
|
112
|
+
# services{product.id}_event.lua
|
|
113
|
+
# services/user_account.lua
|
|
114
|
+
# specs/resources.yaml
|
|
115
|
+
# 2018-04-11: Currently:
|
|
116
|
+
# "Updating local product resources\n",
|
|
117
|
+
# "Adding item config_service\n",
|
|
118
|
+
# "Adding item config_status\n",
|
|
119
|
+
# "Adding item user_account\n",
|
|
120
|
+
# "Adding item g3vm2aa9xjfy00000_event\n",
|
|
121
|
+
# "Adding item config_service\n",
|
|
122
|
+
# "Adding item config_status\n",
|
|
123
|
+
# "Synced 7 items\n",
|
|
110
124
|
expecting += [
|
|
111
|
-
# 2017-12-15: Currently:
|
|
112
|
-
# services{product.id}_event.lua
|
|
113
|
-
# services/user_account.lua
|
|
114
|
-
# specs/resources.yaml
|
|
115
125
|
"Updating local product resources\n",
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
126
|
+
]
|
|
127
|
+
6.times { expecting += [t.a_string_starting_with('Adding item ')] }
|
|
128
|
+
expecting += [
|
|
129
|
+
"Synced 7 items\n",
|
|
119
130
|
"\n",
|
|
120
131
|
]
|
|
132
|
+
|
|
121
133
|
expecting += [
|
|
122
134
|
"Success!\n",
|
|
123
135
|
"\n",
|
|
@@ -148,13 +160,17 @@ RSpec.describe 'murano init', :cmd do
|
|
|
148
160
|
murano_solutions_expunge_yes
|
|
149
161
|
|
|
150
162
|
@applctn_name = rname('initEmptyApp')
|
|
151
|
-
out, err, status = Open3.capture3(
|
|
163
|
+
out, err, status = Open3.capture3(
|
|
164
|
+
capcmd('murano', 'application', 'create', @applctn_name, '--save')
|
|
165
|
+
)
|
|
152
166
|
expect(err).to eq('')
|
|
153
167
|
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
|
154
168
|
expect(status.exitstatus).to eq(0)
|
|
155
169
|
|
|
156
170
|
@product_name = rname('initEmptyPrd')
|
|
157
|
-
out, err, status = Open3.capture3(
|
|
171
|
+
out, err, status = Open3.capture3(
|
|
172
|
+
capcmd('murano', 'product', 'create', @product_name, '--save')
|
|
173
|
+
)
|
|
158
174
|
expect(err).to eq('')
|
|
159
175
|
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
|
160
176
|
expect(status.exitstatus).to eq(0)
|
|
@@ -162,19 +178,24 @@ RSpec.describe 'murano init', :cmd do
|
|
|
162
178
|
# delete all of this so it is a empty directory.
|
|
163
179
|
FileUtils.remove_entry('.murano')
|
|
164
180
|
end
|
|
181
|
+
|
|
165
182
|
after(:example) do
|
|
166
|
-
out, err, status = Open3.capture3(
|
|
183
|
+
out, err, status = Open3.capture3(
|
|
184
|
+
capcmd('murano', 'solution', 'delete', @product_name, '-y')
|
|
185
|
+
)
|
|
167
186
|
expect(out).to eq('')
|
|
168
187
|
expect(err).to eq('')
|
|
169
188
|
expect(status.exitstatus).to eq(0)
|
|
170
189
|
|
|
171
|
-
out, err, status = Open3.capture3(
|
|
190
|
+
out, err, status = Open3.capture3(
|
|
191
|
+
capcmd('murano', 'solution', 'delete', @applctn_name, '-y')
|
|
192
|
+
)
|
|
172
193
|
expect(out).to eq('')
|
|
173
194
|
expect(err).to eq('')
|
|
174
195
|
expect(status.exitstatus).to eq(0)
|
|
175
196
|
end
|
|
176
197
|
|
|
177
|
-
it 'existing project' do
|
|
198
|
+
it 'existing project', :club_20s, :club_10s do
|
|
178
199
|
# The test account will have one business, one product, and one application.
|
|
179
200
|
# So it won't ask any questions.
|
|
180
201
|
out, err, status = Open3.capture3(capcmd('murano', 'init'))
|
|
@@ -204,18 +225,22 @@ RSpec.describe 'murano init', :cmd do
|
|
|
204
225
|
@product_name = rname('initCreatingPrd')
|
|
205
226
|
end
|
|
206
227
|
after(:example) do
|
|
207
|
-
out, err, status = Open3.capture3(
|
|
228
|
+
out, err, status = Open3.capture3(
|
|
229
|
+
capcmd('murano', 'solution', 'delete', @product_name, '-y')
|
|
230
|
+
)
|
|
208
231
|
expect(out).to eq('')
|
|
209
232
|
expect(err).to eq('')
|
|
210
233
|
expect(status.exitstatus).to eq(0)
|
|
211
234
|
|
|
212
|
-
out, err, status = Open3.capture3(
|
|
235
|
+
out, err, status = Open3.capture3(
|
|
236
|
+
capcmd('murano', 'solution', 'delete', @applctn_name, '-y')
|
|
237
|
+
)
|
|
213
238
|
expect(out).to eq('')
|
|
214
239
|
expect(err).to eq('')
|
|
215
240
|
expect(status.exitstatus).to eq(0)
|
|
216
241
|
end
|
|
217
242
|
|
|
218
|
-
it 'existing project' do
|
|
243
|
+
it 'existing project', :club_20s, :club_10s do
|
|
219
244
|
# The test account will have one business.
|
|
220
245
|
# It will ask to create an application and product.
|
|
221
246
|
# MAGIC_NUMBER: !!!! the 8 is hardcoded indention here !!!!
|
|
@@ -288,28 +313,37 @@ RSpec.describe 'murano init', :cmd do
|
|
|
288
313
|
FileUtils.move('assets', 'files')
|
|
289
314
|
|
|
290
315
|
@applctn_name = rname('initEmptyApp')
|
|
291
|
-
out, err, status = Open3.capture3(
|
|
316
|
+
out, err, status = Open3.capture3(
|
|
317
|
+
capcmd('murano', 'application', 'create', @applctn_name, '--save')
|
|
318
|
+
)
|
|
292
319
|
expect(err).to eq('')
|
|
293
320
|
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
|
294
321
|
expect(status.exitstatus).to eq(0)
|
|
295
322
|
|
|
296
323
|
@product_name = rname('initEmptyPrd')
|
|
297
|
-
out, err, status = Open3.capture3(
|
|
324
|
+
out, err, status = Open3.capture3(
|
|
325
|
+
capcmd('murano', 'product', 'create', @product_name, '--save')
|
|
326
|
+
)
|
|
298
327
|
expect(err).to eq('')
|
|
299
328
|
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
|
300
329
|
expect(status.exitstatus).to eq(0)
|
|
301
330
|
end
|
|
331
|
+
|
|
302
332
|
after(:example) do
|
|
303
333
|
Dir.chdir(ENV['HOME']) do
|
|
304
334
|
if defined?(@product_name)
|
|
305
|
-
out, err, status = Open3.capture3(
|
|
335
|
+
out, err, status = Open3.capture3(
|
|
336
|
+
capcmd('murano', 'solution', 'delete', @product_name, '-y')
|
|
337
|
+
)
|
|
306
338
|
expect(out).to eq('')
|
|
307
339
|
expect(err).to eq('')
|
|
308
340
|
expect(status.exitstatus).to eq(0)
|
|
309
341
|
end
|
|
310
342
|
|
|
311
343
|
if defined?(@applctn_name)
|
|
312
|
-
out, err, status = Open3.capture3(
|
|
344
|
+
out, err, status = Open3.capture3(
|
|
345
|
+
capcmd('murano', 'solution', 'delete', @applctn_name, '-y')
|
|
346
|
+
)
|
|
313
347
|
expect(out).to eq('')
|
|
314
348
|
expect(err).to eq('')
|
|
315
349
|
expect(status.exitstatus).to eq(0)
|
|
@@ -317,7 +351,7 @@ RSpec.describe 'murano init', :cmd do
|
|
|
317
351
|
end
|
|
318
352
|
end
|
|
319
353
|
|
|
320
|
-
it 'without ProjectFile' do
|
|
354
|
+
it 'without ProjectFile', :club_20s, :club_10s do
|
|
321
355
|
# The test account will have one business, one product, and one application.
|
|
322
356
|
# So it won't ask any questions.
|
|
323
357
|
out, err, status = Open3.capture3(capcmd('murano', 'init'))
|
|
@@ -340,7 +374,7 @@ RSpec.describe 'murano init', :cmd do
|
|
|
340
374
|
expect(File.directory?('specs')).to be true
|
|
341
375
|
end
|
|
342
376
|
|
|
343
|
-
it 'with ProjectFile' do
|
|
377
|
+
it 'with ProjectFile', :club_20s, :club_10s do
|
|
344
378
|
FileUtils.copy(File.join(@testdir, 'spec/fixtures/ProjectFiles/only_meta.yaml'), 'test.murano')
|
|
345
379
|
# The test account will have one business, one product, and one application.
|
|
346
380
|
# So it won't ask any questions.
|
|
@@ -365,7 +399,7 @@ RSpec.describe 'murano init', :cmd do
|
|
|
365
399
|
expect(File.directory?('specs')).to be true
|
|
366
400
|
end
|
|
367
401
|
|
|
368
|
-
it 'with SolutionFile 0.2.0' do
|
|
402
|
+
it 'with SolutionFile 0.2.0', :club_20s, :club_10s do
|
|
369
403
|
File.open('Solutionfile.json', 'wb') do |io|
|
|
370
404
|
io << {
|
|
371
405
|
default_page: 'index.html',
|
|
@@ -405,7 +439,7 @@ RSpec.describe 'murano init', :cmd do
|
|
|
405
439
|
expect(File.directory?('specs')).to be true
|
|
406
440
|
end
|
|
407
441
|
|
|
408
|
-
it 'with SolutionFile 0.3.0' do
|
|
442
|
+
it 'with SolutionFile 0.3.0', :club_20s, :club_10s do
|
|
409
443
|
File.open('Solutionfile.json', 'wb') do |io|
|
|
410
444
|
io << {
|
|
411
445
|
default_page: 'index.html',
|
data/spec/cmd_keystore_spec.rb
CHANGED
|
@@ -14,6 +14,8 @@ RSpec.describe 'murano keystore', :cmd, :needs_password do
|
|
|
14
14
|
include_context 'CI_CMD'
|
|
15
15
|
|
|
16
16
|
before(:example) do
|
|
17
|
+
murano_solutions_expunge_yes
|
|
18
|
+
|
|
17
19
|
@product_name = rname('keystoreTest')
|
|
18
20
|
out, err, status = Open3.capture3(capcmd('murano', 'application', 'create', @product_name, '--save'))
|
|
19
21
|
expect(err).to eq('')
|
|
@@ -25,6 +27,7 @@ RSpec.describe 'murano keystore', :cmd, :needs_password do
|
|
|
25
27
|
expect(err).to eq('')
|
|
26
28
|
expect(status.exitstatus).to eq(0)
|
|
27
29
|
end
|
|
30
|
+
|
|
28
31
|
after(:example) do
|
|
29
32
|
out, err, status = Open3.capture3(capcmd('murano', 'solution', 'delete', @product_name, '-y'))
|
|
30
33
|
expect(out).to eq('')
|
|
@@ -57,7 +60,7 @@ RSpec.describe 'murano keystore', :cmd, :needs_password do
|
|
|
57
60
|
)
|
|
58
61
|
end
|
|
59
62
|
|
|
60
|
-
it 'deletes' do
|
|
63
|
+
it 'deletes', :club_10s do
|
|
61
64
|
out, err, status = Open3.capture3(capcmd('murano', 'keystore', 'delete', 'bob'))
|
|
62
65
|
expect(out.chomp).to eq('')
|
|
63
66
|
expect(err).to eq('')
|
|
@@ -69,7 +72,7 @@ RSpec.describe 'murano keystore', :cmd, :needs_password do
|
|
|
69
72
|
expect(status.exitstatus).to eq(0)
|
|
70
73
|
end
|
|
71
74
|
|
|
72
|
-
it 'clearAll' do
|
|
75
|
+
it 'clearAll', :club_10s do
|
|
73
76
|
out, err, status = Open3.capture3(capcmd('murano', 'keystore', 'set', 'another', 'value'))
|
|
74
77
|
expect(out.chomp).to eq('')
|
|
75
78
|
expect(err).to eq('')
|
|
@@ -86,7 +89,7 @@ RSpec.describe 'murano keystore', :cmd, :needs_password do
|
|
|
86
89
|
expect(status.exitstatus).to eq(0)
|
|
87
90
|
end
|
|
88
91
|
|
|
89
|
-
it 'can call other commands' do
|
|
92
|
+
it 'can call other commands', :club_10s do
|
|
90
93
|
out, err, status = Open3.capture3(capcmd('murano', 'keystore', 'command', 'lpush', 'another', 'value'))
|
|
91
94
|
expect(out.chomp).to eq('1')
|
|
92
95
|
expect(err).to eq('')
|
data/spec/cmd_link_spec.rb
CHANGED
|
@@ -37,9 +37,14 @@ RSpec.describe 'murano link', :cmd, :needs_password do
|
|
|
37
37
|
context 'using commander' do
|
|
38
38
|
it 'will not list' do
|
|
39
39
|
# Because we run from the context of the rspec command, the :env
|
|
40
|
-
# config file will have loaded, so business.id will be set.
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
# config file will have loaded, so business.id will not be set.
|
|
41
|
+
stdout, stderr = murano_command_run('link list')
|
|
42
|
+
expect(stdout).to eq(
|
|
43
|
+
%(Please change to a project directory, or run `murano init` to create a new project.\n)
|
|
44
|
+
)
|
|
45
|
+
expect(stderr).to eq(
|
|
46
|
+
%(The "link list" command only works in a Murano project.\n)
|
|
47
|
+
)
|
|
43
48
|
end
|
|
44
49
|
end
|
|
45
50
|
end
|
|
@@ -49,7 +54,7 @@ RSpec.describe 'murano link', :cmd, :needs_password do
|
|
|
49
54
|
before(:example) { project_up(skip_link: true) }
|
|
50
55
|
after(:example) { project_down }
|
|
51
56
|
|
|
52
|
-
it 'links and lists' do
|
|
57
|
+
it 'links and lists', :club_20s, :club_10s do
|
|
53
58
|
out, err, status = Open3.capture3(capcmd('murano', 'assign', 'set'))
|
|
54
59
|
olines = out.lines
|
|
55
60
|
|
|
@@ -71,7 +76,7 @@ RSpec.describe 'murano link', :cmd, :needs_password do
|
|
|
71
76
|
expect(status.exitstatus).to eq(0)
|
|
72
77
|
end
|
|
73
78
|
|
|
74
|
-
it 'unlinks' do
|
|
79
|
+
it 'unlinks', :club_20s, :club_10s do
|
|
75
80
|
out, err, status = Open3.capture3(capcmd('murano', 'assign', 'set'))
|
|
76
81
|
#expect(out).to a_string_starting_with("Linked product #{@solz_name}")
|
|
77
82
|
olines = out.lines
|
data/spec/cmd_logs_spec.rb
CHANGED
|
@@ -29,7 +29,7 @@ RSpec.describe 'murano logs', :cmd, :needs_password do
|
|
|
29
29
|
$cfg.set('net.protocol', 'http', :project)
|
|
30
30
|
$cfg.set('application.id', 'XYZ', :project)
|
|
31
31
|
|
|
32
|
-
@acc = MrMurano::Account.
|
|
32
|
+
@acc = MrMurano::Account.new
|
|
33
33
|
allow(@acc).to receive(:login_info).and_return(email: 'bob', password: 'v')
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -11,16 +11,19 @@ require 'open3'
|
|
|
11
11
|
require 'vine'
|
|
12
12
|
require 'cmd_common'
|
|
13
13
|
|
|
14
|
-
RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
14
|
+
RSpec.describe 'murano application setting', :cmd, :needs_password do
|
|
15
15
|
include_context 'CI_CMD'
|
|
16
16
|
|
|
17
17
|
before(:example) do
|
|
18
|
+
murano_solutions_expunge_yes
|
|
19
|
+
|
|
18
20
|
@product_name = rname('settingtest')
|
|
19
21
|
out, err, status = Open3.capture3(capcmd('murano', 'application', 'create', @product_name, '--save'))
|
|
20
22
|
expect(err).to eq('')
|
|
21
23
|
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
|
22
24
|
expect(status.exitstatus).to eq(0)
|
|
23
25
|
end
|
|
26
|
+
|
|
24
27
|
after(:example) do
|
|
25
28
|
out, err, status = Open3.capture3(capcmd('murano', 'solution', 'delete', @product_name, '-y'))
|
|
26
29
|
expect(out).to eq('')
|
|
@@ -56,7 +59,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
56
59
|
# 'credentials'=>true}
|
|
57
60
|
|
|
58
61
|
context 'a bool value' do
|
|
59
|
-
it 'Yes' do
|
|
62
|
+
it 'Yes', :club_10s do
|
|
60
63
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'Yes'))
|
|
61
64
|
expect(err).to eq('')
|
|
62
65
|
expect(out).to eq('')
|
|
@@ -71,7 +74,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
71
74
|
expect(json_after).to match(@json_before)
|
|
72
75
|
end
|
|
73
76
|
|
|
74
|
-
it 'true' do
|
|
77
|
+
it 'true', :club_10s do
|
|
75
78
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'true'))
|
|
76
79
|
expect(err).to eq('')
|
|
77
80
|
expect(out).to eq('')
|
|
@@ -86,7 +89,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
86
89
|
expect(json_after).to match(@json_before)
|
|
87
90
|
end
|
|
88
91
|
|
|
89
|
-
it 'on' do
|
|
92
|
+
it 'on', :club_30s, :club_20s, :club_10s do
|
|
90
93
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'on'))
|
|
91
94
|
expect(err).to eq('')
|
|
92
95
|
expect(out).to eq('')
|
|
@@ -101,7 +104,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
101
104
|
expect(json_after).to match(@json_before)
|
|
102
105
|
end
|
|
103
106
|
|
|
104
|
-
it '1' do
|
|
107
|
+
it '1', :club_10s do
|
|
105
108
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', '1'))
|
|
106
109
|
expect(err).to eq('')
|
|
107
110
|
expect(out).to eq('')
|
|
@@ -116,14 +119,14 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
116
119
|
expect(json_after).to match(@json_before)
|
|
117
120
|
end
|
|
118
121
|
|
|
119
|
-
it 'bob' do
|
|
122
|
+
it 'bob', :club_10s do
|
|
120
123
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'bob'))
|
|
121
124
|
expect(err).to eq("\e[31mValue \"bob\" is not a bool type!\e[0m\n")
|
|
122
125
|
expect(out).to eq('')
|
|
123
126
|
expect(status.exitstatus).to eq(2)
|
|
124
127
|
end
|
|
125
128
|
|
|
126
|
-
it 'No' do
|
|
129
|
+
it 'No', :club_10s do
|
|
127
130
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'No'))
|
|
128
131
|
expect(err).to eq('')
|
|
129
132
|
expect(out).to eq('')
|
|
@@ -138,7 +141,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
138
141
|
expect(json_after).to match(@json_before)
|
|
139
142
|
end
|
|
140
143
|
|
|
141
|
-
it 'false' do
|
|
144
|
+
it 'false', :club_10s do
|
|
142
145
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'false'))
|
|
143
146
|
expect(err).to eq('')
|
|
144
147
|
expect(out).to eq('')
|
|
@@ -153,7 +156,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
153
156
|
expect(json_after).to match(@json_before)
|
|
154
157
|
end
|
|
155
158
|
|
|
156
|
-
it 'off' do
|
|
159
|
+
it 'off', :club_10s do
|
|
157
160
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', 'Off'))
|
|
158
161
|
expect(err).to eq('')
|
|
159
162
|
expect(out).to eq('')
|
|
@@ -168,7 +171,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
168
171
|
expect(json_after).to match(@json_before)
|
|
169
172
|
end
|
|
170
173
|
|
|
171
|
-
it '0' do
|
|
174
|
+
it '0', :club_30s, :club_20s, :club_10s do
|
|
172
175
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool', '0'))
|
|
173
176
|
expect(err).to eq('')
|
|
174
177
|
expect(out).to eq('')
|
|
@@ -183,7 +186,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
183
186
|
expect(json_after).to match(@json_before)
|
|
184
187
|
end
|
|
185
188
|
|
|
186
|
-
it 'on STDIN' do
|
|
189
|
+
it 'on STDIN', :club_10s do
|
|
187
190
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'origin', '--bool'), stdin_data: 'true')
|
|
188
191
|
expect(err).to eq('')
|
|
189
192
|
expect(out).to eq('')
|
|
@@ -199,7 +202,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
199
202
|
end
|
|
200
203
|
end
|
|
201
204
|
|
|
202
|
-
it 'a json array blob' do
|
|
205
|
+
it 'a json array blob', :club_10s do
|
|
203
206
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'headers', '--json', '["fidget", "forgotten", "tokens"]'))
|
|
204
207
|
expect(err).to eq('')
|
|
205
208
|
expect(out).to eq('')
|
|
@@ -214,7 +217,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
214
217
|
expect(json_after).to match(@json_before)
|
|
215
218
|
end
|
|
216
219
|
|
|
217
|
-
it 'a json array blob with STDIN' do
|
|
220
|
+
it 'a json array blob with STDIN', :club_10s do
|
|
218
221
|
out, err, status = Open3.capture3(
|
|
219
222
|
capcmd(
|
|
220
223
|
'murano',
|
|
@@ -239,7 +242,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
239
242
|
expect(json_after).to match(@json_before)
|
|
240
243
|
end
|
|
241
244
|
|
|
242
|
-
it 'an array' do
|
|
245
|
+
it 'an array', :club_10s do
|
|
243
246
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'headers', '--array', 'fidget', 'forgotten', 'tokens'))
|
|
244
247
|
expect(err).to eq('')
|
|
245
248
|
expect(out).to eq('')
|
|
@@ -254,7 +257,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
254
257
|
expect(json_after).to match(@json_before)
|
|
255
258
|
end
|
|
256
259
|
|
|
257
|
-
it 'appends an array' do
|
|
260
|
+
it 'appends an array', :club_10s do
|
|
258
261
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Webservice.cors', 'headers', '--array', '--append', 'fidget', 'forgotten', 'tokens'))
|
|
259
262
|
expect(err).to eq('')
|
|
260
263
|
expect(out).to eq('')
|
|
@@ -11,7 +11,7 @@ require 'open3'
|
|
|
11
11
|
require 'vine'
|
|
12
12
|
require 'cmd_common'
|
|
13
13
|
|
|
14
|
-
RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
14
|
+
RSpec.describe 'murano product setting', :cmd, :needs_password do
|
|
15
15
|
include_context 'CI_CMD'
|
|
16
16
|
|
|
17
17
|
before(:example) do
|
|
@@ -37,7 +37,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
37
37
|
end
|
|
38
38
|
# {'prefix'=>'', 'type'=>'opaque', 'options'=>{'casing'=>'mixed', 'length'=>0}}
|
|
39
39
|
|
|
40
|
-
it 'a string value' do
|
|
40
|
+
it 'a string value', :club_10s do
|
|
41
41
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Device2.identity_format', 'prefix', 'fidget'))
|
|
42
42
|
expect(err).to eq('')
|
|
43
43
|
expect(out).to eq('')
|
|
@@ -52,7 +52,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
52
52
|
expect(json_after).to match(@json_before)
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
it 'a forced string value' do
|
|
55
|
+
it 'a forced string value', :club_10s do
|
|
56
56
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Device2.identity_format', 'prefix', '--string', 'fidget'))
|
|
57
57
|
expect(err).to eq('')
|
|
58
58
|
expect(out).to eq('')
|
|
@@ -67,7 +67,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
67
67
|
expect(json_after).to match(@json_before)
|
|
68
68
|
end
|
|
69
69
|
|
|
70
|
-
it 'a forced string value on STDIN' do
|
|
70
|
+
it 'a forced string value on STDIN', :club_10s do
|
|
71
71
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Device2.identity_format', 'prefix', '--string'), stdin_data: 'fidget')
|
|
72
72
|
expect(err).to eq('')
|
|
73
73
|
expect(out).to eq('')
|
|
@@ -99,7 +99,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
99
99
|
# end
|
|
100
100
|
|
|
101
101
|
context 'a number value' do
|
|
102
|
-
it 'integer 12' do
|
|
102
|
+
it 'integer 12', :club_10s do
|
|
103
103
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Device2.identity_format', 'options.length', '--num', '12'))
|
|
104
104
|
expect(err).to eq('')
|
|
105
105
|
expect(out).to eq('')
|
|
@@ -114,7 +114,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
114
114
|
expect(json_after).to match(@json_before)
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
-
it 'float 12.67' do
|
|
117
|
+
it 'float 12.67', :club_10s do
|
|
118
118
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Device2.identity_format', 'options.length', '--num', '12.67'))
|
|
119
119
|
expect(err).to eq('')
|
|
120
120
|
expect(out).to eq('')
|
|
@@ -191,7 +191,7 @@ RSpec.describe 'murano setting', :cmd, :needs_password do
|
|
|
191
191
|
# expect(json_after).to match(@json_before)
|
|
192
192
|
# end
|
|
193
193
|
|
|
194
|
-
it 'merges into a dictionary' do
|
|
194
|
+
it 'merges into a dictionary', :club_10s do
|
|
195
195
|
out, err, status = Open3.capture3(capcmd('murano', 'setting', 'write', 'Device2.identity_format', '.', '--dict', '--merge', 'prefix', 'tix', 'type', 'base10'))
|
|
196
196
|
expect(err).to eq('')
|
|
197
197
|
expect(out).to eq('')
|
data/spec/cmd_status_spec.rb
CHANGED
|
@@ -104,7 +104,11 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
104
104
|
|
|
105
105
|
def match_remote_boilerplate_v1_0_0_service(slice)
|
|
106
106
|
expect(slice).to include(
|
|
107
|
+
a_string_matching(/ - \w config_service/),
|
|
108
|
+
a_string_matching(/ - \w config_status/),
|
|
107
109
|
a_string_matching(/ - \w user_account\.lua/),
|
|
110
|
+
a_string_matching(/ - \w config_service/),
|
|
111
|
+
a_string_matching(/ - \w config_status/),
|
|
108
112
|
)
|
|
109
113
|
end
|
|
110
114
|
|
|
@@ -119,7 +123,7 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
119
123
|
)
|
|
120
124
|
end
|
|
121
125
|
|
|
122
|
-
it 'status' do
|
|
126
|
+
it 'status', :club_20s, :club_10s do
|
|
123
127
|
out, err, status = Open3.capture3(capcmd('murano', 'status'))
|
|
124
128
|
expect(err).to eq('')
|
|
125
129
|
# Two problems with this output.
|
|
@@ -129,8 +133,10 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
129
133
|
expect(olines[0]).to eq("Only on local machine:\n")
|
|
130
134
|
match_syncable_contents_resources(olines[1..4])
|
|
131
135
|
match_syncable_contents(olines[5..12])
|
|
132
|
-
#expect(olines[13]).to eq("
|
|
133
|
-
expect(olines[13]).to eq("
|
|
136
|
+
#expect(olines[13]).to eq("Nothing new remotely\n")
|
|
137
|
+
expect(olines[13]).to eq("Only on remote server:\n")
|
|
138
|
+
expect(olines[14]).to eq(" - I config_service\n")
|
|
139
|
+
expect(olines[15]).to eq(" - I config_status\n")
|
|
134
140
|
# FIMXE/2017-06-23: We should DRY this long list which is same in each test.
|
|
135
141
|
# FIXME/2017-06-23: The interfaces the server creates for a new project
|
|
136
142
|
# will problem vary depending on what modules are loaded, and are likely
|
|
@@ -151,13 +157,13 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
151
157
|
# a_string_matching(%r{ M \w .*services/tsdb_exportJob\.lua}),
|
|
152
158
|
# )
|
|
153
159
|
#else
|
|
154
|
-
expect(olines[
|
|
160
|
+
expect(olines[16]).to eq("Nothing that differs\n")
|
|
155
161
|
#end
|
|
156
162
|
|
|
157
163
|
expect(status.exitstatus).to eq(0)
|
|
158
164
|
end
|
|
159
165
|
|
|
160
|
-
it 'matches file path', :broken_on_windows do
|
|
166
|
+
it 'matches file path', :broken_on_windows, :club_20s, :club_10s do
|
|
161
167
|
# capcmd calls shellwords, which escapes strings so that Open3 doesn't
|
|
162
168
|
# expand them. E.g., **/ would expand to the local directory name.
|
|
163
169
|
status_cmd = capcmd('murano', 'status', '**/icon.png')
|
|
@@ -174,7 +180,7 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
174
180
|
expect(status.exitstatus).to eq(0)
|
|
175
181
|
end
|
|
176
182
|
|
|
177
|
-
it 'matches route', :broken_on_windows do
|
|
183
|
+
it 'matches route', :broken_on_windows, :club_20s, :club_10s do
|
|
178
184
|
out, err, status = Open3.capture3(capcmd('murano', 'status', '#put#'))
|
|
179
185
|
expect(err).to eq('')
|
|
180
186
|
expect(out.lines).to match(
|
|
@@ -207,14 +213,18 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
207
213
|
)
|
|
208
214
|
end
|
|
209
215
|
|
|
210
|
-
it 'status' do
|
|
216
|
+
it 'status', :club_20s, :club_10s do
|
|
211
217
|
out, err, status = Open3.capture3(capcmd('murano', 'status'))
|
|
212
218
|
expect(err).to eq('')
|
|
213
219
|
olines = out.lines
|
|
220
|
+
|
|
214
221
|
expect(olines[0]).to eq("Only on local machine:\n")
|
|
215
222
|
match_syncable_contents_resources(olines[1..4])
|
|
216
223
|
match_syncable_contents(olines[5..12])
|
|
217
|
-
expect(olines[13]).to eq("Nothing new remotely\n")
|
|
224
|
+
#expect(olines[13]).to eq("Nothing new remotely\n")
|
|
225
|
+
expect(olines[13]).to eq("Only on remote server:\n")
|
|
226
|
+
expect(olines[14]).to eq(" - I config_service\n")
|
|
227
|
+
expect(olines[15]).to eq(" - I config_status\n")
|
|
218
228
|
|
|
219
229
|
# NOTE: On Windows, touch doesn't work, so items differ.
|
|
220
230
|
# Check the platform, e.g., 'linux-gnu', or other.
|
|
@@ -222,13 +232,13 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
222
232
|
# RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
|
223
233
|
#)
|
|
224
234
|
if OS.windows?
|
|
225
|
-
expect(olines[
|
|
226
|
-
expect(olines[
|
|
235
|
+
expect(olines[16]).to eq("Items that differ:\n")
|
|
236
|
+
expect(olines[17..18]).to include(
|
|
227
237
|
a_string_matching(%r{ M \w .*services/timer_timer\.lua}),
|
|
228
238
|
a_string_matching(%r{ M \w .*services/tsdb_exportJob\.lua}),
|
|
229
239
|
)
|
|
230
240
|
else
|
|
231
|
-
expect(olines[
|
|
241
|
+
expect(olines[16]).to eq("Nothing that differs\n")
|
|
232
242
|
end
|
|
233
243
|
|
|
234
244
|
expect(status.exitstatus).to eq(0)
|
|
@@ -262,7 +272,7 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
262
272
|
end
|
|
263
273
|
end
|
|
264
274
|
|
|
265
|
-
it 'status' do
|
|
275
|
+
it 'status', :club_20s, :club_10s do
|
|
266
276
|
out, err, status = Open3.capture3(capcmd('murano', 'status'))
|
|
267
277
|
expect(err).to eq('')
|
|
268
278
|
# Not a single match, because the order of items within groups can shift
|
|
@@ -271,8 +281,8 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
271
281
|
match_syncable_contents_resources(olines[1..4])
|
|
272
282
|
match_syncable_contents_except_single_route(olines[5..11])
|
|
273
283
|
expect(olines[12]).to eq("Only on remote server:\n")
|
|
274
|
-
match_remote_boilerplate_v1_0_0_service(olines[13..
|
|
275
|
-
expect(olines[
|
|
284
|
+
match_remote_boilerplate_v1_0_0_service(olines[13..17])
|
|
285
|
+
expect(olines[18]).to eq("Nothing that differs\n")
|
|
276
286
|
expect(status.exitstatus).to eq(0)
|
|
277
287
|
end
|
|
278
288
|
end
|
|
@@ -307,7 +317,7 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
307
317
|
end
|
|
308
318
|
end
|
|
309
319
|
|
|
310
|
-
it 'status' do
|
|
320
|
+
it 'status', :club_20s, :club_10s do
|
|
311
321
|
out, err, status = Open3.capture3(capcmd('murano', 'status'))
|
|
312
322
|
expect(err).to eq('')
|
|
313
323
|
olines = out.lines
|
|
@@ -315,8 +325,8 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
|
315
325
|
match_syncable_contents_resources(olines[1..4])
|
|
316
326
|
match_syncable_contents_except_single_route(olines[5..11])
|
|
317
327
|
expect(olines[12]).to eq("Only on remote server:\n")
|
|
318
|
-
match_remote_boilerplate_v1_0_0_service(olines[13..
|
|
319
|
-
expect(olines[
|
|
328
|
+
match_remote_boilerplate_v1_0_0_service(olines[13..17])
|
|
329
|
+
expect(olines[18]).to eq("Nothing that differs\n")
|
|
320
330
|
expect(status.exitstatus).to eq(0)
|
|
321
331
|
end
|
|
322
332
|
end
|