hammer_cli_katello 1.0.1 → 1.2.0
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.rb +5 -1
- data/lib/hammer_cli_katello/content_import.rb +16 -1
- data/lib/hammer_cli_katello/content_view_version.rb +0 -273
- data/lib/hammer_cli_katello/docker.rb +13 -0
- data/lib/hammer_cli_katello/docker_manifest.rb +53 -0
- data/lib/hammer_cli_katello/docker_tag.rb +40 -0
- data/lib/hammer_cli_katello/host_collection.rb +6 -0
- data/lib/hammer_cli_katello/host_collection_erratum.rb +10 -0
- data/lib/hammer_cli_katello/host_collection_package.rb +30 -0
- data/lib/hammer_cli_katello/host_collection_package_group.rb +30 -0
- data/lib/hammer_cli_katello/host_errata.rb +9 -1
- data/lib/hammer_cli_katello/host_package.rb +32 -0
- data/lib/hammer_cli_katello/host_package_group.rb +16 -0
- data/lib/hammer_cli_katello/id_resolver.rb +3 -1
- data/lib/hammer_cli_katello/organization.rb +10 -0
- data/lib/hammer_cli_katello/ping.rb +13 -5
- data/lib/hammer_cli_katello/repository.rb +21 -27
- data/lib/hammer_cli_katello/simple_content_access.rb +2 -0
- data/lib/hammer_cli_katello/version.rb +1 -1
- data/locale/hammer-cli-katello.pot +0 -25
- data/test/data/4.0/foreman_api.json +1 -1
- data/test/data/4.1/foreman_api.json +1 -0
- data/test/functional/activation_key/subscriptions_test.rb +5 -2
- data/test/functional/content_export/complete/version_test.rb +35 -0
- data/test/functional/content_import/list_test.rb +65 -0
- data/test/functional/content_import/version_test.rb +6 -6
- data/test/functional/host_collection/create_test.rb +11 -0
- data/test/functional/organization/info_test.rb +22 -0
- data/test/functional/ping_test.rb +52 -13
- data/test/test_helper.rb +1 -1
- metadata +15 -45
- data/lib/hammer_cli_katello/cv_import_export_helper.rb +0 -187
- data/test/functional/content_view/version/cv_import_export_helper_test.rb +0 -20
- data/test/functional/content_view/version/default_export_test.rb +0 -40
- data/test/functional/content_view/version/export_test.rb +0 -148
- data/test/functional/content_view/version/import_test.rb +0 -346
- data/test/functional/repository/export_test.rb +0 -121
@@ -1,121 +0,0 @@
|
|
1
|
-
require_relative '../test_helper'
|
2
|
-
require_relative '../organization/organization_helpers'
|
3
|
-
require 'hammer_cli_katello/repository'
|
4
|
-
|
5
|
-
module HammerCLIKatello
|
6
|
-
describe Repository::ExportCommand do
|
7
|
-
include ForemanTaskHelpers
|
8
|
-
include OrganizationHelpers
|
9
|
-
|
10
|
-
it 'allows minimal options' do
|
11
|
-
ex = api_expects(:repositories, :export) do |p|
|
12
|
-
p['id'] == 1
|
13
|
-
end
|
14
|
-
ex.returns(id: '2')
|
15
|
-
|
16
|
-
expect_foreman_task('2')
|
17
|
-
|
18
|
-
run_cmd(%w(repository export --id 1))
|
19
|
-
end
|
20
|
-
|
21
|
-
describe 'resolves repository ID' do
|
22
|
-
it 'by requiring product' do
|
23
|
-
api_expects_no_call
|
24
|
-
result = run_cmd(%w(repository export --name repo1))
|
25
|
-
assert(result.err[/--product, --product-id is required/], 'Incorrect error message')
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'by product ID' do
|
29
|
-
ex = api_expects(:repositories, :index) do |p|
|
30
|
-
p['name'] == 'repo1' && p['product_id'] == 3
|
31
|
-
end
|
32
|
-
ex.returns(index_response([{'id' => 1}]))
|
33
|
-
|
34
|
-
ex = api_expects(:repositories, :export) do |p|
|
35
|
-
p['id'] == 1
|
36
|
-
end
|
37
|
-
ex.returns(id: '2')
|
38
|
-
|
39
|
-
expect_foreman_task('2')
|
40
|
-
|
41
|
-
run_cmd(%w(repository export --name repo1 --product-id 3))
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe 'resolves product ID' do
|
46
|
-
it 'by requiring organization options' do
|
47
|
-
api_expects_no_call
|
48
|
-
result = run_cmd(%w(repository export --name repo1 --product prod1))
|
49
|
-
assert(result.err[/--organization-id, --organization, --organization-label is required/],
|
50
|
-
"Organization option requirements must be validated")
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'by organization ID' do
|
54
|
-
ex = api_expects(:products, :index) do |p|
|
55
|
-
p['name'] == 'prod3' && p['organization_id'] == '5'
|
56
|
-
end
|
57
|
-
ex.returns(index_response([{'id' => 3}]))
|
58
|
-
|
59
|
-
ex = api_expects(:repositories, :index) do |p|
|
60
|
-
p['name'] == 'repo1' && p['product_id'] == 3
|
61
|
-
end
|
62
|
-
ex.returns(index_response([{'id' => 1}]))
|
63
|
-
|
64
|
-
ex = api_expects(:repositories, :export) do |p|
|
65
|
-
p['id'] == 1
|
66
|
-
end
|
67
|
-
ex.returns(id: '2')
|
68
|
-
|
69
|
-
expect_foreman_task('2')
|
70
|
-
|
71
|
-
run_cmd(%w(repository export --name repo1 --product prod3 --organization-id 5))
|
72
|
-
end
|
73
|
-
|
74
|
-
it 'by organization name' do
|
75
|
-
expect_organization_search('org5', 5)
|
76
|
-
|
77
|
-
ex = api_expects(:products, :index) do |p|
|
78
|
-
p['name'] == 'prod3' && p['organization_id'] == 5
|
79
|
-
end
|
80
|
-
ex.returns(index_response([{'id' => 3}]))
|
81
|
-
|
82
|
-
ex = api_expects(:repositories, :index) do |p|
|
83
|
-
p['name'] == 'repo1' && p['product_id'] == 3
|
84
|
-
end
|
85
|
-
ex.returns(index_response([{'id' => 1}]))
|
86
|
-
|
87
|
-
ex = api_expects(:repositories, :export) do |p|
|
88
|
-
p['id'] == 1
|
89
|
-
end
|
90
|
-
ex.returns(id: '2')
|
91
|
-
|
92
|
-
expect_foreman_task('2')
|
93
|
-
|
94
|
-
run_cmd(%w(repository export --name repo1 --product prod3 --organization org5))
|
95
|
-
end
|
96
|
-
|
97
|
-
it 'by organization label' do
|
98
|
-
expect_organization_search('org5', 5, field: 'label')
|
99
|
-
|
100
|
-
ex = api_expects(:products, :index) do |p|
|
101
|
-
p['name'] == 'prod3' && p['organization_id'] == 5
|
102
|
-
end
|
103
|
-
ex.returns(index_response([{'id' => 3}]))
|
104
|
-
|
105
|
-
ex = api_expects(:repositories, :index) do |p|
|
106
|
-
p['name'] == 'repo1' && p['product_id'] == 3
|
107
|
-
end
|
108
|
-
ex.returns(index_response([{'id' => 1}]))
|
109
|
-
|
110
|
-
ex = api_expects(:repositories, :export) do |p|
|
111
|
-
p['id'] == 1
|
112
|
-
end
|
113
|
-
ex.returns(id: '2')
|
114
|
-
|
115
|
-
expect_foreman_task('2')
|
116
|
-
|
117
|
-
run_cmd(%w(repository export --name repo1 --product prod3 --organization-label org5))
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|