MuranoCLI 3.2.1.pre.beta.6 → 3.2.1.pre.beta.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +10 -0
- data/MuranoCLI.gemspec +37 -6
- data/Rakefile +38 -11
- data/lib/MrMurano/commands/business.rb +0 -4
- data/lib/MrMurano/version.rb +1 -1
- metadata +2 -251
- data/dockers/Dockerfile.2.2.9 +0 -40
- data/dockers/Dockerfile.2.3.6 +0 -40
- data/dockers/Dockerfile.2.4.3 +0 -40
- data/dockers/Dockerfile.2.5.0 +0 -40
- data/dockers/Dockerfile.GemRelease +0 -49
- data/dockers/Dockerfile.m4 +0 -122
- data/dockers/README.rst +0 -362
- data/dockers/RELEASE.rst +0 -135
- data/dockers/docker-test.sh +0 -163
- data/dockers/gem-release.sh +0 -4
- data/docs/basic_example.rst +0 -436
- data/docs/ci/.trustme.plugin +0 -140
- data/docs/ci/.trustme.sh +0 -516
- data/docs/ci/.trustme.vim +0 -55
- data/docs/completions/murano_completion-bash +0 -4484
- data/docs/demo.md +0 -109
- data/docs/develop.rst +0 -392
- data/docs/release.rst +0 -295
- data/spec/Account-Passwords_spec.rb +0 -245
- data/spec/Account_spec.rb +0 -256
- data/spec/Business_spec.rb +0 -307
- data/spec/ConfigFile_spec.rb +0 -55
- data/spec/ConfigMigrate_spec.rb +0 -108
- data/spec/Config_spec.rb +0 -440
- data/spec/Content_spec.rb +0 -422
- data/spec/GatewayBase_spec.rb +0 -65
- data/spec/GatewayDevice_spec.rb +0 -403
- data/spec/GatewayResource_spec.rb +0 -283
- data/spec/GatewaySettings_spec.rb +0 -130
- data/spec/HttpAuthed_spec.rb +0 -87
- data/spec/Http_spec.rb +0 -220
- data/spec/MakePretties_spec.rb +0 -127
- data/spec/Mock_spec.rb +0 -62
- data/spec/ProjectFile_spec.rb +0 -381
- data/spec/Setting_spec.rb +0 -120
- data/spec/Solution-ServiceConfig_spec.rb +0 -272
- data/spec/Solution-ServiceEventHandler_spec.rb +0 -442
- data/spec/Solution-ServiceModules_spec.rb +0 -562
- data/spec/Solution-UsersRoles_spec.rb +0 -269
- data/spec/Solution_spec.rb +0 -140
- data/spec/SyncRoot_spec.rb +0 -111
- data/spec/SyncUpDown_spec.rb +0 -868
- data/spec/Verbosing_spec.rb +0 -332
- data/spec/Webservice-Cors_spec.rb +0 -225
- data/spec/Webservice-Endpoint_spec.rb +0 -650
- data/spec/Webservice-File_spec.rb +0 -282
- data/spec/Webservice-Setting_spec.rb +0 -105
- data/spec/_workspace.rb +0 -43
- data/spec/cmd_business_spec.rb +0 -64
- data/spec/cmd_common.rb +0 -507
- data/spec/cmd_config_spec.rb +0 -73
- data/spec/cmd_content_spec.rb +0 -109
- data/spec/cmd_cors_spec.rb +0 -54
- data/spec/cmd_device_spec.rb +0 -130
- data/spec/cmd_domain_spec.rb +0 -62
- data/spec/cmd_element_spec.rb +0 -401
- data/spec/cmd_exchange_spec.rb +0 -114
- data/spec/cmd_help_spec.rb +0 -72
- data/spec/cmd_init_spec.rb +0 -475
- data/spec/cmd_keystore_spec.rb +0 -97
- data/spec/cmd_link_spec.rb +0 -105
- data/spec/cmd_logs_spec.rb +0 -162
- data/spec/cmd_password_spec.rb +0 -64
- data/spec/cmd_setting_application_spec.rb +0 -300
- data/spec/cmd_setting_product_spec.rb +0 -246
- data/spec/cmd_status_spec.rb +0 -300
- data/spec/cmd_syncdown_application_spec.rb +0 -128
- data/spec/cmd_syncdown_both_spec.rb +0 -178
- data/spec/cmd_syncdown_unit_spec.rb +0 -861
- data/spec/cmd_syncup_spec.rb +0 -148
- data/spec/cmd_token_spec.rb +0 -53
- data/spec/cmd_usage_spec.rb +0 -79
- data/spec/dry_run_formatter.rb +0 -28
- data/spec/fixtures/.mrmuranorc +0 -9
- data/spec/fixtures/ProjectFiles/invalid.yaml +0 -9
- data/spec/fixtures/ProjectFiles/only_meta.yaml +0 -24
- data/spec/fixtures/ProjectFiles/with_routes.yaml +0 -27
- data/spec/fixtures/SolutionFiles/0.2.0.json +0 -20
- data/spec/fixtures/SolutionFiles/0.2.0_invalid.json +0 -18
- data/spec/fixtures/SolutionFiles/0.2.json +0 -21
- data/spec/fixtures/SolutionFiles/0.3.0.json +0 -20
- data/spec/fixtures/SolutionFiles/0.3.0_invalid.json +0 -19
- data/spec/fixtures/SolutionFiles/0.3.json +0 -20
- data/spec/fixtures/SolutionFiles/basic.json +0 -20
- data/spec/fixtures/SolutionFiles/secret.json +0 -6
- data/spec/fixtures/configfile +0 -9
- data/spec/fixtures/dumped_config +0 -57
- data/spec/fixtures/exchange_element/element-show.json +0 -1
- data/spec/fixtures/exchange_element/swagger-mur-6407__10k.yaml +0 -282
- data/spec/fixtures/exchange_element/swagger-mur-6407__20k.yaml +0 -588
- data/spec/fixtures/gateway_resource_files/resources.notyaml +0 -12
- data/spec/fixtures/gateway_resource_files/resources.yaml +0 -13
- data/spec/fixtures/gateway_resource_files/resources_invalid.yaml +0 -13
- data/spec/fixtures/mrmuranorc_deleted_bob +0 -6
- data/spec/fixtures/mrmuranorc_tool_bob +0 -3
- data/spec/fixtures/product_spec_files/example.exoline.spec.yaml +0 -116
- data/spec/fixtures/product_spec_files/example.murano.spec.yaml +0 -14
- data/spec/fixtures/product_spec_files/gwe.exoline.spec.yaml +0 -21
- data/spec/fixtures/product_spec_files/gwe.murano.spec.yaml +0 -16
- data/spec/fixtures/product_spec_files/lightbulb-no-state.yaml +0 -11
- data/spec/fixtures/product_spec_files/lightbulb.yaml +0 -21
- data/spec/fixtures/roles-three.yaml +0 -11
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value 0.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value 1.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value No.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value Yes.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value bob.webmock +0 -72
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value false.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value off.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value on STDIN.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value on.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value true.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a json array blob with STDIN.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a json array blob.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) an array.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) appends an array.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting reads Webservice.cors to a file.webmock +0 -72
- data/spec/fixtures/snapshots/murano application setting reads Webservice.cors.webmock +0 -72
- data/spec/fixtures/snapshots/murano business list as json.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list as table.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list fewer fields.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list only ids.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list output to file.webmock +0 -27
- data/spec/fixtures/snapshots/murano business without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Needs a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Reads a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Removes a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Sets a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Sets a user key.webmock +0 -9
- data/spec/fixtures/snapshots/murano content life cycle.webmock +0 -144
- data/spec/fixtures/snapshots/murano cors sets CORS.webmock +0 -78
- data/spec/fixtures/snapshots/murano cors show CORS.webmock +0 -64
- data/spec/fixtures/snapshots/murano device activates.webmock +0 -86
- data/spec/fixtures/snapshots/murano device enables a batch.webmock +0 -76
- data/spec/fixtures/snapshots/murano device enables and lists.webmock +0 -78
- data/spec/fixtures/snapshots/murano device writes and reads.webmock +0 -136
- data/spec/fixtures/snapshots/murano domain show domain.webmock +0 -101
- data/spec/fixtures/snapshots/murano element edit unknown as unknown element.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show --help.webmock +0 -9
- data/spec/fixtures/snapshots/murano element show as csv.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as default-table.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as json.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as table truncate.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as table wrap.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as yaml.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show using ambiguous name.webmock +0 -43
- data/spec/fixtures/snapshots/murano element without project usage.webmock +0 -9
- data/spec/fixtures/snapshots/murano exchange with project list as json.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list as table.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list fewer fields.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list only ids.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list output to file.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list purchase is already added ID.webmock +0 -83
- data/spec/fixtures/snapshots/murano exchange with project list purchase is ambiguous name.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using commander as --help.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using commander no args.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using subshell no args.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using subshell with --help.webmock +0 -9
- data/spec/fixtures/snapshots/murano init Won't init in HOME (gracefully).webmock +0 -9
- data/spec/fixtures/snapshots/murano init in empty directory with existing project.webmock +0 -201
- data/spec/fixtures/snapshots/murano init in empty directory without existing project.webmock +0 -193
- data/spec/fixtures/snapshots/murano init in existing project directory with ProjectFile.webmock +0 -213
- data/spec/fixtures/snapshots/murano init in existing project directory with SolutionFile 0.2.0.webmock +0 -213
- data/spec/fixtures/snapshots/murano init in existing project directory with SolutionFile 0.3.0.webmock +0 -213
- data/spec/fixtures/snapshots/murano init in existing project directory without ProjectFile.webmock +0 -213
- data/spec/fixtures/snapshots/murano keystore can call other commands.webmock +0 -108
- data/spec/fixtures/snapshots/murano keystore clearAll.webmock +0 -124
- data/spec/fixtures/snapshots/murano keystore deletes.webmock +0 -112
- data/spec/fixtures/snapshots/murano keystore gets.webmock +0 -96
- data/spec/fixtures/snapshots/murano keystore infos.webmock +0 -96
- data/spec/fixtures/snapshots/murano keystore lists.webmock +0 -96
- data/spec/fixtures/snapshots/murano link with project links and lists.webmock +0 -149
- data/spec/fixtures/snapshots/murano link with project unlinks.webmock +0 -165
- data/spec/fixtures/snapshots/murano link without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano link without project subshell vs inline using commander will not list.webmock +0 -27
- data/spec/fixtures/snapshots/murano link without project subshell vs inline using subshell will not list.webmock +0 -27
- data/spec/fixtures/snapshots/murano logs when project is setup tail log.webmock +0 -9
- data/spec/fixtures/snapshots/murano password Lists when no file.webmock +0 -9
- data/spec/fixtures/snapshots/murano password deletes a password.webmock +0 -9
- data/spec/fixtures/snapshots/murano password sets a password.webmock +0 -9
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a forced string value on STDIN.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a forced string value.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value fiftyHalf.webmock +0 -64
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value float 12.67.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value integer 12.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value on STDIN.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a string value.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) merges into a dictionary.webmock +0 -90
- data/spec/fixtures/snapshots/murano single sync without ProjectFile syncdown.webmock +0 -322
- data/spec/fixtures/snapshots/murano status with ProjectFile status.webmock +0 -153
- data/spec/fixtures/snapshots/murano status with Solutionfile 0.2.0 status.webmock +0 -153
- data/spec/fixtures/snapshots/murano status with Solutionfile 0.3.0 status.webmock +0 -153
- data/spec/fixtures/snapshots/murano status without ProjectFile matches file path.webmock +0 -153
- data/spec/fixtures/snapshots/murano status without ProjectFile matches route.webmock +0 -153
- data/spec/fixtures/snapshots/murano status without ProjectFile status.webmock +0 -153
- data/spec/fixtures/snapshots/murano syncdown stubbed without ProjectFile syncdown.webmock +0 -151
- data/spec/fixtures/snapshots/murano syncdown without ProjectFile syncdown.webmock +0 -479
- data/spec/fixtures/snapshots/murano syncup without ProjectFile syncup.webmock +0 -357
- data/spec/fixtures/snapshots/murano token with project list as table.webmock +0 -9
- data/spec/fixtures/snapshots/murano token without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano usage show usage.webmock +0 -93
- data/spec/fixtures/syncable_conflict/services/devdata.lua +0 -18
- data/spec/fixtures/syncable_conflict/services/timers.lua +0 -4
- data/spec/fixtures/syncable_content/assets/icon.png +0 -0
- data/spec/fixtures/syncable_content/assets/index.html +0 -0
- data/spec/fixtures/syncable_content/assets/js/script.js +0 -0
- data/spec/fixtures/syncable_content/modules/table_util.lua +0 -58
- data/spec/fixtures/syncable_content/routes/manyRoutes.lua +0 -11
- data/spec/fixtures/syncable_content/routes/singleRoute.lua +0 -5
- data/spec/fixtures/websocket/README.rst +0 -110
- data/spec/fixtures/websocket/logs_blather.rb +0 -27
- data/spec/fixtures/websocket/logs_faker.rb +0 -153
- data/spec/fixtures/websocket/simple_connection.rb +0 -45
- data/spec/fixtures/websocket/simple_options.rb +0 -77
- data/spec/fixtures/websocket/simple_server.rb +0 -69
- data/spec/fixtures/websocket/wss-echo.rb +0 -48
- data/spec/fixtures/websocket/wss-fake-logs.rb +0 -20
- data/spec/spec_helper.rb +0 -131
- data/spec/variegated_TruthyFalsey_spec.rb +0 -29
- data/spec/webmock_snapshot.rb +0 -296
data/spec/cmd_syncup_spec.rb
DELETED
@@ -1,148 +0,0 @@
|
|
1
|
-
# Copyright © 2016-2017 Exosite LLC. All Rights Reserved
|
2
|
-
# License: PROPRIETARY. See LICENSE.txt.
|
3
|
-
# frozen_string_literal: true
|
4
|
-
|
5
|
-
# vim:tw=0:ts=2:sw=2:et:ai
|
6
|
-
# Unauthorized copying of this file is strictly prohibited.
|
7
|
-
|
8
|
-
require 'fileutils'
|
9
|
-
require 'open3'
|
10
|
-
require 'cmd_common'
|
11
|
-
|
12
|
-
RSpec.describe 'murano syncup', :cmd, :needs_password do
|
13
|
-
include_context 'CI_CMD'
|
14
|
-
|
15
|
-
before(:example) do
|
16
|
-
murano_solutions_expunge_yes
|
17
|
-
|
18
|
-
@product_name = @snapshotter.resolve_var(
|
19
|
-
'product.name', rname('syncupTestPrd')
|
20
|
-
)
|
21
|
-
out, err = murano_command_run(
|
22
|
-
'solution create', '--type', 'product', @product_name, '--save',
|
23
|
-
)
|
24
|
-
expect(err).to eq('')
|
25
|
-
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
26
|
-
|
27
|
-
@applctn_name = @snapshotter.resolve_var(
|
28
|
-
'application.name', rname('syncupTestApp')
|
29
|
-
)
|
30
|
-
out, err = murano_command_run(
|
31
|
-
'solution create', '--type', 'application', @applctn_name, '--save',
|
32
|
-
)
|
33
|
-
expect(err).to eq('')
|
34
|
-
soln_id = out
|
35
|
-
expect(soln_id.chomp).to match(/^[a-zA-Z0-9]+$/)
|
36
|
-
|
37
|
-
out, err = murano_command_run('assign set')
|
38
|
-
#expect(out).to a_string_starting_with("Linked product #{@product_name}")
|
39
|
-
olines = out.lines
|
40
|
-
expect(strip_fancy(olines[0]))
|
41
|
-
.to eq("Linked '#{@product_name}' to '#{@applctn_name}'\n")
|
42
|
-
expect(olines[1]).to eq("Created default event handler\n")
|
43
|
-
expect(err).to eq('')
|
44
|
-
end
|
45
|
-
|
46
|
-
after(:example) do
|
47
|
-
out, err, _status = murano_command_run(
|
48
|
-
'solution delete', @applctn_name, '-y',
|
49
|
-
)
|
50
|
-
expect(out).to eq('')
|
51
|
-
expect(err).to eq('')
|
52
|
-
|
53
|
-
out, err, _status = murano_command_run(
|
54
|
-
'solution delete', @product_name, '-y',
|
55
|
-
)
|
56
|
-
expect(out).to eq('')
|
57
|
-
expect(err).to eq('')
|
58
|
-
end
|
59
|
-
|
60
|
-
context 'without ProjectFile' do
|
61
|
-
before(:example) do
|
62
|
-
FileUtils.cp_r(File.join(@testdir, 'spec/fixtures/syncable_content/.'), '.')
|
63
|
-
FileUtils.move('assets', 'files')
|
64
|
-
FileUtils.mkpath('specs')
|
65
|
-
FileUtils.copy(
|
66
|
-
File.join(@testdir, 'spec/fixtures/product_spec_files/lightbulb.yaml'),
|
67
|
-
'specs/resources.yaml',
|
68
|
-
)
|
69
|
-
end
|
70
|
-
|
71
|
-
def verify_err_missing_location(err)
|
72
|
-
elines = err.lines
|
73
|
-
# E.g.,
|
74
|
-
# Skipping missing location
|
75
|
-
# ‘/tmp/d20170809-7670-z315jn/project/services’ (Services)
|
76
|
-
# Skipping missing location
|
77
|
-
# ‘/tmp/d20170809-7670-z315jn/project/services’ (Interfaces)
|
78
|
-
expect(elines).to(satisfy { |_v| elines.length == 2 })
|
79
|
-
elines.each do |line|
|
80
|
-
expect(strip_fancy(line)).to start_with("Skipping missing location '")
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
it 'syncup', :club_40s, :club_30s, :club_20s, :club_10s do
|
85
|
-
out, err = murano_command_run('syncup')
|
86
|
-
outl = out.lines
|
87
|
-
# The spec tests set --no-progress, so each sync action gets reported.
|
88
|
-
# You'll see:
|
89
|
-
# => "Adding item state\n",
|
90
|
-
# => "Adding item temperature\n",
|
91
|
-
# => "Adding item uptime\n",
|
92
|
-
# => "Adding item humidity\n",
|
93
|
-
(0..3).each { |ln| expect(outl[ln]).to start_with('Adding item ') }
|
94
|
-
# => "Updating remote product resources\n",
|
95
|
-
expect(outl[4]).to eq("Updating remote product resources\n")
|
96
|
-
# => "Adding item table_util\n",
|
97
|
-
# Windows is insane:
|
98
|
-
# "Adding item ........................Administrator.AppData.Local.Temp.2.d20170913-3860-pgji6g.project.modules.table_util\n"
|
99
|
-
# So we can't do this:
|
100
|
-
# expect(outl[5]).to eq("Adding item table_util\n")
|
101
|
-
expect(outl[5]).to start_with('Adding item ')
|
102
|
-
expect(outl[5]).to end_with("table_util\n")
|
103
|
-
expect(outl[6]).to eq("Clearing item user_account\n")
|
104
|
-
# => "Clearing item k58sn37r6qz800000_event\n",
|
105
|
-
expect(outl[7]).to start_with('Clearing item ')
|
106
|
-
# => "Adding item POST_/api/fire\n",
|
107
|
-
# => "Adding item PUT_/api/fire/{code}\n",
|
108
|
-
# => "Adding item DELETE_/api/fire/{code}\n",
|
109
|
-
# => "Adding item GET_/api/onfire\n",
|
110
|
-
# => "Adding item /icon.png\n",
|
111
|
-
# => "Adding item /\n",
|
112
|
-
# => "Adding item /js/script.js\n",
|
113
|
-
(8..14).each { |ln| expect(outl[ln]).to start_with('Adding item ') }
|
114
|
-
verify_err_missing_location(err)
|
115
|
-
|
116
|
-
out, err = murano_command_run('status')
|
117
|
-
# MUR-6477/MUR-6479: Uploading empty files broken. There's a fix in
|
118
|
-
# the pipeline, but until then, disable the original expect.
|
119
|
-
# FIXME: Why is files/icon.png showing up as different?
|
120
|
-
# MAYBE: Should we add config_service and config_status to local fixture?
|
121
|
-
# Or should we just let them show up in the diff?
|
122
|
-
mur_6479_fixed = false
|
123
|
-
if mur_6479_fixed
|
124
|
-
expect(out).to start_with(
|
125
|
-
%(Nothing new locally\nNothing new remotely\nNothing that differs\n)
|
126
|
-
)
|
127
|
-
else
|
128
|
-
expect(out.lines).to match(
|
129
|
-
[
|
130
|
-
"Nothing new locally\n",
|
131
|
-
"Nothing new remotely\n",
|
132
|
-
"Nothing that differs\n",
|
133
|
-
]
|
134
|
-
)
|
135
|
-
end
|
136
|
-
verify_err_missing_location(err)
|
137
|
-
|
138
|
-
out, err = murano_command_run('status', '--diff', '--no-grouped')
|
139
|
-
expect(out).to eq('')
|
140
|
-
verify_err_missing_location(err)
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
# TODO: With ProjectFile
|
145
|
-
# TODO: With Solutionfile 0.2.0
|
146
|
-
# TODO: With Solutionfile 0.3.0
|
147
|
-
end
|
148
|
-
|
data/spec/cmd_token_spec.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
# Copyright © 2016-2017 Exosite LLC. All Rights Reserved
|
2
|
-
# License: PROPRIETARY. See LICENSE.txt.
|
3
|
-
# frozen_string_literal: true
|
4
|
-
|
5
|
-
# vim:tw=0:ts=2:sw=2:et:ai
|
6
|
-
# Unauthorized copying of this file is strictly prohibited.
|
7
|
-
|
8
|
-
require 'fileutils'
|
9
|
-
require 'open3'
|
10
|
-
|
11
|
-
require 'cmd_common'
|
12
|
-
require 'MrMurano/Config'
|
13
|
-
require 'MrMurano/commands/token'
|
14
|
-
|
15
|
-
RSpec.describe 'murano token', :cmd, :needs_password, :nondeterministic do
|
16
|
-
include_context 'CI_CMD'
|
17
|
-
|
18
|
-
context 'without project' do
|
19
|
-
it 'help' do
|
20
|
-
cmd_verify_help('token')
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
context 'with project' do
|
25
|
-
def expect_token_host_user_table(stdout, stderr, num_cols: nil)
|
26
|
-
expect(stderr).to eq('')
|
27
|
-
lines = stdout.lines
|
28
|
-
# FIXME/2017-08-29: Is this too much detail??
|
29
|
-
# What about running test once, dumping output to file,
|
30
|
-
# and expecting same output next time?
|
31
|
-
# Outline of table. n columns. '+-----+-----+---...----+\n'
|
32
|
-
expect(lines[0]).to match(/^(\+-+){#{num_cols}}\+$/)
|
33
|
-
# Header.
|
34
|
-
expect(lines[1]).to match(/^\| Host +\| Username +\|\n$/)
|
35
|
-
# Separator.
|
36
|
-
expect(lines[2]).to match(/^(\+-+){#{num_cols}}\+$/)
|
37
|
-
# Content. Starts with elementId.
|
38
|
-
(3..(lines.length - 2)).to_a.each do |line|
|
39
|
-
expect(lines[line]).to match(/^\| [^\s]+ +\| [^\s]+ +\|\n$/)
|
40
|
-
end
|
41
|
-
expect(lines[-1]).to match(/^(\+-+){#{num_cols}}\+$/)
|
42
|
-
end
|
43
|
-
|
44
|
-
context 'list' do
|
45
|
-
it 'as table' do
|
46
|
-
stdout, stderr = murano_command_run('token list')
|
47
|
-
# 2 columns: elementId, name, status, description.
|
48
|
-
expect_token_host_user_table(stdout, stderr, num_cols: 2)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
data/spec/cmd_usage_spec.rb
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
# Copyright © 2016-2017 Exosite LLC. All Rights Reserved
|
2
|
-
# License: PROPRIETARY. See LICENSE.txt.
|
3
|
-
# frozen_string_literal: true
|
4
|
-
|
5
|
-
# vim:tw=0:ts=2:sw=2:et:ai
|
6
|
-
# Unauthorized copying of this file is strictly prohibited.
|
7
|
-
|
8
|
-
require 'fileutils'
|
9
|
-
require 'open3'
|
10
|
-
require 'cmd_common'
|
11
|
-
|
12
|
-
RSpec.describe 'murano usage', :cmd, :needs_password do
|
13
|
-
include_context 'CI_CMD'
|
14
|
-
|
15
|
-
before(:example) do
|
16
|
-
# NOTE: The usage command works on one or more solutions of any type.
|
17
|
-
# We'll create one product and one application for the test(s).
|
18
|
-
|
19
|
-
@product_name = @snapshotter.resolve_var(
|
20
|
-
'product.name', rname('usageTestPrd')
|
21
|
-
)
|
22
|
-
|
23
|
-
out, err = murano_command_run(
|
24
|
-
'solution create', '--type', 'product', @product_name, '--save',
|
25
|
-
)
|
26
|
-
expect(err).to eq('')
|
27
|
-
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
28
|
-
|
29
|
-
@application_name = @snapshotter.resolve_var(
|
30
|
-
'application.name', rname('usageTestApp')
|
31
|
-
)
|
32
|
-
|
33
|
-
out, err = murano_command_run(
|
34
|
-
'solution create', '--type', 'application', @application_name, '--save',
|
35
|
-
)
|
36
|
-
expect(err).to eq('')
|
37
|
-
expect(out.chomp).to match(/^[a-zA-Z0-9]+$/)
|
38
|
-
end
|
39
|
-
|
40
|
-
after(:example) do
|
41
|
-
out, err = murano_command_run('solutions expunge', '--yes')
|
42
|
-
expect(out).to eq("Deleted 2 solutions\n")
|
43
|
-
expect(err).to eq('')
|
44
|
-
end
|
45
|
-
|
46
|
-
def confirm_usage_table(olines, ix)
|
47
|
-
expect(olines[ix + 0]).to match(
|
48
|
-
%r{^(Product|Application): usage[tT]est[a-z0-9]+ <[a-z0-9]+> https://[.\-a-z0-9]+$}
|
49
|
-
)
|
50
|
-
expect(olines[ix + 1]).to match(/^(\+-+){5}\+$/)
|
51
|
-
expect(olines[ix + 2]).to match(
|
52
|
-
/^\|\s+\| Quota\s+\| Daily\s+\| Monthly\s+\| Total\s+\|$/
|
53
|
-
)
|
54
|
-
# Beneath the header row is a splitter line.
|
55
|
-
expect(olines[ix + 3]).to match(/^(\+-+){5}\+$/)
|
56
|
-
ix += 4
|
57
|
-
# Beneath the splitter line are 1 or more rows, one for each service.
|
58
|
-
loop do
|
59
|
-
if olines[ix].start_with? '+-'
|
60
|
-
# Closing table line.
|
61
|
-
break
|
62
|
-
end
|
63
|
-
expect(olines[ix]).to match(/^| [a-z0-9_]+\s+(|\s+[0-9]*\s+){4}|$/)
|
64
|
-
ix += 1
|
65
|
-
end
|
66
|
-
expect(olines[ix]).to match(/^(\+-+){5}\+$/)
|
67
|
-
ix += 1
|
68
|
-
end
|
69
|
-
|
70
|
-
it 'show usage', :club_10s do
|
71
|
-
out, err = murano_command_run('usage')
|
72
|
-
expect(err).to eq('')
|
73
|
-
olines = out.lines
|
74
|
-
ix = 0
|
75
|
-
ix = confirm_usage_table(olines, ix)
|
76
|
-
_ix = confirm_usage_table(olines, ix)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
data/spec/dry_run_formatter.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# Copyright © 2016-2017 Exosite LLC. All Rights Reserved
|
2
|
-
# License: PROPRIETARY. See LICENSE.txt.
|
3
|
-
# frozen_string_literal: true
|
4
|
-
|
5
|
-
# vim:tw=0:ts=2:sw=2:et:ai
|
6
|
-
# Unauthorized copying of this file is strictly prohibited.
|
7
|
-
|
8
|
-
# This RSpec formatter will tell you the number of tests.
|
9
|
-
#
|
10
|
-
# This is useful if you think a test is short-circuiting the
|
11
|
-
# suite, but $exited_abnormally does not flag it.
|
12
|
-
#
|
13
|
-
# USAGE:
|
14
|
-
#
|
15
|
-
# rspec --require "./spec/dry_run_formatter.rb" --format DryRunFormatter spec
|
16
|
-
|
17
|
-
require 'rspec/core/formatters/base_formatter'
|
18
|
-
|
19
|
-
class DryRunFormatter < RSpec::Core::Formatters::BaseFormatter
|
20
|
-
RSpec::Core::Formatters.register self, :example_started
|
21
|
-
|
22
|
-
def start(example_count)
|
23
|
-
# 2018-07-26: (lb): "Running 538 specs."
|
24
|
-
output << "Running #{example_count.count} specs\n"
|
25
|
-
exit(0)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
data/spec/fixtures/.mrmuranorc
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
---
|
2
|
-
# First up is some metadata about this project.
|
3
|
-
info:
|
4
|
-
# Nice short and easy. Also must be a valid domain name component.
|
5
|
-
name: tested
|
6
|
-
|
7
|
-
# Short one line summary of this project.
|
8
|
-
summary: My little test project
|
9
|
-
|
10
|
-
# Longer, multiple paragraph explanation.
|
11
|
-
description: |
|
12
|
-
There is a lot to say about my little project.
|
13
|
-
|
14
|
-
But I am not saying any of it right now.
|
15
|
-
|
16
|
-
|
17
|
-
# Who made this
|
18
|
-
authors: ["a person with <an@email.address>"]
|
19
|
-
|
20
|
-
# The version of the Project
|
21
|
-
version: 1.56.12
|
22
|
-
|
23
|
-
|
24
|
-
formatversion: 1.0.0
|
@@ -1,27 +0,0 @@
|
|
1
|
-
---
|
2
|
-
# First up is some metadata about this project.
|
3
|
-
info:
|
4
|
-
# Nice short and easy. Also must be a valid domain name component.
|
5
|
-
name: tested
|
6
|
-
|
7
|
-
# Short one line summary of this project.
|
8
|
-
summary: My little test project
|
9
|
-
|
10
|
-
# Longer, multiple paragraph explanation.
|
11
|
-
description: |
|
12
|
-
There is a lot to say about my little project.
|
13
|
-
|
14
|
-
But I am not saying any of it right now.
|
15
|
-
|
16
|
-
|
17
|
-
# Who made this
|
18
|
-
authors: ["a person with <an@email.address>"]
|
19
|
-
|
20
|
-
# The version of the Project
|
21
|
-
version: 1.56.12
|
22
|
-
|
23
|
-
routes:
|
24
|
-
include:
|
25
|
-
- custom_api.lua
|
26
|
-
|
27
|
-
formatversion: 1.0.0
|
@@ -1,20 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"default_page": "index.html",
|
3
|
-
"file_dir": "public",
|
4
|
-
"custom_api": "sample_api.lua",
|
5
|
-
"custom_api_hook": "_init",
|
6
|
-
"modules": {
|
7
|
-
"auth": "modules/util.lua",
|
8
|
-
"debug": "modules/debug.lua",
|
9
|
-
"listen": "modules/listen.lua"
|
10
|
-
},
|
11
|
-
"event_handler": {
|
12
|
-
"device": {
|
13
|
-
"datapoint": "event_handler/product.lua"
|
14
|
-
},
|
15
|
-
"timer": {
|
16
|
-
"timer": "event_handler/timer.lua"
|
17
|
-
}
|
18
|
-
},
|
19
|
-
"cors": {"origin": ["http://localhost:*"]}
|
20
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"default_page": "index.html",
|
3
|
-
"file_dir": "public",
|
4
|
-
"custom_api_hook": "_init",
|
5
|
-
"modules": {
|
6
|
-
"auth": "modules/util.lua",
|
7
|
-
"debug": "modules/debug.lua",
|
8
|
-
"listen": "modules/listen.lua"
|
9
|
-
},
|
10
|
-
"event_handler": {
|
11
|
-
"device": {
|
12
|
-
"datapoint": "event_handler/product.lua"
|
13
|
-
},
|
14
|
-
"timer": {
|
15
|
-
"timer": "event_handler/timer.lua"
|
16
|
-
}
|
17
|
-
}
|
18
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"default_page": "index.html",
|
3
|
-
"file_dir": "public",
|
4
|
-
"custom_api": "sample_api.lua",
|
5
|
-
"custom_api_hook": "_init",
|
6
|
-
"modules": {
|
7
|
-
"auth": "modules/util.lua",
|
8
|
-
"debug": "modules/debug.lua",
|
9
|
-
"listen": "modules/listen.lua"
|
10
|
-
},
|
11
|
-
"event_handler": {
|
12
|
-
"device": {
|
13
|
-
"datapoint": "event_handler/product.lua"
|
14
|
-
},
|
15
|
-
"timer": {
|
16
|
-
"timer": "event_handler/timer.lua"
|
17
|
-
}
|
18
|
-
},
|
19
|
-
"cors": {"origin": ["http://localhost:*"]},
|
20
|
-
"version": "0.2"
|
21
|
-
}
|