hammer_cli_katello 0.24.1 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hammer_cli_katello.rb +6 -14
- data/lib/hammer_cli_katello/activation_key.rb +5 -5
- data/lib/hammer_cli_katello/capsule.rb +2 -3
- data/lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb +10 -7
- data/lib/hammer_cli_katello/command_extensions/lifecycle_environments.rb +11 -8
- data/lib/hammer_cli_katello/content_credential.rb +20 -19
- data/lib/hammer_cli_katello/content_export.rb +1 -0
- data/lib/hammer_cli_katello/content_export_helper.rb +23 -14
- data/lib/hammer_cli_katello/content_view.rb +16 -31
- data/lib/hammer_cli_katello/content_view_version.rb +18 -13
- data/lib/hammer_cli_katello/cv_import_export_helper.rb +21 -0
- data/lib/hammer_cli_katello/deb_package.rb +3 -3
- data/lib/hammer_cli_katello/erratum.rb +1 -1
- data/lib/hammer_cli_katello/erratum_info_command.rb +1 -1
- data/lib/hammer_cli_katello/file.rb +3 -3
- data/lib/hammer_cli_katello/filter.rb +2 -2
- data/lib/hammer_cli_katello/foreman_search_options_creators.rb +0 -12
- data/lib/hammer_cli_katello/host_collection.rb +2 -2
- data/lib/hammer_cli_katello/host_deb.rb +1 -1
- data/lib/hammer_cli_katello/host_errata.rb +1 -1
- data/lib/hammer_cli_katello/host_extensions.rb +5 -5
- data/lib/hammer_cli_katello/host_package.rb +1 -1
- data/lib/hammer_cli_katello/hostgroup_extensions.rb +4 -4
- data/lib/hammer_cli_katello/id_resolver.rb +5 -6
- data/lib/hammer_cli_katello/lifecycle_environment.rb +2 -2
- data/lib/hammer_cli_katello/module_stream.rb +8 -8
- data/lib/hammer_cli_katello/organization_options.rb +8 -6
- data/lib/hammer_cli_katello/ostree_branch.rb +2 -2
- data/lib/hammer_cli_katello/package.rb +5 -5
- data/lib/hammer_cli_katello/package_group.rb +4 -4
- data/lib/hammer_cli_katello/ping.rb +0 -14
- data/lib/hammer_cli_katello/product.rb +3 -3
- data/lib/hammer_cli_katello/product_content.rb +2 -2
- data/lib/hammer_cli_katello/repository.rb +6 -37
- data/lib/hammer_cli_katello/repository_set.rb +4 -4
- data/lib/hammer_cli_katello/simple_content_access.rb +40 -0
- data/lib/hammer_cli_katello/srpm.rb +2 -2
- data/lib/hammer_cli_katello/subscription.rb +2 -3
- data/lib/hammer_cli_katello/sync_plan.rb +2 -2
- data/lib/hammer_cli_katello/version.rb +1 -1
- data/test/data/3.18/foreman_api.json +1 -1
- data/test/data/3.19/foreman_api.json +1 -0
- data/test/data/4.0/foreman_api.json +1 -0
- data/test/functional/capsule/content/info_test.rb +1 -2
- data/test/functional/content_credentials/create_test.rb +32 -0
- data/test/functional/{repository → content_credentials}/data/test_cert.json +0 -0
- data/test/functional/content_credentials/list_test.rb +6 -8
- data/test/functional/content_export/complete/version_test.rb +35 -3
- data/test/functional/content_export/content_export_helpers.rb +19 -14
- data/test/functional/content_export/incremental/version_test.rb +35 -3
- data/test/functional/content_export/list_test.rb +33 -3
- data/test/functional/content_view/content_view_helpers.rb +3 -1
- data/test/functional/content_view/list_test.rb +0 -2
- data/test/functional/content_view/publish_test.rb +0 -21
- data/test/functional/content_view/version/cv_import_export_helper_test.rb +20 -0
- data/test/functional/content_view/version/export_test.rb +12 -0
- data/test/functional/content_view/version/import_test.rb +28 -0
- data/test/functional/content_view/version/promote_test.rb +1 -2
- data/test/functional/content_view/version/republish_repositories_test.rb +1 -2
- data/test/functional/host/errata/apply_test.rb +0 -2
- data/test/functional/host/errata/recalculate_test.rb +0 -2
- data/test/functional/lifecycle_environment/lifecycle_environment_helpers.rb +1 -1
- data/test/functional/ping_test.rb +0 -2
- data/test/functional/repository/create_test.rb +0 -30
- data/test/functional/repository/info_test.rb +4 -4
- data/test/functional/repository/list_test.rb +0 -2
- data/test/functional/search_helpers.rb +11 -0
- data/test/functional/simple_content_access/disable_test.rb +48 -0
- data/test/functional/simple_content_access/enable_test.rb +46 -0
- data/test/test_helper.rb +1 -1
- metadata +18 -18
- data/lib/hammer_cli_katello/content_view_puppet_module.rb +0 -60
- data/lib/hammer_cli_katello/gpg_key.rb +0 -67
- data/lib/hammer_cli_katello/puppet_module.rb +0 -59
- data/test/functional/content_view/puppet_module/add_test.rb +0 -24
- data/test/functional/content_view/puppet_module/remove_test.rb +0 -54
- data/test/functional/gpg_test.rb +0 -39
- data/test/functional/repository/data/test_ca.json +0 -43
- data/test/functional/repository/data/test_key.json +0 -43
@@ -1,21 +1,26 @@
|
|
1
|
+
require_relative '../search_helpers'
|
2
|
+
|
1
3
|
module ContentExportHelpers
|
4
|
+
include SearchHelpers
|
2
5
|
def expects_repositories_in_library(organization_id, returns = [])
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
expect_lenient_search(:repositories,
|
7
|
+
params: {
|
8
|
+
organization_id: organization_id,
|
9
|
+
library: true,
|
10
|
+
search: "download_policy != immediate",
|
11
|
+
content_type: 'yum'
|
12
|
+
},
|
13
|
+
returns: returns)
|
10
14
|
end
|
11
15
|
|
12
16
|
def expects_repositories_in_version(version_id, returns = [])
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
expect_lenient_search(:repositories,
|
18
|
+
params: {
|
19
|
+
content_view_version_id: version_id,
|
20
|
+
library: true,
|
21
|
+
search: "download_policy != immediate",
|
22
|
+
content_type: 'yum'
|
23
|
+
},
|
24
|
+
returns: returns)
|
20
25
|
end
|
21
26
|
end
|
@@ -1,10 +1,14 @@
|
|
1
|
-
|
2
|
-
require_relative '../content_export_helpers'
|
1
|
+
require_relative '../../test_helper'
|
3
2
|
require 'hammer_cli_katello/content_export'
|
3
|
+
require_relative '../../lifecycle_environment/lifecycle_environment_helpers'
|
4
|
+
require_relative '../../content_view/content_view_helpers'
|
5
|
+
require_relative '../content_export_helpers'
|
4
6
|
|
5
7
|
describe 'content-export incremental version' do
|
6
8
|
include ForemanTaskHelpers
|
7
9
|
include ContentExportHelpers
|
10
|
+
include ContentViewHelpers
|
11
|
+
include LifecycleEnvironmentHelpers
|
8
12
|
|
9
13
|
before do
|
10
14
|
@cmd = %w(content-export incremental version)
|
@@ -151,8 +155,8 @@ describe 'content-export incremental version' do
|
|
151
155
|
it 'fails on missing content-view version' do
|
152
156
|
params = ["--content-view-id=2"]
|
153
157
|
result = run_cmd(@cmd + params)
|
154
|
-
expected_error = "Option --version is required"
|
155
158
|
|
159
|
+
expected_error = "--version, --lifecycle-environment-id, --lifecycle-environment is required."
|
156
160
|
assert_equal(result.exit_code, HammerCLI::EX_USAGE)
|
157
161
|
assert_match(/#{expected_error}/, result.err)
|
158
162
|
end
|
@@ -233,4 +237,32 @@ describe 'content-export incremental version' do
|
|
233
237
|
assert_match(/Unable to fully export this version because/, result.out)
|
234
238
|
assert_match(/200/, result.out)
|
235
239
|
end
|
240
|
+
|
241
|
+
it 'should accept content view and lifecycle environment and get the right version' do
|
242
|
+
env = "foo"
|
243
|
+
org_id = '100'
|
244
|
+
env_id = '223'
|
245
|
+
params = ["--content-view-id=#{content_view_id}",
|
246
|
+
"--lifecycle-environment=#{env}",
|
247
|
+
"--organization-id=#{org_id}"]
|
248
|
+
expect_lifecycle_environment_search(org_id, env, env_id)
|
249
|
+
expect_content_view_version_search({'environment_id' => env_id,
|
250
|
+
'content_view_id' => content_view_id},
|
251
|
+
'id' => content_view_version_id).at_least_once
|
252
|
+
|
253
|
+
expects_repositories_in_version(content_view_version_id)
|
254
|
+
ex = api_expects(:content_export_incrementals, :version)
|
255
|
+
ex.returns(response)
|
256
|
+
|
257
|
+
expect_foreman_task(task_id).at_least_once
|
258
|
+
|
259
|
+
HammerCLIKatello::ContentExportIncremental::VersionCommand.
|
260
|
+
any_instance.
|
261
|
+
expects(:fetch_export_history).
|
262
|
+
returns(export_history)
|
263
|
+
|
264
|
+
result = run_cmd(@cmd + params)
|
265
|
+
assert_match(/Generated .*metadata.*json/, result.out)
|
266
|
+
assert_equal(HammerCLI::EX_OK, result.exit_code)
|
267
|
+
end
|
236
268
|
end
|
@@ -23,12 +23,42 @@ describe 'content-export list' do
|
|
23
23
|
|
24
24
|
ex.returns(empty_response)
|
25
25
|
# rubocop:disable LineLength
|
26
|
-
expected_result = success_result('
|
27
|
-
ID | DESTINATION SERVER | PATH | CONTENT VIEW VERSION | CONTENT VIEW VERSION ID | CREATED AT | UPDATED AT
|
28
|
-
|
26
|
+
expected_result = success_result('---|--------------------|------|------|----------------------|-------------------------|------------|-----------
|
27
|
+
ID | DESTINATION SERVER | PATH | TYPE | CONTENT VIEW VERSION | CONTENT VIEW VERSION ID | CREATED AT | UPDATED AT
|
28
|
+
---|--------------------|------|------|----------------------|-------------------------|------------|-----------
|
29
29
|
')
|
30
30
|
# rubocop:enable LineLength
|
31
31
|
result = run_cmd(%w(content-export list))
|
32
32
|
assert_cmd(expected_result, result)
|
33
33
|
end
|
34
|
+
|
35
|
+
it 'works with content-view-id only' do
|
36
|
+
api_expects(:content_view_versions, :index).returns(empty_response)
|
37
|
+
|
38
|
+
ex = api_expects(:content_exports, :index)
|
39
|
+
|
40
|
+
ex.returns(empty_response)
|
41
|
+
# rubocop:disable LineLength
|
42
|
+
expected_result = success_result('---|--------------------|------|------|----------------------|-------------------------|------------|-----------
|
43
|
+
ID | DESTINATION SERVER | PATH | TYPE | CONTENT VIEW VERSION | CONTENT VIEW VERSION ID | CREATED AT | UPDATED AT
|
44
|
+
---|--------------------|------|------|----------------------|-------------------------|------------|-----------
|
45
|
+
')
|
46
|
+
# rubocop:enable LineLength
|
47
|
+
result = run_cmd(%w(content-export list --content-view-id=1))
|
48
|
+
assert_cmd(expected_result, result)
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'works with content-view-version-id only' do
|
52
|
+
ex = api_expects(:content_exports, :index)
|
53
|
+
|
54
|
+
ex.returns(empty_response)
|
55
|
+
# rubocop:disable LineLength
|
56
|
+
expected_result = success_result('---|--------------------|------|------|----------------------|-------------------------|------------|-----------
|
57
|
+
ID | DESTINATION SERVER | PATH | TYPE | CONTENT VIEW VERSION | CONTENT VIEW VERSION ID | CREATED AT | UPDATED AT
|
58
|
+
---|--------------------|------|------|----------------------|-------------------------|------------|-----------
|
59
|
+
')
|
60
|
+
# rubocop:enable LineLength
|
61
|
+
result = run_cmd(%w(content-export list --content-view-version-id=1))
|
62
|
+
assert_cmd(expected_result, result)
|
63
|
+
end
|
34
64
|
end
|
@@ -13,6 +13,8 @@ module ContentViewHelpers
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def expect_content_view_version_search(params, returns)
|
16
|
-
|
16
|
+
expect_lenient_search(:content_view_versions,
|
17
|
+
params: params,
|
18
|
+
returns: returns)
|
17
19
|
end
|
18
20
|
end
|
@@ -1,8 +1,6 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), '../test_helper')
|
2
2
|
require File.join(File.dirname(__FILE__), '../lifecycle_environment/lifecycle_environment_helpers')
|
3
3
|
|
4
|
-
require 'hammer_cli_katello/content_view_puppet_module'
|
5
|
-
|
6
4
|
describe 'listing content-views' do
|
7
5
|
include LifecycleEnvironmentHelpers
|
8
6
|
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require_relative '../test_helper'
|
2
|
-
require 'hammer_cli_katello/content_view_puppet_module'
|
3
2
|
require 'hammer_cli_katello/content_view'
|
4
3
|
|
5
4
|
module HammerCLIKatello
|
@@ -22,24 +21,4 @@ module HammerCLIKatello
|
|
22
21
|
run_cmd(%w(content-view publish --major 5 --minor 1 --organization org1 --name cv --async))
|
23
22
|
end
|
24
23
|
end
|
25
|
-
|
26
|
-
describe ContentViewPuppetModule do
|
27
|
-
it 'allows adding a puppet module' do
|
28
|
-
ex = api_expects(:organizations, :index) do |p|
|
29
|
-
p[:search] == "name = \"org1\""
|
30
|
-
end
|
31
|
-
ex.returns(index_response([{'id' => 1}]))
|
32
|
-
|
33
|
-
ex = api_expects(:content_views, :index) do |p|
|
34
|
-
p['name'] == 'cv' && p['organization_id'] == 1
|
35
|
-
end
|
36
|
-
ex.returns(index_response([{'id' => 3}]))
|
37
|
-
|
38
|
-
api_expects(:content_views, :publish) do |p|
|
39
|
-
p['id'] == 3
|
40
|
-
end
|
41
|
-
|
42
|
-
run_cmd(%w(content-view publish --organization org1 --name cv --async))
|
43
|
-
end
|
44
|
-
end
|
45
24
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../../test_helper'
|
2
|
+
describe 'CVImportExportHelper' do
|
3
|
+
describe 'validate_pulp3_not_enabled' do
|
4
|
+
include HammerCLIKatello::CVImportExportHelper
|
5
|
+
it 'returns true when the api endpoint does not return a value' do
|
6
|
+
api_expects(:content_exports, :api_status)
|
7
|
+
assert_equal true, validate_pulp3_not_enabled('fail_msg')
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'raises error when the api reports Pulp 3 is enabled' do
|
11
|
+
api_expects(:content_exports, :api_status).returns('api_usable' => true)
|
12
|
+
assert_raises(RuntimeError, 'fail msg') { validate_pulp3_not_enabled('fail msg') }
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'returns nil when the api reports Pulp 3 is not enabled' do
|
16
|
+
api_expects(:content_exports, :api_status).returns('api_usable' => false)
|
17
|
+
assert_equal nil, validate_pulp3_not_enabled('fail_msg')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -8,6 +8,10 @@ describe 'content-view version export' do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
it "performs export" do
|
11
|
+
HammerCLIKatello::ContentViewVersion::ExportCommand
|
12
|
+
.any_instance
|
13
|
+
.expects(:validate_pulp3_not_enabled)
|
14
|
+
.returns(true)
|
11
15
|
params = [
|
12
16
|
'--id=5',
|
13
17
|
'--export-dir=/tmp/exports'
|
@@ -65,6 +69,10 @@ describe 'content-view version export' do
|
|
65
69
|
end
|
66
70
|
|
67
71
|
it "performs composite export" do
|
72
|
+
HammerCLIKatello::ContentViewVersion::ExportCommand
|
73
|
+
.any_instance
|
74
|
+
.expects(:validate_pulp3_not_enabled)
|
75
|
+
.returns(true)
|
68
76
|
params = [
|
69
77
|
'--id=999',
|
70
78
|
'--export-dir=/tmp/exports'
|
@@ -101,6 +109,10 @@ describe 'content-view version export' do
|
|
101
109
|
end
|
102
110
|
|
103
111
|
it "fails export if content view version has no repository" do
|
112
|
+
HammerCLIKatello::ContentViewVersion::ExportCommand
|
113
|
+
.any_instance
|
114
|
+
.expects(:validate_pulp3_not_enabled)
|
115
|
+
.returns(true)
|
104
116
|
params = [
|
105
117
|
'--id=5',
|
106
118
|
'--export-dir=/tmp/exports'
|
@@ -8,6 +8,10 @@ describe 'content-view version import' do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
it "performs import" do
|
11
|
+
HammerCLIKatello::ContentViewVersion::ImportCommand
|
12
|
+
.any_instance
|
13
|
+
.expects(:validate_pulp3_not_enabled)
|
14
|
+
.returns(true)
|
11
15
|
params = [
|
12
16
|
'--export-tar=/tmp/exports/export-2.tar',
|
13
17
|
'--organization-id=1'
|
@@ -75,6 +79,10 @@ describe 'content-view version import' do
|
|
75
79
|
end
|
76
80
|
|
77
81
|
it "performs composite import" do
|
82
|
+
HammerCLIKatello::ContentViewVersion::ImportCommand
|
83
|
+
.any_instance
|
84
|
+
.expects(:validate_pulp3_not_enabled)
|
85
|
+
.returns(true)
|
78
86
|
params = [
|
79
87
|
'--export-tar=/tmp/exports/export-999.tar',
|
80
88
|
'--organization-id=1'
|
@@ -135,6 +143,10 @@ describe 'content-view version import' do
|
|
135
143
|
end
|
136
144
|
|
137
145
|
it "performs composite import, component not found" do
|
146
|
+
HammerCLIKatello::ContentViewVersion::ImportCommand
|
147
|
+
.any_instance
|
148
|
+
.expects(:validate_pulp3_not_enabled)
|
149
|
+
.returns(true)
|
138
150
|
params = [
|
139
151
|
'--export-tar=/tmp/exports/export-999.tar',
|
140
152
|
'--organization-id=1'
|
@@ -184,6 +196,10 @@ describe 'content-view version import' do
|
|
184
196
|
end
|
185
197
|
|
186
198
|
it "fails import if cv has not been created" do
|
199
|
+
HammerCLIKatello::ContentViewVersion::ImportCommand
|
200
|
+
.any_instance
|
201
|
+
.expects(:validate_pulp3_not_enabled)
|
202
|
+
.returns(true)
|
187
203
|
params = [
|
188
204
|
'--export-tar=/tmp/exports/export-2.tar',
|
189
205
|
'--organization-id=1'
|
@@ -210,6 +226,10 @@ describe 'content-view version import' do
|
|
210
226
|
end
|
211
227
|
|
212
228
|
it "fails import if repo is set to mirror-on-sync" do
|
229
|
+
HammerCLIKatello::ContentViewVersion::ImportCommand
|
230
|
+
.any_instance
|
231
|
+
.expects(:validate_pulp3_not_enabled)
|
232
|
+
.returns(true)
|
213
233
|
params = [
|
214
234
|
'--export-tar=/tmp/exports/export-2.tar',
|
215
235
|
'--organization-id=1'
|
@@ -244,6 +264,10 @@ describe 'content-view version import' do
|
|
244
264
|
end
|
245
265
|
|
246
266
|
it "fails import if cv version already exists" do
|
267
|
+
HammerCLIKatello::ContentViewVersion::ImportCommand
|
268
|
+
.any_instance
|
269
|
+
.expects(:validate_pulp3_not_enabled)
|
270
|
+
.returns(true)
|
247
271
|
params = [
|
248
272
|
'--export-tar=/tmp/exports/export-2.tar',
|
249
273
|
'--organization-id=1'
|
@@ -278,6 +302,10 @@ describe 'content-view version import' do
|
|
278
302
|
end
|
279
303
|
|
280
304
|
it "fails import if any repository does not exist" do
|
305
|
+
HammerCLIKatello::ContentViewVersion::ImportCommand
|
306
|
+
.any_instance
|
307
|
+
.expects(:validate_pulp3_not_enabled)
|
308
|
+
.returns(true)
|
281
309
|
params = [
|
282
310
|
'--export-tar=/tmp/exports/export-2.tar',
|
283
311
|
'--organization-id=1'
|
@@ -1,8 +1,7 @@
|
|
1
1
|
require_relative '../../test_helper'
|
2
|
-
require 'hammer_cli_katello/content_view_puppet_module'
|
3
2
|
|
4
3
|
module HammerCLIKatello
|
5
|
-
describe
|
4
|
+
describe ContentViewVersion::PromoteCommand do
|
6
5
|
it 'allows promoting a content view' do
|
7
6
|
ex = api_expects(:organizations, :index) do |p|
|
8
7
|
p[:search] == "name = \"org1\""
|
@@ -1,8 +1,7 @@
|
|
1
1
|
require_relative '../../test_helper'
|
2
|
-
require 'hammer_cli_katello/content_view_puppet_module'
|
3
2
|
|
4
3
|
module HammerCLIKatello
|
5
|
-
describe
|
4
|
+
describe ContentViewVersion::RepublishRepositoriesCommand do
|
6
5
|
include ForemanTaskHelpers
|
7
6
|
include OrganizationHelpers
|
8
7
|
|
@@ -4,7 +4,7 @@ module LifecycleEnvironmentHelpers
|
|
4
4
|
include SearchHelpers
|
5
5
|
|
6
6
|
def expect_lifecycle_environment_search(org_id, name, id)
|
7
|
-
|
7
|
+
expect_lenient_search(:lifecycle_environments,
|
8
8
|
params: {'name' => name, 'organization_id' => org_id},
|
9
9
|
returns: {'id' => id})
|
10
10
|
end
|
@@ -11,8 +11,6 @@ describe 'ping' do
|
|
11
11
|
'candlepin_events' => {'status' => 'ok', 'message' => '0 messages', 'duration_ms' => '34'},
|
12
12
|
'candlepin_auth' => {'status' => 'ok', 'duration_ms' => '34'},
|
13
13
|
'katello_events' => {'status' => 'ok', 'message' => '0 messages', 'duration_ms' => '34'},
|
14
|
-
'pulp' => {'status' => 'ok', 'duration_ms' => '34'},
|
15
|
-
'pulp_auth' => {'status' => 'ok', 'duration_ms' => '34'},
|
16
14
|
'pulp3' => {'status' => 'ok', 'duration_ms' => '34'}
|
17
15
|
}
|
18
16
|
)
|
@@ -18,34 +18,4 @@ describe "create repository" do
|
|
18
18
|
|
19
19
|
assert_equal(0, run_cmd(command).exit_code)
|
20
20
|
end
|
21
|
-
|
22
|
-
it 'with ssl options by name' do
|
23
|
-
def stub_gpg_key(gpg_key_name)
|
24
|
-
gpg_key_index = api_expects(:gpg_keys, :index)
|
25
|
-
.with_params(
|
26
|
-
name: gpg_key_name.to_s,
|
27
|
-
organization_id: 1,
|
28
|
-
per_page: 1000,
|
29
|
-
page: 1)
|
30
|
-
gpg_response = File.join(File.dirname(__FILE__), 'data', "#{gpg_key_name}.json")
|
31
|
-
gpg_key_index.returns(JSON.parse(File.read(gpg_response)))
|
32
|
-
end
|
33
|
-
|
34
|
-
api_expects(:repositories, :create)
|
35
|
-
.with_params(
|
36
|
-
name: name,
|
37
|
-
product_id: product_id,
|
38
|
-
ssl_ca_cert_id: 1,
|
39
|
-
ssl_client_cert_id: 2,
|
40
|
-
ssl_client_key_id: 3,
|
41
|
-
content_type: content_type)
|
42
|
-
|
43
|
-
%w(test_cert test_key test_ca).each { |cred| stub_gpg_key(cred) }
|
44
|
-
|
45
|
-
command = %W(repository create --organization-id #{org_id} --product-id #{product_id}
|
46
|
-
--content-type #{content_type} --name #{name} --ssl-client-cert test_cert
|
47
|
-
--ssl-client-key test_key --ssl-ca-cert test_ca)
|
48
|
-
|
49
|
-
assert_equal(0, run_cmd(command).exit_code)
|
50
|
-
end
|
51
21
|
end
|
@@ -46,7 +46,7 @@ describe "get repository info" do
|
|
46
46
|
)
|
47
47
|
result = run_cmd(@cmd + params)
|
48
48
|
# rubocop:disable Style/WordArray
|
49
|
-
expected_fields = [['
|
49
|
+
expected_fields = [['Id', '1'],
|
50
50
|
['Name', 'Test Repo'],
|
51
51
|
['Label', 'Test_Repo'],
|
52
52
|
['Description', 'hammertime'],
|
@@ -59,7 +59,7 @@ describe "get repository info" do
|
|
59
59
|
['Download Policy', 'immediate'],
|
60
60
|
['HTTP Proxy', ''],
|
61
61
|
['Product', ''],
|
62
|
-
['
|
62
|
+
['Id', '79'],
|
63
63
|
['Name', 'test'],
|
64
64
|
['GPG Key', ''],
|
65
65
|
['Sync', ''],
|
@@ -122,7 +122,7 @@ describe "get repository info" do
|
|
122
122
|
)
|
123
123
|
result = run_cmd(@cmd + params)
|
124
124
|
# rubocop:disable Style/WordArray
|
125
|
-
expected_fields = [['
|
125
|
+
expected_fields = [['Id', '1'],
|
126
126
|
['Name', 'Test Repo'],
|
127
127
|
['Label', 'Test_Repo'],
|
128
128
|
['Description', 'hammertime'],
|
@@ -135,7 +135,7 @@ describe "get repository info" do
|
|
135
135
|
['Download Policy', 'immediate'],
|
136
136
|
['HTTP Proxy', ''],
|
137
137
|
['Product', ''],
|
138
|
-
['
|
138
|
+
['Id', '79'],
|
139
139
|
['Name', 'Test_Product'],
|
140
140
|
['GPG Key', ''],
|
141
141
|
['Sync', ''],
|