MuranoCLI 3.2.0.beta.9 → 3.2.1.pre.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/Rakefile +5 -0
- data/dockers/README.rst +7 -0
- data/dockers/RELEASE.rst +6 -3
- data/dockers/docker-test.sh +45 -17
- data/docs/completions/murano_completion-bash +211 -86
- data/lib/MrMurano/Account.rb +72 -4
- data/lib/MrMurano/Business.rb +163 -2
- data/lib/MrMurano/Commander-Entry.rb +1 -2
- data/lib/MrMurano/Config.rb +19 -18
- data/lib/MrMurano/Content.rb +26 -19
- data/lib/MrMurano/Gateway.rb +51 -10
- data/lib/MrMurano/ReCommander.rb +1 -1
- data/lib/MrMurano/Solution-Services.rb +80 -35
- data/lib/MrMurano/Solution-Users.rb +1 -0
- data/lib/MrMurano/SyncRoot.rb +10 -3
- data/lib/MrMurano/SyncUpDown-Core.rb +47 -36
- data/lib/MrMurano/SyncUpDown-Item.rb +46 -14
- data/lib/MrMurano/SyncUpDown.rb +22 -20
- data/lib/MrMurano/Webservice-Endpoint.rb +20 -18
- data/lib/MrMurano/Webservice-File.rb +63 -20
- data/lib/MrMurano/commands/business.rb +14 -1
- data/lib/MrMurano/commands/child.rb +148 -0
- data/lib/MrMurano/commands/devices.rb +298 -149
- data/lib/MrMurano/commands/element.rb +2 -1
- data/lib/MrMurano/commands/globals.rb +3 -0
- data/lib/MrMurano/commands/network.rb +152 -33
- data/lib/MrMurano/commands/sync.rb +2 -2
- data/lib/MrMurano/commands.rb +1 -0
- data/lib/MrMurano/verbosing.rb +13 -2
- data/lib/MrMurano/version.rb +1 -1
- data/spec/Account_spec.rb +43 -11
- data/spec/Content_spec.rb +5 -3
- data/spec/GatewayBase_spec.rb +1 -1
- data/spec/GatewayDevice_spec.rb +47 -8
- data/spec/GatewayResource_spec.rb +1 -1
- data/spec/GatewaySettings_spec.rb +1 -1
- data/spec/HttpAuthed_spec.rb +17 -3
- data/spec/ProjectFile_spec.rb +59 -23
- data/spec/Setting_spec.rb +2 -1
- data/spec/Solution-ServiceConfig_spec.rb +1 -1
- data/spec/Solution-ServiceEventHandler_spec.rb +27 -20
- data/spec/Solution-ServiceModules_spec.rb +7 -5
- data/spec/Solution-UsersRoles_spec.rb +7 -1
- data/spec/Solution_spec.rb +9 -1
- data/spec/SyncRoot_spec.rb +5 -5
- data/spec/SyncUpDown_spec.rb +262 -211
- data/spec/Verbosing_spec.rb +49 -8
- data/spec/Webservice-Cors_spec.rb +10 -1
- data/spec/Webservice-Endpoint_spec.rb +84 -65
- data/spec/Webservice-File_spec.rb +16 -11
- data/spec/Webservice-Setting_spec.rb +7 -1
- data/spec/_workspace.rb +9 -0
- data/spec/cmd_business_spec.rb +5 -10
- data/spec/cmd_common.rb +67 -32
- data/spec/cmd_config_spec.rb +9 -14
- data/spec/cmd_content_spec.rb +15 -26
- data/spec/cmd_cors_spec.rb +9 -12
- data/spec/cmd_device_spec.rb +31 -45
- data/spec/cmd_domain_spec.rb +12 -10
- data/spec/cmd_element_spec.rb +18 -17
- data/spec/cmd_exchange_spec.rb +1 -4
- data/spec/cmd_init_spec.rb +56 -72
- data/spec/cmd_keystore_spec.rb +17 -26
- data/spec/cmd_link_spec.rb +13 -17
- data/spec/cmd_password_spec.rb +9 -10
- data/spec/cmd_setting_application_spec.rb +95 -68
- data/spec/cmd_setting_product_spec.rb +59 -37
- data/spec/cmd_status_spec.rb +46 -84
- data/spec/cmd_syncdown_application_spec.rb +28 -50
- data/spec/cmd_syncdown_both_spec.rb +44 -93
- data/spec/cmd_syncdown_unit_spec.rb +858 -0
- data/spec/cmd_syncup_spec.rb +21 -56
- data/spec/cmd_token_spec.rb +0 -3
- data/spec/cmd_usage_spec.rb +15 -10
- data/spec/dry_run_formatter.rb +1 -0
- data/spec/fixtures/dumped_config +4 -4
- data/spec/spec_helper.rb +3 -0
- metadata +4 -2
@@ -16,68 +16,78 @@ RSpec.describe 'murano product setting', :cmd, :needs_password do
|
|
16
16
|
|
17
17
|
before(:example) do
|
18
18
|
@product_name = rname('settingtest')
|
19
|
-
out, err
|
19
|
+
out, err = murano_command_run(
|
20
|
+
'solution create', '--type', 'product', @product_name, '--save',
|
21
|
+
)
|
20
22
|
expect(err).to eq('')
|
21
23
|
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
22
|
-
expect(status.exitstatus).to eq(0)
|
23
24
|
end
|
25
|
+
|
24
26
|
after(:example) do
|
25
|
-
out, err
|
27
|
+
out, err = murano_command_run('solution delete', @product_name, '-y')
|
26
28
|
expect(out).to eq('')
|
27
29
|
expect(err).to eq('')
|
28
|
-
expect(status.exitstatus).to eq(0)
|
29
30
|
end
|
30
31
|
|
31
32
|
context 'Writes (using Device2.identity_format)' do
|
32
33
|
before(:example) do
|
33
|
-
out, err
|
34
|
+
out, err = murano_command_run(
|
35
|
+
'setting read', 'Device2.identity_format', '-c', 'outformat=json',
|
36
|
+
)
|
34
37
|
expect { @json_before = JSON.parse(out) }.to_not raise_error
|
35
38
|
expect(err).to eq('')
|
36
|
-
expect(status.exitstatus).to eq(0)
|
37
39
|
end
|
38
40
|
# {'prefix'=>'', 'type'=>'opaque', 'options'=>{'casing'=>'mixed', 'length'=>0}}
|
39
41
|
|
40
42
|
it 'a string value', :club_10s do
|
41
|
-
out, err
|
43
|
+
out, err = murano_command_run(
|
44
|
+
'setting write', 'Device2.identity_format', 'prefix', 'fidget',
|
45
|
+
)
|
42
46
|
expect(err).to eq('')
|
43
47
|
expect(out).to eq('')
|
44
|
-
expect(status.exitstatus).to eq(0)
|
45
48
|
|
46
|
-
out, err
|
49
|
+
out, err = murano_command_run(
|
50
|
+
'setting read', 'Device2.identity_format', '-c', 'outformat=json',
|
51
|
+
)
|
47
52
|
json_after = nil
|
48
53
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
49
54
|
expect(err).to eq('')
|
50
|
-
expect(status.exitstatus).to eq(0)
|
51
55
|
@json_before['prefix'] = 'fidget'
|
52
56
|
expect(json_after).to match(@json_before)
|
53
57
|
end
|
54
58
|
|
55
59
|
it 'a forced string value', :club_10s do
|
56
|
-
out, err
|
60
|
+
out, err = murano_command_run(
|
61
|
+
'setting write', 'Device2.identity_format', 'prefix', '--string', 'fidget',
|
62
|
+
)
|
57
63
|
expect(err).to eq('')
|
58
64
|
expect(out).to eq('')
|
59
|
-
expect(status.exitstatus).to eq(0)
|
60
65
|
|
61
|
-
out, err
|
66
|
+
out, err = murano_command_run(
|
67
|
+
'setting read', 'Device2.identity_format', '-c', 'outformat=json',
|
68
|
+
)
|
62
69
|
json_after = nil
|
63
70
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
64
71
|
expect(err).to eq('')
|
65
|
-
expect(status.exitstatus).to eq(0)
|
66
72
|
@json_before['prefix'] = 'fidget'
|
67
73
|
expect(json_after).to match(@json_before)
|
68
74
|
end
|
69
75
|
|
70
76
|
it 'a forced string value on STDIN', :club_10s do
|
71
|
-
|
77
|
+
# FIXME: (lb): Replace capcmd with murano_command_run (need to handle stdin_data).
|
78
|
+
out, err, status = Open3.capture3(capcmd(
|
79
|
+
'murano', 'setting', 'write', 'Device2.identity_format', 'prefix', '--string',
|
80
|
+
), stdin_data: 'fidget')
|
72
81
|
expect(err).to eq('')
|
73
82
|
expect(out).to eq('')
|
74
83
|
expect(status.exitstatus).to eq(0)
|
75
84
|
|
76
|
-
out, err
|
85
|
+
out, err = murano_command_run(
|
86
|
+
'setting read', 'Device2.identity_format', '-c', 'outformat=json',
|
87
|
+
)
|
77
88
|
json_after = nil
|
78
89
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
79
90
|
expect(err).to eq('')
|
80
|
-
expect(status.exitstatus).to eq(0)
|
81
91
|
@json_before['prefix'] = 'fidget'
|
82
92
|
expect(json_after).to match(@json_before)
|
83
93
|
end
|
@@ -100,53 +110,62 @@ RSpec.describe 'murano product setting', :cmd, :needs_password do
|
|
100
110
|
|
101
111
|
context 'a number value' do
|
102
112
|
it 'integer 12', :club_10s do
|
103
|
-
out, err
|
113
|
+
out, err = murano_command_run(
|
114
|
+
'setting write', 'Device2.identity_format', 'options.length', '--num', '12',
|
115
|
+
)
|
104
116
|
expect(err).to eq('')
|
105
117
|
expect(out).to eq('')
|
106
|
-
expect(status.exitstatus).to eq(0)
|
107
118
|
|
108
|
-
out, err
|
119
|
+
out, err = murano_command_run(
|
120
|
+
'setting read', 'Device2.identity_format', '-c', 'outformat=json',
|
121
|
+
)
|
109
122
|
json_after = nil
|
110
123
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
111
124
|
expect(err).to eq('')
|
112
|
-
expect(status.exitstatus).to eq(0)
|
113
125
|
@json_before.set('options.length', 12)
|
114
126
|
expect(json_after).to match(@json_before)
|
115
127
|
end
|
116
128
|
|
117
129
|
it 'float 12.67', :club_10s do
|
118
|
-
out, err
|
130
|
+
out, err = murano_command_run(
|
131
|
+
'setting write', 'Device2.identity_format', 'options.length', '--num', '12.67',
|
132
|
+
)
|
119
133
|
expect(err).to eq('')
|
120
134
|
expect(out).to eq('')
|
121
|
-
expect(status.exitstatus).to eq(0)
|
122
135
|
|
123
|
-
out, err
|
136
|
+
out, err = murano_command_run(
|
137
|
+
'setting read', 'Device2.identity_format', '-c', 'outformat=json',
|
138
|
+
)
|
124
139
|
json_after = nil
|
125
140
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
126
141
|
expect(err).to eq('')
|
127
|
-
expect(status.exitstatus).to eq(0)
|
128
142
|
@json_before.set('options.length', 12.67)
|
129
143
|
expect(json_after).to match(@json_before)
|
130
144
|
end
|
131
145
|
|
132
146
|
it 'fiftyHalf' do
|
133
|
-
out, err
|
134
|
-
|
147
|
+
out, err = murano_command_exits(
|
148
|
+
'setting write', 'Device2.identity_format', 'options.length', '--num', 'fiftyHalf',
|
149
|
+
)
|
150
|
+
expect(err).to eq("Value \"fiftyHalf\" is not a number\n")
|
135
151
|
expect(out).to eq('')
|
136
|
-
expect(status.exitstatus).to eq(2)
|
137
152
|
end
|
138
153
|
|
139
154
|
it 'on STDIN' do
|
140
|
-
|
155
|
+
# FIXME: (lb): Replace capcmd with murano_command_run (need to handle stdin_data).
|
156
|
+
out, err, status = Open3.capture3(capcmd(
|
157
|
+
'murano', 'setting', 'write', 'Device2.identity_format', 'options.length', '--num'
|
158
|
+
), stdin_data: '12')
|
141
159
|
expect(err).to eq('')
|
142
160
|
expect(out).to eq('')
|
143
161
|
expect(status.exitstatus).to eq(0)
|
144
162
|
|
145
|
-
out, err
|
163
|
+
out, err = murano_command_run(
|
164
|
+
'setting read', 'Device2.identity_format', '-c', 'outformat=json',
|
165
|
+
)
|
146
166
|
json_after = nil
|
147
167
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
148
168
|
expect(err).to eq('')
|
149
|
-
expect(status.exitstatus).to eq(0)
|
150
169
|
@json_before.set('options.length', 12)
|
151
170
|
expect(json_after).to match(@json_before)
|
152
171
|
end
|
@@ -192,16 +211,18 @@ RSpec.describe 'murano product setting', :cmd, :needs_password do
|
|
192
211
|
# end
|
193
212
|
|
194
213
|
it 'merges into a dictionary', :club_10s do
|
195
|
-
out, err
|
214
|
+
out, err = murano_command_run(
|
215
|
+
'setting write', 'Device2.identity_format', '.', '--dict', '--merge', 'prefix', 'tix', 'type', 'base10',
|
216
|
+
)
|
196
217
|
expect(err).to eq('')
|
197
218
|
expect(out).to eq('')
|
198
|
-
expect(status.exitstatus).to eq(0)
|
199
219
|
|
200
|
-
out, err
|
220
|
+
out, err = murano_command_run(
|
221
|
+
'setting read', 'Device2.identity_format', '-c', 'outformat=json',
|
222
|
+
)
|
201
223
|
json_after = nil
|
202
224
|
expect { json_after = JSON.parse(out) }.to_not raise_error
|
203
225
|
expect(err).to eq('')
|
204
|
-
expect(status.exitstatus).to eq(0)
|
205
226
|
@json_before['prefix'] = 'tix'
|
206
227
|
@json_before['type'] = 'base10'
|
207
228
|
expect(json_after).to match(@json_before)
|
@@ -210,10 +231,11 @@ RSpec.describe 'murano product setting', :cmd, :needs_password do
|
|
210
231
|
|
211
232
|
context 'Writes (using Webservice.cors)' do
|
212
233
|
before(:example) do
|
213
|
-
out, err
|
234
|
+
out, err = murano_command_run(
|
235
|
+
'setting read', 'Webservice.cors', '-c', 'outformat=json',
|
236
|
+
)
|
214
237
|
expect { @json_before = JSON.parse(out) }.to_not raise_error
|
215
238
|
expect(err).to eq('')
|
216
|
-
expect(status.exitstatus).to eq(0)
|
217
239
|
end
|
218
240
|
# {'origin'=>true,
|
219
241
|
# 'methods'=>['HEAD', 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'PATCH'],
|
data/spec/cmd_status_spec.rb
CHANGED
@@ -10,31 +10,40 @@ require 'json'
|
|
10
10
|
require 'open3'
|
11
11
|
require 'os'
|
12
12
|
require 'rbconfig'
|
13
|
+
require 'time'
|
13
14
|
|
14
15
|
require 'cmd_common'
|
15
16
|
|
16
17
|
RSpec.describe 'murano status', :cmd, :needs_password do
|
17
18
|
include_context 'CI_CMD'
|
18
19
|
|
20
|
+
before(:all) do
|
21
|
+
@timeit_time0 = Time.now
|
22
|
+
end
|
23
|
+
|
24
|
+
after(:all) do
|
25
|
+
# FIXME/DRY: Report elapsed time.
|
26
|
+
elapsed_secs = Time.now - @timeit_time0
|
27
|
+
puts "CI_CMD: elapsed_secs: #{elapsed_secs}"
|
28
|
+
end
|
29
|
+
|
19
30
|
before(:example) do
|
20
31
|
@product_name = rname('statusTest')
|
21
|
-
out, err
|
22
|
-
|
32
|
+
out, err = murano_command_run(
|
33
|
+
'solution create', '--type', 'product', @product_name, '--save',
|
23
34
|
)
|
24
35
|
expect(err).to eq('')
|
25
36
|
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
26
|
-
expect(status.exitstatus).to eq(0)
|
27
37
|
|
28
38
|
@applctn_name = rname('statusTest')
|
29
|
-
out, err
|
30
|
-
|
39
|
+
out, err = murano_command_run(
|
40
|
+
'solution create', '--type', 'application', @applctn_name, '--save',
|
31
41
|
)
|
32
42
|
expect(err).to eq('')
|
33
43
|
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
34
|
-
expect(status.exitstatus).to eq(0)
|
35
44
|
|
36
|
-
out, err
|
37
|
-
|
45
|
+
out, err = murano_command_run(
|
46
|
+
'syncdown', '--services', '--no-delete', '--no-update',
|
38
47
|
)
|
39
48
|
# NOTE: 2017-12-14: (landonb): The new behavior is that MurCLI will treat
|
40
49
|
# platform scripts that are simply empty strings as not being in conflict
|
@@ -49,32 +58,29 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
49
58
|
end
|
50
59
|
|
51
60
|
expect(err).to eq('')
|
52
|
-
expect(status.exitstatus).to eq(0)
|
53
61
|
end
|
54
62
|
|
55
63
|
after(:example) do
|
56
|
-
out, err
|
57
|
-
|
64
|
+
out, err = murano_command_run(
|
65
|
+
'solution delete', @applctn_name, '-y',
|
58
66
|
)
|
59
67
|
expect(out).to eq('')
|
60
68
|
expect(err).to eq('')
|
61
|
-
expect(status.exitstatus).to eq(0)
|
62
69
|
|
63
|
-
out, err
|
64
|
-
|
70
|
+
out, err = murano_command_run(
|
71
|
+
'solution delete', @product_name, '-y',
|
65
72
|
)
|
66
73
|
expect(out).to eq('')
|
67
74
|
expect(err).to eq('')
|
68
|
-
expect(status.exitstatus).to eq(0)
|
69
75
|
end
|
70
76
|
|
71
77
|
def match_syncable_contents(slice)
|
72
78
|
expect(slice).to include(
|
73
79
|
a_string_matching(%r{ \+ \w .*modules/table_util\.lua}),
|
74
|
-
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua}),
|
75
|
-
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:
|
76
|
-
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:
|
77
|
-
a_string_matching(%r{ \+ \w .*routes/singleRoute\.lua}),
|
80
|
+
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:1-4}),
|
81
|
+
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:5-7}),
|
82
|
+
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:8-11}),
|
83
|
+
a_string_matching(%r{ \+ \w .*routes/singleRoute\.lua:1-5}),
|
78
84
|
a_string_matching(%r{ \+ \w .*files/js/script\.js}),
|
79
85
|
a_string_matching(%r{ \+ \w .*files/icon\.png}),
|
80
86
|
a_string_matching(%r{ \+ \w .*files/index\.html}),
|
@@ -93,9 +99,9 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
93
99
|
def match_syncable_contents_except_single_route(slice)
|
94
100
|
expect(slice).to include(
|
95
101
|
a_string_matching(%r{ \+ \w .*modules/table_util\.lua}),
|
96
|
-
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua}),
|
97
|
-
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:
|
98
|
-
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:
|
102
|
+
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:1-4}),
|
103
|
+
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:5-7}),
|
104
|
+
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:8-11}),
|
99
105
|
a_string_matching(%r{ \+ \w .*files/icon\.png}),
|
100
106
|
a_string_matching(%r{ \+ \w .*files/index\.html}),
|
101
107
|
a_string_matching(%r{ \+ \w .*files/js/script\.js}),
|
@@ -104,11 +110,7 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
104
110
|
|
105
111
|
def match_remote_boilerplate_v1_0_0_service(slice)
|
106
112
|
expect(slice).to include(
|
107
|
-
a_string_matching(/ - \w
|
108
|
-
a_string_matching(/ - \w config_status/),
|
109
|
-
a_string_matching(/ - \w user_account\.lua/),
|
110
|
-
a_string_matching(/ - \w config_service/),
|
111
|
-
a_string_matching(/ - \w config_status/),
|
113
|
+
a_string_matching(/ - \w user_account\.lua \[phantom\]/),
|
112
114
|
)
|
113
115
|
end
|
114
116
|
|
@@ -124,50 +126,20 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
124
126
|
end
|
125
127
|
|
126
128
|
it 'status', :club_20s, :club_10s do
|
127
|
-
out, err
|
129
|
+
out, err = murano_command_run('status')
|
128
130
|
expect(err).to eq('')
|
129
|
-
# Two problems with this output.
|
130
|
-
# 1: Order of files is not set
|
131
|
-
# 2: Path prefixes could be different.
|
132
131
|
olines = out.lines
|
133
132
|
expect(olines[0]).to eq("Only on local machine:\n")
|
134
133
|
match_syncable_contents_resources(olines[1..4])
|
135
134
|
match_syncable_contents(olines[5..12])
|
136
|
-
|
137
|
-
expect(olines[
|
138
|
-
expect(olines[14]).to eq(" - I config_service\n")
|
139
|
-
expect(olines[15]).to eq(" - I config_status\n")
|
140
|
-
# FIMXE/2017-06-23: We should DRY this long list which is same in each test.
|
141
|
-
# FIXME/2017-06-23: The interfaces the server creates for a new project
|
142
|
-
# will problem vary depending on what modules are loaded, and are likely
|
143
|
-
# to change over time...
|
144
|
-
#match_remote_boilerplate_v1_0_0_service(olines[14..35])
|
145
|
-
|
146
|
-
# NOTE: On Windows, touch doesn't work, so items differ.
|
147
|
-
# Check the platform, e.g., 'linux-gnu', or other.
|
148
|
-
# 2017-07-14 08:51: Is there a race condition here? [lb] saw
|
149
|
-
# differences earlier, but then not after adding this...
|
150
|
-
#is_windows = (
|
151
|
-
# RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
152
|
-
#)
|
153
|
-
#if OS.windows?
|
154
|
-
# expect(olines[14]).to eq("Items that differ:\n")
|
155
|
-
# expect(olines[15..16]).to contain_exactly(
|
156
|
-
# a_string_matching(%r{ M \w .*services/timer_timer\.lua}),
|
157
|
-
# a_string_matching(%r{ M \w .*services/tsdb_exportJob\.lua}),
|
158
|
-
# )
|
159
|
-
#else
|
160
|
-
expect(olines[16]).to eq("Nothing that differs\n")
|
161
|
-
#end
|
162
|
-
|
163
|
-
expect(status.exitstatus).to eq(0)
|
135
|
+
expect(olines[13]).to eq("Nothing new remotely\n")
|
136
|
+
expect(olines[14]).to eq("Nothing that differs\n")
|
164
137
|
end
|
165
138
|
|
166
139
|
it 'matches file path', :broken_on_windows, :club_20s, :club_10s do
|
167
140
|
# capcmd calls shellwords, which escapes strings so that Open3 doesn't
|
168
141
|
# expand them. E.g., **/ would expand to the local directory name.
|
169
|
-
|
170
|
-
out, err, status = Open3.capture3(status_cmd)
|
142
|
+
out, err = murano_command_run('status', '**/icon.png')
|
171
143
|
expect(err).to eq('')
|
172
144
|
expect(out.lines).to match(
|
173
145
|
[
|
@@ -177,21 +149,19 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
177
149
|
"Nothing that differs\n",
|
178
150
|
]
|
179
151
|
)
|
180
|
-
expect(status.exitstatus).to eq(0)
|
181
152
|
end
|
182
153
|
|
183
154
|
it 'matches route', :broken_on_windows, :club_20s, :club_10s do
|
184
|
-
out, err
|
155
|
+
out, err = murano_command_run('status', '#put#')
|
185
156
|
expect(err).to eq('')
|
186
157
|
expect(out.lines).to match(
|
187
158
|
[
|
188
159
|
"Only on local machine:\n",
|
189
|
-
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:
|
160
|
+
a_string_matching(%r{ \+ \w .*routes/manyRoutes\.lua:5-7}),
|
190
161
|
"Nothing new remotely\n",
|
191
162
|
"Nothing that differs\n",
|
192
163
|
]
|
193
164
|
)
|
194
|
-
expect(status.exitstatus).to eq(0)
|
195
165
|
end
|
196
166
|
end
|
197
167
|
|
@@ -214,17 +184,14 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
214
184
|
end
|
215
185
|
|
216
186
|
it 'status', :club_20s, :club_10s do
|
217
|
-
out, err
|
187
|
+
out, err = murano_command_run('status')
|
218
188
|
expect(err).to eq('')
|
219
189
|
olines = out.lines
|
220
190
|
|
221
191
|
expect(olines[0]).to eq("Only on local machine:\n")
|
222
192
|
match_syncable_contents_resources(olines[1..4])
|
223
193
|
match_syncable_contents(olines[5..12])
|
224
|
-
|
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")
|
194
|
+
expect(olines[13]).to eq("Nothing new remotely\n")
|
228
195
|
|
229
196
|
# NOTE: On Windows, touch doesn't work, so items differ.
|
230
197
|
# Check the platform, e.g., 'linux-gnu', or other.
|
@@ -232,20 +199,17 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
232
199
|
# RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
233
200
|
#)
|
234
201
|
if OS.windows?
|
235
|
-
expect(olines[
|
236
|
-
expect(olines[
|
202
|
+
expect(olines[14]).to eq("Items that differ:\n")
|
203
|
+
expect(olines[15..16]).to include(
|
237
204
|
a_string_matching(%r{ M \w .*services/timer_timer\.lua}),
|
238
205
|
a_string_matching(%r{ M \w .*services/tsdb_exportJob\.lua}),
|
239
206
|
)
|
240
207
|
else
|
241
|
-
expect(olines[
|
208
|
+
expect(olines[14]).to eq("Nothing that differs\n")
|
242
209
|
end
|
243
|
-
|
244
|
-
expect(status.exitstatus).to eq(0)
|
245
210
|
end
|
246
211
|
end
|
247
212
|
|
248
|
-
# XXX wait, should a Solutionfile even work with Okami?
|
249
213
|
context 'with Solutionfile 0.2.0' do
|
250
214
|
before(:example) do
|
251
215
|
FileUtils.cp_r(File.join(@testdir, 'spec/fixtures/syncable_content/.'), '.')
|
@@ -273,7 +237,7 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
273
237
|
end
|
274
238
|
|
275
239
|
it 'status', :club_20s, :club_10s do
|
276
|
-
out, err
|
240
|
+
out, err = murano_command_run('status')
|
277
241
|
expect(err).to eq('')
|
278
242
|
# Not a single match, because the order of items within groups can shift
|
279
243
|
olines = out.lines
|
@@ -281,9 +245,8 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
281
245
|
match_syncable_contents_resources(olines[1..4])
|
282
246
|
match_syncable_contents_except_single_route(olines[5..11])
|
283
247
|
expect(olines[12]).to eq("Only on remote server:\n")
|
284
|
-
match_remote_boilerplate_v1_0_0_service(olines[13..
|
285
|
-
expect(olines[
|
286
|
-
expect(status.exitstatus).to eq(0)
|
248
|
+
match_remote_boilerplate_v1_0_0_service(olines[13..13])
|
249
|
+
expect(olines[14]).to eq("Nothing that differs\n")
|
287
250
|
end
|
288
251
|
end
|
289
252
|
|
@@ -318,16 +281,15 @@ RSpec.describe 'murano status', :cmd, :needs_password do
|
|
318
281
|
end
|
319
282
|
|
320
283
|
it 'status', :club_20s, :club_10s do
|
321
|
-
out, err
|
284
|
+
out, err = murano_command_run('status')
|
322
285
|
expect(err).to eq('')
|
323
286
|
olines = out.lines
|
324
287
|
expect(olines[0]).to eq("Only on local machine:\n")
|
325
288
|
match_syncable_contents_resources(olines[1..4])
|
326
289
|
match_syncable_contents_except_single_route(olines[5..11])
|
327
290
|
expect(olines[12]).to eq("Only on remote server:\n")
|
328
|
-
match_remote_boilerplate_v1_0_0_service(olines[13..
|
329
|
-
expect(olines[
|
330
|
-
expect(status.exitstatus).to eq(0)
|
291
|
+
match_remote_boilerplate_v1_0_0_service(olines[13..13])
|
292
|
+
expect(olines[14]).to eq("Nothing that differs\n")
|
331
293
|
end
|
332
294
|
end
|
333
295
|
end
|