hammer_cli_katello 1.3.0 → 1.4.1
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/lib/hammer_cli_katello/content_units.rb +66 -0
- data/lib/hammer_cli_katello/content_view_component.rb +4 -3
- data/lib/hammer_cli_katello/repository.rb +67 -31
- data/lib/hammer_cli_katello/version.rb +1 -1
- data/lib/hammer_cli_katello.rb +5 -5
- data/test/data/4.3/foreman_api.json +1 -1
- data/test/data/4.4/foreman_api.json +1 -0
- data/test/functional/content_units/info_test.rb +29 -0
- data/test/functional/content_units/list_test.rb +106 -0
- data/test/functional/organization/cdn_configuration_test.rb +5 -2
- data/test/functional/repository/info_test.rb +6 -0
- data/test/functional/repository/reclaim_space_test.rb +105 -0
- data/test/functional/repository/upload_test.rb +46 -23
- data/test/test_helper.rb +1 -1
- metadata +11 -3
- data/lib/hammer_cli_katello/ostree_branch.rb +0 -34
@@ -0,0 +1,29 @@
|
|
1
|
+
require_relative '../test_helper.rb'
|
2
|
+
require_relative '../organization/organization_helpers'
|
3
|
+
require_relative '../content_view/content_view_helpers'
|
4
|
+
require_relative '../repository/repository_helpers'
|
5
|
+
require_relative '../product/product_helpers'
|
6
|
+
require 'hammer_cli_katello/content_units'
|
7
|
+
|
8
|
+
module HammerCLIKatello
|
9
|
+
describe ContentUnitsCommand::InfoCommand do
|
10
|
+
include ContentViewHelpers
|
11
|
+
include RepositoryHelpers
|
12
|
+
include ProductHelpers
|
13
|
+
include OrganizationHelpers
|
14
|
+
|
15
|
+
it 'allows minimal options' do
|
16
|
+
api_expects(:generic_content_units, :show)
|
17
|
+
.with_params('content_type' => 'python_package', 'id' => '1492')
|
18
|
+
|
19
|
+
run_cmd(%w(content-units info --content-type python_package --id 1492))
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'requires content_type param' do
|
23
|
+
api_expects_no_call
|
24
|
+
|
25
|
+
r = run_cmd(%w(content-units info --id 1492))
|
26
|
+
assert(r.err.include?("Missing arguments for '--content-type'"), "Invalid error message")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
require_relative '../test_helper.rb'
|
2
|
+
require_relative '../organization/organization_helpers'
|
3
|
+
require_relative '../content_view/content_view_helpers'
|
4
|
+
require_relative '../repository/repository_helpers'
|
5
|
+
require_relative '../product/product_helpers'
|
6
|
+
require 'hammer_cli_katello/content_units'
|
7
|
+
|
8
|
+
module HammerCLIKatello
|
9
|
+
describe ContentUnitsCommand::ListCommand do
|
10
|
+
include ContentViewHelpers
|
11
|
+
include RepositoryHelpers
|
12
|
+
include ProductHelpers
|
13
|
+
include OrganizationHelpers
|
14
|
+
|
15
|
+
it 'allows minimal options' do
|
16
|
+
api_expects(:generic_content_units, :index)
|
17
|
+
.with_params('content_type' => 'python_package')
|
18
|
+
|
19
|
+
run_cmd(%w(content-units list --content-type python_package))
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'requires content_type param' do
|
23
|
+
api_expects_no_call
|
24
|
+
|
25
|
+
r = run_cmd(%w(content-units list))
|
26
|
+
assert(r.err.include?("Missing arguments for '--content-type'"), "Invalid error message")
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'repository options' do
|
30
|
+
it 'may be specified by ID' do
|
31
|
+
api_expects(:generic_content_units, :index)
|
32
|
+
.with_params('content_type' => 'python_package', 'repository_id' => 1)
|
33
|
+
|
34
|
+
run_cmd(%w(content-units list --content-type python_package --repository-id 1))
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'require product ID when given repository name' do
|
38
|
+
api_expects_no_call
|
39
|
+
|
40
|
+
r = run_cmd(%w(content-units list --content-type python_package --repository repo1))
|
41
|
+
assert(r.err.include?("--product, --product-id is required"), "Invalid error message")
|
42
|
+
end
|
43
|
+
|
44
|
+
# rubocop:disable LineLength
|
45
|
+
it 'may be specified by name and product ID' do
|
46
|
+
expect_repository_search(2, 'repo1', 1)
|
47
|
+
|
48
|
+
api_expects(:generic_content_units, :index)
|
49
|
+
.with_params('content_type' => 'python_package', 'repository_id' => 1)
|
50
|
+
run_cmd(%w(content-units list --content-type python_package --repository repo1 --product-id 2))
|
51
|
+
end
|
52
|
+
# rubocop:enable LineLength
|
53
|
+
end
|
54
|
+
|
55
|
+
describe 'organization options' do
|
56
|
+
it 'may be specified by ID' do
|
57
|
+
api_expects(:generic_content_units, :index)
|
58
|
+
.with_params('organization_id' => 1, 'content_type' => 'python_package')
|
59
|
+
|
60
|
+
run_cmd(%w(content-units list --organization-id 1 --content-type python_package))
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'may be specified by name' do
|
64
|
+
expect_organization_search('org3', 1)
|
65
|
+
api_expects(:generic_content_units, :index)
|
66
|
+
.with_params('organization_id' => 1, 'content_type' => 'python_package')
|
67
|
+
|
68
|
+
run_cmd(%w(content-units list --organization org3 --content-type python_package))
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'may be specified by label' do
|
72
|
+
expect_organization_search('org3', 1, field: 'label')
|
73
|
+
api_expects(:generic_content_units, :index)
|
74
|
+
.with_params('organization_id' => 1, 'content_type' => 'python_package')
|
75
|
+
|
76
|
+
run_cmd(%w(content-units list --organization-label org3 --content-type python_package))
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe 'content-view options' do
|
81
|
+
# rubocop:disable LineLength
|
82
|
+
it 'may be specified by ID' do
|
83
|
+
api_expects(:content_view_versions, :index)
|
84
|
+
.with_params('content_view_id' => 1, 'version' => '2.1')
|
85
|
+
.returns(index_response([{'id' => 5}]))
|
86
|
+
api_expects(:generic_content_units, :index)
|
87
|
+
.with_params('content_view_version_id' => 5, 'content_type' => 'python_package')
|
88
|
+
|
89
|
+
run_cmd(
|
90
|
+
%w(
|
91
|
+
content-units list --content-view-id 1 --content-view-version 2.1 --content-type python_package
|
92
|
+
)
|
93
|
+
)
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'requires organization ID when given content view name' do
|
97
|
+
api_expects_no_call
|
98
|
+
|
99
|
+
r = run_cmd(%w(content-units list --content-view cv1 --content-view-version 2.1 --content-type python_package))
|
100
|
+
expected_error = "--organization-id, --organization, --organization-label is required"
|
101
|
+
assert(r.err.include?(expected_error), "Invalid error message")
|
102
|
+
end
|
103
|
+
# rubocop:enable LineLength
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -16,12 +16,14 @@ describe HammerCLIKatello::Organization::ConfigureCdnCommand do
|
|
16
16
|
username = "foo"
|
17
17
|
url = "https://goo.com"
|
18
18
|
upstream_label = "GreatOrg"
|
19
|
+
type = 'upstream_server'
|
19
20
|
params = ["--label=#{org_label}",
|
20
21
|
"--url=#{url}",
|
21
22
|
"--username=#{username}",
|
22
23
|
"--upstream-organization-label=#{upstream_label}",
|
23
24
|
"--password=#{password}",
|
24
|
-
"--ssl-ca-credential-id=#{ssl_cred_id}"
|
25
|
+
"--ssl-ca-credential-id=#{ssl_cred_id}",
|
26
|
+
"--type=#{type}"
|
25
27
|
]
|
26
28
|
expect_organization_search(org_label, org_id, field: 'label')
|
27
29
|
|
@@ -31,7 +33,8 @@ describe HammerCLIKatello::Organization::ConfigureCdnCommand do
|
|
31
33
|
par['url'] == url &&
|
32
34
|
par['password'] == password &&
|
33
35
|
par['ssl_ca_credential_id'].to_s == ssl_cred_id &&
|
34
|
-
par['upstream_organization_label'] == upstream_label
|
36
|
+
par['upstream_organization_label'] == upstream_label &&
|
37
|
+
par['type'] == type
|
35
38
|
end
|
36
39
|
|
37
40
|
assert_equal(
|
@@ -42,6 +42,10 @@ describe "get repository info" do
|
|
42
42
|
'package_group' => 0,
|
43
43
|
'erratum' => 1,
|
44
44
|
'module_stream' => 0
|
45
|
+
},
|
46
|
+
'content_credential' => {
|
47
|
+
'id' => 1,
|
48
|
+
'name' => 'pizza'
|
45
49
|
}
|
46
50
|
)
|
47
51
|
result = run_cmd(@cmd + params)
|
@@ -62,6 +66,8 @@ describe "get repository info" do
|
|
62
66
|
['Id', '79'],
|
63
67
|
['Name', 'test'],
|
64
68
|
['GPG Key', ''],
|
69
|
+
['Id', '1'],
|
70
|
+
['Name', 'pizza'],
|
65
71
|
['Sync', ''],
|
66
72
|
['Status', 'Not Synced'],
|
67
73
|
['Last Sync Date', '3 minutes'],
|
@@ -0,0 +1,105 @@
|
|
1
|
+
require_relative '../test_helper'
|
2
|
+
require_relative '../organization/organization_helpers'
|
3
|
+
require 'hammer_cli_katello/repository'
|
4
|
+
module HammerCLIKatello
|
5
|
+
describe Repository::ReclaimSpaceCommand do
|
6
|
+
include OrganizationHelpers
|
7
|
+
it 'allows minimal options' do
|
8
|
+
api_expects(:repositories, :reclaim_space) do |p|
|
9
|
+
p['id'] == 1
|
10
|
+
end
|
11
|
+
run_cmd(%w(repository reclaim-space --id 1))
|
12
|
+
end
|
13
|
+
|
14
|
+
describe 'resolves repository ID' do
|
15
|
+
it 'by requiring product' do
|
16
|
+
api_expects_no_call
|
17
|
+
result = run_cmd(%w(repository reclaim-space --name repo1))
|
18
|
+
assert(result.err[/--product, --product-id is required/], 'Incorrect error message')
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'by product ID' do
|
22
|
+
ex = api_expects(:repositories, :index) do |p|
|
23
|
+
p['name'] == 'repo1' && p['product_id'] == 3
|
24
|
+
end
|
25
|
+
ex.returns(index_response([{'id' => 1}]))
|
26
|
+
|
27
|
+
api_expects(:repositories, :reclaim_space) do |p|
|
28
|
+
p['id'] == 1
|
29
|
+
end
|
30
|
+
|
31
|
+
run_cmd(%w(repository reclaim-space --name repo1 --product-id 3))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe 'resolves product ID' do
|
36
|
+
it 'by requiring organization options' do
|
37
|
+
api_expects_no_call
|
38
|
+
result = run_cmd(%w(repository reclaim-space --name repo1 --product prod1))
|
39
|
+
assert(result.err[/--organization-id, --organization, --organization-label is required/],
|
40
|
+
"Organization option requirements must be validated")
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'by organization ID' do
|
44
|
+
ex = api_expects(:products, :index) do |p|
|
45
|
+
p['name'] == 'prod3' && p['organization_id'] == '5'
|
46
|
+
end
|
47
|
+
ex.returns(index_response([{'id' => 3}]))
|
48
|
+
|
49
|
+
ex = api_expects(:repositories, :index) do |p|
|
50
|
+
p['name'] == 'repo1' && p['product_id'] == 3
|
51
|
+
end
|
52
|
+
ex.returns(index_response([{'id' => 1}]))
|
53
|
+
|
54
|
+
api_expects(:repositories, :reclaim_space) do |p|
|
55
|
+
p['id'] == 1
|
56
|
+
end
|
57
|
+
|
58
|
+
run_cmd(%w(repository reclaim-space --name repo1 --product prod3 --organization-id 5
|
59
|
+
))
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'by organization name' do
|
63
|
+
expect_organization_search('org5', 5)
|
64
|
+
|
65
|
+
ex = api_expects(:products, :index) do |p|
|
66
|
+
p['name'] == 'prod3' && p['organization_id'] == 5
|
67
|
+
end
|
68
|
+
ex.returns(index_response([{'id' => 3}]))
|
69
|
+
|
70
|
+
ex = api_expects(:repositories, :index) do |p|
|
71
|
+
p['name'] == 'repo1' && p['product_id'] == 3
|
72
|
+
end
|
73
|
+
ex.returns(index_response([{'id' => 1}]))
|
74
|
+
|
75
|
+
api_expects(:repositories, :reclaim_space) do |p|
|
76
|
+
p['id'] == 1
|
77
|
+
end
|
78
|
+
|
79
|
+
run_cmd(%w(repository reclaim-space --name repo1 --product prod3 --organization org5
|
80
|
+
))
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'by organization label' do
|
84
|
+
expect_organization_search('org5', 5, field: 'label')
|
85
|
+
|
86
|
+
ex = api_expects(:products, :index) do |p|
|
87
|
+
p['name'] == 'prod3' && p['organization_id'] == 5
|
88
|
+
end
|
89
|
+
ex.returns(index_response([{'id' => 3}]))
|
90
|
+
|
91
|
+
ex = api_expects(:repositories, :index) do |p|
|
92
|
+
p['name'] == 'repo1' && p['product_id'] == 3
|
93
|
+
end
|
94
|
+
ex.returns(index_response([{'id' => 1}]))
|
95
|
+
|
96
|
+
api_expects(:repositories, :reclaim_space) do |p|
|
97
|
+
p['id'] == 1
|
98
|
+
end
|
99
|
+
|
100
|
+
run_cmd(%w(repository reclaim-space --name repo1 --product prod3 --organization-label org5
|
101
|
+
))
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -17,10 +17,16 @@ describe 'upload repository' do
|
|
17
17
|
let(:path) { "./test.rpm" }
|
18
18
|
let(:upload_id) { "1234" }
|
19
19
|
let(:_href) { "/pulp/api/v2/content/uploads/#{upload_id}" }
|
20
|
+
let(:task_id) { "2ea4f" }
|
20
21
|
let(:upload_response) do
|
21
22
|
{
|
22
23
|
"upload_id" => upload_id,
|
23
|
-
"
|
24
|
+
"href" => _href
|
25
|
+
}
|
26
|
+
end
|
27
|
+
let(:import_uploads_response) do
|
28
|
+
{
|
29
|
+
"id" => task_id
|
24
30
|
}
|
25
31
|
end
|
26
32
|
|
@@ -36,7 +42,7 @@ describe 'upload repository' do
|
|
36
42
|
|
37
43
|
# rubocop:disable LineLength
|
38
44
|
ex2 = api_expects(:repositories, :import_uploads, 'Take in an upload')
|
39
|
-
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true,
|
45
|
+
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true, :async => true,
|
40
46
|
:uploads => [{
|
41
47
|
:id => '1234',
|
42
48
|
:name => 'test.rpm',
|
@@ -47,14 +53,16 @@ describe 'upload repository' do
|
|
47
53
|
)
|
48
54
|
# rubocop:enable LineLength
|
49
55
|
|
50
|
-
ex2.returns(
|
56
|
+
ex2.returns(import_uploads_response)
|
57
|
+
expect_foreman_task(task_id)
|
58
|
+
expect_foreman_task(task_id)
|
51
59
|
|
52
60
|
ex3 = api_expects(:content_uploads, :destroy, "Delete the upload")
|
53
61
|
.with_params('id' => upload_id, 'repository_id' => repo_id)
|
54
62
|
|
55
63
|
ex3.returns("")
|
56
|
-
|
57
64
|
result = run_cmd(@cmd + params)
|
65
|
+
|
58
66
|
assert_equal(result.exit_code, 0)
|
59
67
|
File.delete("test.rpm")
|
60
68
|
end
|
@@ -70,7 +78,7 @@ describe 'upload repository' do
|
|
70
78
|
|
71
79
|
# rubocop:disable LineLength
|
72
80
|
ex2 = api_expects(:repositories, :import_uploads, 'Take in an upload')
|
73
|
-
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true, :content_type => 'srpm',
|
81
|
+
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true, :content_type => 'srpm', :async => true,
|
74
82
|
:uploads => [{
|
75
83
|
:id => '1234',
|
76
84
|
:name => 'test.src.rpm',
|
@@ -79,9 +87,11 @@ describe 'upload repository' do
|
|
79
87
|
:checksum => 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
|
80
88
|
}]
|
81
89
|
)
|
82
|
-
|
83
90
|
# rubocop:enable LineLength
|
84
|
-
|
91
|
+
|
92
|
+
ex2.returns(import_uploads_response)
|
93
|
+
expect_foreman_task(task_id)
|
94
|
+
expect_foreman_task(task_id)
|
85
95
|
|
86
96
|
ex3 = api_expects(:content_uploads, :destroy, "Delete the upload")
|
87
97
|
.with_params(:id => upload_id, :repository_id => repo_id)
|
@@ -105,7 +115,7 @@ describe 'upload repository' do
|
|
105
115
|
|
106
116
|
# rubocop:disable LineLength
|
107
117
|
ex2 = api_expects(:repositories, :import_uploads, 'Take in an upload')
|
108
|
-
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true,
|
118
|
+
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true, :async => true,
|
109
119
|
:uploads => [{
|
110
120
|
:id => '1234',
|
111
121
|
:name => 'test.src.rpm',
|
@@ -140,7 +150,7 @@ describe 'upload repository' do
|
|
140
150
|
|
141
151
|
# rubocop:disable LineLength
|
142
152
|
ex2 = api_expects(:repositories, :import_uploads, 'Take in an upload')
|
143
|
-
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true,
|
153
|
+
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true, :async => true,
|
144
154
|
:uploads => [{
|
145
155
|
:id => '1234',
|
146
156
|
:name => 'test.rpm',
|
@@ -150,13 +160,20 @@ describe 'upload repository' do
|
|
150
160
|
}]
|
151
161
|
)
|
152
162
|
# rubocop:enable LineLength
|
153
|
-
ex2.returns('output' => {'upload_results' => [{'type' => 'docker_manifest',
|
154
|
-
'digest' => 'sha256:1234'}]})
|
155
163
|
|
156
|
-
|
164
|
+
ex2.returns(import_uploads_response)
|
165
|
+
expect_foreman_task(task_id)
|
166
|
+
|
167
|
+
ex3 = api_expects(:foreman_tasks, :show, 'Show task')
|
168
|
+
ex3.returns('id' => task_id, 'state' => 'stopped', 'progress' => 1,
|
169
|
+
'humanized' => {'output' => {'upload_results' => [{'type' => 'docker_manifest',
|
170
|
+
'digest' => 'sha256:1234'}]},
|
171
|
+
'errors' => ''})
|
172
|
+
|
173
|
+
ex4 = api_expects(:content_uploads, :destroy, "Delete the upload")
|
157
174
|
.with_params(:id => upload_id, :repository_id => repo_id)
|
158
175
|
|
159
|
-
|
176
|
+
ex4.returns("")
|
160
177
|
|
161
178
|
result = run_cmd(@cmd + params)
|
162
179
|
assert_equal(result.exit_code, 0)
|
@@ -180,7 +197,7 @@ describe 'upload repository' do
|
|
180
197
|
|
181
198
|
# rubocop:disable LineLength
|
182
199
|
ex2 = api_expects(:repositories, :import_uploads, 'Take in an upload')
|
183
|
-
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true,
|
200
|
+
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true, :async => true,
|
184
201
|
:uploads => [{
|
185
202
|
:id => '1234',
|
186
203
|
:name => 'test.rpm',
|
@@ -191,7 +208,9 @@ describe 'upload repository' do
|
|
191
208
|
)
|
192
209
|
# rubocop:enable LineLength
|
193
210
|
|
194
|
-
ex2.returns(
|
211
|
+
ex2.returns(import_uploads_response)
|
212
|
+
expect_foreman_task(task_id)
|
213
|
+
expect_foreman_task(task_id)
|
195
214
|
|
196
215
|
ex3 = api_expects(:content_uploads, :destroy, "Delete the upload")
|
197
216
|
.with_params(:id => upload_id, :repository_id => repo_id)
|
@@ -212,10 +231,9 @@ describe 'upload repository' do
|
|
212
231
|
.with_params(:repository_id => repo_id, :size => file.size)
|
213
232
|
|
214
233
|
ex.returns(upload_response)
|
215
|
-
|
216
234
|
# rubocop:disable LineLength
|
217
235
|
ex2 = api_expects(:repositories, :import_uploads, 'Take in an upload')
|
218
|
-
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true,
|
236
|
+
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true, :async => true,
|
219
237
|
:uploads => [{
|
220
238
|
:id => '1234',
|
221
239
|
:name => 'test.rpm',
|
@@ -225,8 +243,9 @@ describe 'upload repository' do
|
|
225
243
|
}]
|
226
244
|
)
|
227
245
|
# rubocop:enable LineLength
|
228
|
-
|
229
|
-
|
246
|
+
ex2.returns(import_uploads_response)
|
247
|
+
expect_foreman_task(task_id)
|
248
|
+
expect_foreman_task(task_id)
|
230
249
|
|
231
250
|
ex3 = api_expects(:content_uploads, :destroy, "Delete the upload")
|
232
251
|
.with_params(:id => upload_id, :repository_id => repo_id)
|
@@ -253,7 +272,7 @@ describe 'upload repository' do
|
|
253
272
|
|
254
273
|
# rubocop:disable LineLength
|
255
274
|
ex = api_expects(:repositories, :import_uploads, 'Take in an upload')
|
256
|
-
.with_params(:id => repo_id, :sync_capsule => false, :publish_repository => false,
|
275
|
+
.with_params(:id => repo_id, :sync_capsule => false, :publish_repository => false, :async => true,
|
257
276
|
:uploads => [{
|
258
277
|
:id => '1234',
|
259
278
|
:name => 'test1.rpm',
|
@@ -264,7 +283,9 @@ describe 'upload repository' do
|
|
264
283
|
)
|
265
284
|
# rubocop:enable LineLength
|
266
285
|
|
267
|
-
ex.returns(
|
286
|
+
ex.returns(import_uploads_response)
|
287
|
+
expect_foreman_task(task_id)
|
288
|
+
expect_foreman_task(task_id)
|
268
289
|
|
269
290
|
ex = api_expects(:content_uploads, :destroy, "Delete the upload")
|
270
291
|
.with_params(:id => upload_id, :repository_id => repo_id)
|
@@ -280,7 +301,7 @@ describe 'upload repository' do
|
|
280
301
|
|
281
302
|
# rubocop:disable LineLength
|
282
303
|
ex = api_expects(:repositories, :import_uploads, 'Take in an upload')
|
283
|
-
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true,
|
304
|
+
.with_params(:id => repo_id, :sync_capsule => true, :publish_repository => true, :async => true,
|
284
305
|
:uploads => [{
|
285
306
|
:id => '1234',
|
286
307
|
:name => 'test2.rpm',
|
@@ -291,7 +312,9 @@ describe 'upload repository' do
|
|
291
312
|
)
|
292
313
|
# rubocop:enable LineLength
|
293
314
|
|
294
|
-
ex.returns(
|
315
|
+
ex.returns(import_uploads_response)
|
316
|
+
expect_foreman_task(task_id)
|
317
|
+
expect_foreman_task(task_id)
|
295
318
|
|
296
319
|
ex = api_expects(:content_uploads, :destroy, "Delete the upload")
|
297
320
|
.with_params(:id => upload_id, :repository_id => repo_id)
|
data/test/test_helper.rb
CHANGED
@@ -17,7 +17,7 @@ require 'minitest/spec'
|
|
17
17
|
require 'mocha/minitest'
|
18
18
|
require 'hammer_cli'
|
19
19
|
|
20
|
-
KATELLO_VERSION = Gem::Version.new(ENV['TEST_API_VERSION'] || '4.
|
20
|
+
KATELLO_VERSION = Gem::Version.new(ENV['TEST_API_VERSION'] || '4.4')
|
21
21
|
|
22
22
|
if HammerCLI.context[:api_connection]
|
23
23
|
HammerCLI.context[:api_connection].create('foreman') do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hammer_cli_katello
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Price
|
@@ -35,7 +35,7 @@ authors:
|
|
35
35
|
autorequire:
|
36
36
|
bindir: bin
|
37
37
|
cert_chain: []
|
38
|
-
date:
|
38
|
+
date: 2022-03-03 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: hammer_cli_foreman
|
@@ -220,6 +220,7 @@ files:
|
|
220
220
|
- lib/hammer_cli_katello/content_export_incremental.rb
|
221
221
|
- lib/hammer_cli_katello/content_import.rb
|
222
222
|
- lib/hammer_cli_katello/content_override.rb
|
223
|
+
- lib/hammer_cli_katello/content_units.rb
|
223
224
|
- lib/hammer_cli_katello/content_view.rb
|
224
225
|
- lib/hammer_cli_katello/content_view_component.rb
|
225
226
|
- lib/hammer_cli_katello/content_view_name_resolvable.rb
|
@@ -262,7 +263,6 @@ files:
|
|
262
263
|
- lib/hammer_cli_katello/option_sources/lifecycle_environment_params.rb
|
263
264
|
- lib/hammer_cli_katello/organization.rb
|
264
265
|
- lib/hammer_cli_katello/organization_options.rb
|
265
|
-
- lib/hammer_cli_katello/ostree_branch.rb
|
266
266
|
- lib/hammer_cli_katello/output/fields.rb
|
267
267
|
- lib/hammer_cli_katello/output/formatters.rb
|
268
268
|
- lib/hammer_cli_katello/package.rb
|
@@ -318,6 +318,7 @@ files:
|
|
318
318
|
- test/data/4.0/foreman_api.json
|
319
319
|
- test/data/4.1/foreman_api.json
|
320
320
|
- test/data/4.3/foreman_api.json
|
321
|
+
- test/data/4.4/foreman_api.json
|
321
322
|
- test/data/Readme.md
|
322
323
|
- test/functional/activation_key/add_host_collection_test.rb
|
323
324
|
- test/functional/activation_key/content_override_test.rb
|
@@ -358,6 +359,8 @@ files:
|
|
358
359
|
- test/functional/content_import/list_test.rb
|
359
360
|
- test/functional/content_import/metadata.json
|
360
361
|
- test/functional/content_import/version_test.rb
|
362
|
+
- test/functional/content_units/info_test.rb
|
363
|
+
- test/functional/content_units/list_test.rb
|
361
364
|
- test/functional/content_view/add_content_view_version_test.rb
|
362
365
|
- test/functional/content_view/add_repository_test.rb
|
363
366
|
- test/functional/content_view/component/add_test.rb
|
@@ -460,6 +463,7 @@ files:
|
|
460
463
|
- test/functional/repository/delete_test.rb
|
461
464
|
- test/functional/repository/info_test.rb
|
462
465
|
- test/functional/repository/list_test.rb
|
466
|
+
- test/functional/repository/reclaim_space_test.rb
|
463
467
|
- test/functional/repository/remove_content_test.rb
|
464
468
|
- test/functional/repository/repository_helpers.rb
|
465
469
|
- test/functional/repository/synchronize_test.rb
|
@@ -535,6 +539,7 @@ test_files:
|
|
535
539
|
- test/data/4.0/foreman_api.json
|
536
540
|
- test/data/4.1/foreman_api.json
|
537
541
|
- test/data/4.3/foreman_api.json
|
542
|
+
- test/data/4.4/foreman_api.json
|
538
543
|
- test/data/Readme.md
|
539
544
|
- test/functional/activation_key/add_host_collection_test.rb
|
540
545
|
- test/functional/activation_key/content_override_test.rb
|
@@ -575,6 +580,8 @@ test_files:
|
|
575
580
|
- test/functional/content_import/list_test.rb
|
576
581
|
- test/functional/content_import/metadata.json
|
577
582
|
- test/functional/content_import/version_test.rb
|
583
|
+
- test/functional/content_units/info_test.rb
|
584
|
+
- test/functional/content_units/list_test.rb
|
578
585
|
- test/functional/content_view/add_content_view_version_test.rb
|
579
586
|
- test/functional/content_view/add_repository_test.rb
|
580
587
|
- test/functional/content_view/component/add_test.rb
|
@@ -677,6 +684,7 @@ test_files:
|
|
677
684
|
- test/functional/repository/delete_test.rb
|
678
685
|
- test/functional/repository/info_test.rb
|
679
686
|
- test/functional/repository/list_test.rb
|
687
|
+
- test/functional/repository/reclaim_space_test.rb
|
680
688
|
- test/functional/repository/remove_content_test.rb
|
681
689
|
- test/functional/repository/repository_helpers.rb
|
682
690
|
- test/functional/repository/synchronize_test.rb
|
@@ -1,34 +0,0 @@
|
|
1
|
-
module HammerCLIKatello
|
2
|
-
class OstreeBranchCommand < HammerCLIKatello::Command
|
3
|
-
resource :ostree_branches
|
4
|
-
|
5
|
-
class ListCommand < HammerCLIKatello::ListCommand
|
6
|
-
extend RepositoryScopedToProduct
|
7
|
-
|
8
|
-
validate_repo_name_requires_product_options(:option_repository_name)
|
9
|
-
|
10
|
-
output do
|
11
|
-
field :id, _("Id")
|
12
|
-
field :name, _("Name")
|
13
|
-
field :version, _("version")
|
14
|
-
end
|
15
|
-
|
16
|
-
build_options do |o|
|
17
|
-
o.expand.including(:products, :organizations, :content_views)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
class InfoCommand < HammerCLIKatello::InfoCommand
|
22
|
-
output do
|
23
|
-
field :id, _("Id")
|
24
|
-
field :name, _("Name")
|
25
|
-
field :version, _("Version")
|
26
|
-
field :commit, _("Commit")
|
27
|
-
end
|
28
|
-
|
29
|
-
build_options
|
30
|
-
end
|
31
|
-
|
32
|
-
autoload_subcommands
|
33
|
-
end
|
34
|
-
end
|