hammer_cli_katello 0.11.5.1 → 0.12.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 -0
- data/lib/hammer_cli_katello/content_view.rb +22 -8
- data/lib/hammer_cli_katello/file.rb +72 -0
- data/lib/hammer_cli_katello/foreman_search_options_creators.rb +34 -34
- data/lib/hammer_cli_katello/host_collection.rb +18 -0
- data/lib/hammer_cli_katello/host_content_source_options.rb +25 -0
- data/lib/hammer_cli_katello/host_extensions.rb +34 -3
- data/lib/hammer_cli_katello/host_kickstart_repository_options.rb +49 -0
- data/lib/hammer_cli_katello/hostgroup_extensions.rb +25 -3
- data/lib/hammer_cli_katello/id_resolver.rb +15 -9
- data/lib/hammer_cli_katello/repository.rb +47 -1
- data/lib/hammer_cli_katello/search_options_creators.rb +23 -16
- data/lib/hammer_cli_katello/sync_plan.rb +5 -0
- data/lib/hammer_cli_katello/version.rb +1 -1
- data/test/functional/capsule/content/add_lifecycle_environment_test.rb +3 -3
- data/test/functional/capsule/content/cancel_synchronization_test.rb +3 -3
- data/test/functional/capsule/content/info_test.rb +3 -3
- data/test/functional/capsule/content/lifecycle_environments_test.rb +1 -1
- data/test/functional/capsule/content/remove_lifecycle_environment_test.rb +3 -3
- data/test/functional/capsule/content/synchronization_status_test.rb +3 -3
- data/test/functional/content_view/content_view_helpers.rb +4 -0
- data/test/functional/content_view/create_test.rb +2 -2
- data/test/functional/content_view/filter/delete_test.rb +1 -4
- data/test/functional/content_view/filter/info_test.rb +1 -4
- data/test/functional/content_view/filter/list_test.rb +1 -1
- data/test/functional/content_view/filter/update_test.rb +1 -4
- data/test/functional/erratum/list_test.rb +1 -1
- data/test/functional/file/file_helpers.rb +13 -0
- data/test/functional/file/info_test.rb +162 -0
- data/test/functional/file/list_test.rb +112 -0
- data/test/functional/filter_rule/info_test.rb +1 -1
- data/test/functional/filter_rule/update_test.rb +1 -1
- data/test/functional/host/extensions/create_test.rb +95 -0
- data/test/functional/host/extensions/data/host.json +4 -0
- data/test/functional/host/extensions/info_test.rb +5 -3
- data/test/functional/host/extensions/update_test.rb +69 -0
- data/test/functional/host_collection/add_host_test.rb +36 -3
- data/test/functional/host_collection/copy_test.rb +4 -4
- data/test/functional/host_collection/delete_test.rb +3 -3
- data/test/functional/host_collection/hosts_test.rb +1 -2
- data/test/functional/host_collection/info_test.rb +3 -3
- data/test/functional/host_collection/remove_host_test.rb +36 -3
- data/test/functional/host_collection/update_test.rb +3 -3
- data/test/functional/hostgroup/create_test.rb +46 -1
- data/test/functional/hostgroup/data/hostgroup.json +48 -46
- data/test/functional/hostgroup/info_test.rb +5 -3
- data/test/functional/hostgroup/update_test.rb +48 -1
- data/test/functional/lifecycle_environment/create_test.rb +1 -1
- data/test/functional/package/list_test.rb +1 -1
- data/test/functional/product/product_helpers.rb +6 -4
- data/test/functional/repository/upload_test.rb +32 -14
- data/test/functional/sync_plan/info_test.rb +37 -0
- data/test/functional/sync_plan/list_test.rb +31 -0
- metadata +21 -18
@@ -7,6 +7,9 @@ module HammerCLIKatello
|
|
7
7
|
:capsule => [s_name(_("Capsule name to search by"))],
|
8
8
|
:content_view => [s_name(_("Content view name to search by"))],
|
9
9
|
:content_view_component => [],
|
10
|
+
:file_unit => [s_name(_("File name to search by")),
|
11
|
+
s("content_view_version_id", _("Content View Version ID")),
|
12
|
+
s("repository_id", _("Repository ID"))],
|
10
13
|
:gpg => [s_name(_("Gpg key name to search by"))],
|
11
14
|
:host_collection => [s_name(_("Host collection name to search by"))],
|
12
15
|
:lifecycle_environment => [s_name(_("Lifecycle environment name to search by"))],
|
@@ -46,6 +49,14 @@ module HammerCLIKatello
|
|
46
49
|
alias_method :create_search_options_without_katello_api, :create_search_options
|
47
50
|
alias_method :create_search_options, :create_search_options_with_katello_api
|
48
51
|
|
52
|
+
def file_unit_id(options)
|
53
|
+
if options['option_content_view_version_version']
|
54
|
+
options['option_content_view_version_id'] ||=
|
55
|
+
content_view_version_id(scoped_options('content_view_version', options))
|
56
|
+
end
|
57
|
+
get_id(:file_units, options)
|
58
|
+
end
|
59
|
+
|
49
60
|
def capsule_content_id(options)
|
50
61
|
smart_proxy_id(options)
|
51
62
|
end
|
@@ -105,11 +116,12 @@ module HammerCLIKatello
|
|
105
116
|
|
106
117
|
def content_view_version_ids(options)
|
107
118
|
key_content_view_id = HammerCLI.option_accessor_name("content_view_id")
|
119
|
+
options[key_content_view_id] ||= search_and_rescue(:content_view_id, "content_view", options)
|
108
120
|
if options['option_versions'] && options[key_content_view_id]
|
109
|
-
options[key_content_view_id] ||= search_and_rescue(:content_view_id,
|
110
|
-
"content_view", options)
|
111
121
|
id_strings = options['option_versions'].map do |version|
|
112
|
-
|
122
|
+
cvv_options = {'option_version' => version}
|
123
|
+
cvv_options['option_id'] = nil if options['option_id'] # hide irrelevant id
|
124
|
+
content_view_version_id(options.merge(cvv_options))
|
113
125
|
end
|
114
126
|
id_strings.join(',')
|
115
127
|
end
|
@@ -117,17 +129,11 @@ module HammerCLIKatello
|
|
117
129
|
|
118
130
|
def content_view_version_id(options)
|
119
131
|
key_id = HammerCLI.option_accessor_name("id")
|
120
|
-
key_environment_id = HammerCLI.option_accessor_name("environment_id")
|
121
132
|
key_content_view_id = HammerCLI.option_accessor_name("content_view_id")
|
122
133
|
from_environment_id = HammerCLI.option_accessor_name("from_environment_id")
|
123
134
|
|
124
135
|
return options[key_id] if options[key_id]
|
125
136
|
|
126
|
-
if options[key_environment_id]
|
127
|
-
options[key_environment_id] ||= search_and_rescue(
|
128
|
-
:lifecycle_environment_id, "environment", options)
|
129
|
-
end
|
130
|
-
|
131
137
|
options[key_content_view_id] ||= search_and_rescue(:content_view_id, "content_view", options)
|
132
138
|
|
133
139
|
results = find_resources(:content_view_versions, options)
|
@@ -16,6 +16,7 @@ module HammerCLIKatello
|
|
16
16
|
build_options
|
17
17
|
end
|
18
18
|
|
19
|
+
# rubocop:disable ClassLength
|
19
20
|
class InfoCommand < HammerCLIKatello::InfoCommand
|
20
21
|
include RepositoryScopedToProduct
|
21
22
|
|
@@ -35,6 +36,10 @@ module HammerCLIKatello
|
|
35
36
|
field :full_path, _("Published At")
|
36
37
|
field :relative_path, _("Relative Path")
|
37
38
|
field :download_policy, _("Download Policy"), Fields::Field, :hide_blank => true
|
39
|
+
field :ostree_upstream_sync_policy, _("OSTree Upstream Sync Policy"),
|
40
|
+
Fields::Field, :hide_blank => true
|
41
|
+
field :_ostree_upstream_sync_depth, _("OSTree Upstream Sync Depth"),
|
42
|
+
Fields::Field, :hide_blank => true
|
38
43
|
field :docker_upstream_name, _("Upstream Repository Name"),
|
39
44
|
Fields::Field, :hide_blank => true
|
40
45
|
field :container_repository_name, _("Container Repository Name"),
|
@@ -64,12 +69,16 @@ module HammerCLIKatello
|
|
64
69
|
|
65
70
|
label _("Content Counts") do
|
66
71
|
field :package_total, _("Packages"), Fields::Field, :hide_blank => true
|
72
|
+
field :srpm_total, _("Source RPMS"), Fields::Field, :hide_blank => true
|
67
73
|
field :package_group_total, _("Package Groups"), Fields::Field, :hide_blank => true
|
68
74
|
field :errata_total, _("Errata"), Fields::Field, :hide_blank => true
|
69
75
|
field :puppet_total, _("Puppet Modules"), Fields::Field, :hide_blank => true
|
76
|
+
field :docker_manifest_list_total, _("Docker Manifest Lists"),
|
77
|
+
Fields::Field, :hide_blank => true
|
70
78
|
field :docker_manifest_total, _("Docker Manifests"), Fields::Field, :hide_blank => true
|
71
79
|
field :docker_tag_total, _("Docker Tags"), Fields::Field, :hide_blank => true
|
72
80
|
field :ostree_branch_total, _("OSTree Branches"), Fields::Field, :hide_blank => true
|
81
|
+
field :file_total, _("Files"), Fields::Field, :hide_blank => true
|
73
82
|
end
|
74
83
|
end
|
75
84
|
|
@@ -104,15 +113,27 @@ module HammerCLIKatello
|
|
104
113
|
case data["content_type"]
|
105
114
|
when "yum"
|
106
115
|
data["package_total"] = content_counts["rpm"]
|
116
|
+
data["srpm_total"] = content_counts["srpm"]
|
107
117
|
data["package_group_total"] = content_counts["package_group"]
|
108
118
|
data["errata_total"] = content_counts["erratum"]
|
109
119
|
when "docker"
|
120
|
+
data["docker_manifest_list_total"] = content_counts["docker_manifest_list"]
|
110
121
|
data["docker_manifest_total"] = content_counts["docker_manifest"]
|
111
122
|
data["docker_tag_total"] = content_counts["docker_tag"]
|
112
123
|
when "puppet"
|
113
124
|
data["puppet_total"] = content_counts["puppet_module"]
|
114
125
|
when "ostree"
|
115
|
-
data
|
126
|
+
setup_ostree(data)
|
127
|
+
when "file"
|
128
|
+
data["file_total"] = content_counts["file"]
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def setup_ostree(data)
|
133
|
+
content_counts = data["content_counts"]
|
134
|
+
data["ostree_branch_total"] = content_counts["ostree_branch"]
|
135
|
+
if data["ostree_upstream_sync_policy"] == "custom"
|
136
|
+
data["_ostree_upstream_sync_depth"] = data["ostree_upstream_sync_depth"]
|
116
137
|
end
|
117
138
|
end
|
118
139
|
|
@@ -129,6 +150,7 @@ module HammerCLIKatello
|
|
129
150
|
o.expand.including(:products, :organizations)
|
130
151
|
end
|
131
152
|
end
|
153
|
+
# rubocop:enable ClassLength
|
132
154
|
|
133
155
|
class SyncCommand < HammerCLIKatello::SingleResourceCommand
|
134
156
|
include HammerCLIForemanTasks::Async
|
@@ -192,6 +214,7 @@ module HammerCLIKatello
|
|
192
214
|
end
|
193
215
|
end
|
194
216
|
|
217
|
+
# rubocop:disable ClassLength
|
195
218
|
class UploadContentCommand < HammerCLIKatello::InfoCommand
|
196
219
|
include RepositoryScopedToProduct
|
197
220
|
include HammerCLIForemanTasks::Helper
|
@@ -239,6 +262,28 @@ module HammerCLIKatello
|
|
239
262
|
::HammerCLIForeman.foreman_resource(:content_uploads)
|
240
263
|
end
|
241
264
|
|
265
|
+
validate_options do
|
266
|
+
organization_options = [:option_organization_id, :option_organization_name,
|
267
|
+
:option_organization_label]
|
268
|
+
product_options = [:option_product_id, :option_product_name]
|
269
|
+
repository_options = [:option_id, :option_name]
|
270
|
+
|
271
|
+
any(*repository_options).required
|
272
|
+
|
273
|
+
if option(:option_name).exist?
|
274
|
+
any(*product_options).required
|
275
|
+
end
|
276
|
+
|
277
|
+
if option(:option_id).exist?
|
278
|
+
any(*product_options).rejected(
|
279
|
+
msg: _("Cannot specify both product options and repository ID."))
|
280
|
+
end
|
281
|
+
|
282
|
+
if option(:option_product_name).exist?
|
283
|
+
any(*organization_options).required
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
242
287
|
success_message _("Repository content uploaded")
|
243
288
|
failure_message _("Could not upload the content")
|
244
289
|
|
@@ -315,6 +360,7 @@ module HammerCLIKatello
|
|
315
360
|
resource.call(:import_uploads, params)
|
316
361
|
end
|
317
362
|
end
|
363
|
+
# rubocop:enable ClassLength
|
318
364
|
|
319
365
|
class RemoveContentCommand < HammerCLIKatello::SingleResourceCommand
|
320
366
|
include RepositoryScopedToProduct
|
@@ -4,11 +4,17 @@ module HammerCLIKatello
|
|
4
4
|
module SearchOptionsCreators
|
5
5
|
include HammerCLIKatello::ForemanSearchOptionsCreators
|
6
6
|
|
7
|
-
def
|
8
|
-
create_search_options_without_katello_api(options, api.resource(:
|
7
|
+
def create_file_units_search_options(options, mode = nil)
|
8
|
+
create_search_options_without_katello_api(options, api.resource(:file_units), mode)
|
9
|
+
.merge(create_search_options(options, api.resource(:file_units), mode))
|
9
10
|
end
|
10
11
|
|
11
|
-
def
|
12
|
+
def create_content_view_filter_rules_search_options(options, mode = nil)
|
13
|
+
create_search_options_without_katello_api(
|
14
|
+
options, api.resource(:content_view_filter_rules), mode)
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_repositories_search_options(options, _mode = nil)
|
12
18
|
name = options[HammerCLI.option_accessor_name("name")]
|
13
19
|
names = options[HammerCLI.option_accessor_name("names")]
|
14
20
|
product_id = options[HammerCLI.option_accessor_name("product_id")]
|
@@ -20,10 +26,10 @@ module HammerCLIKatello
|
|
20
26
|
search_options
|
21
27
|
end
|
22
28
|
|
23
|
-
def create_content_views_search_options(options)
|
29
|
+
def create_content_views_search_options(options, _mode = nil)
|
24
30
|
name = options[HammerCLI.option_accessor_name('name')]
|
25
31
|
organization_id = options[HammerCLI.option_accessor_name("organization_id")] ||
|
26
|
-
organization_id(scoped_options('organization', options))
|
32
|
+
organization_id(scoped_options('organization', options, :single))
|
27
33
|
|
28
34
|
search_options = {}
|
29
35
|
search_options['name'] = name if name
|
@@ -33,20 +39,21 @@ module HammerCLIKatello
|
|
33
39
|
search_options
|
34
40
|
end
|
35
41
|
|
36
|
-
def create_lifecycle_environments_search_options(options)
|
37
|
-
name = options[HammerCLI.option_accessor_name("name")]
|
38
|
-
organization_id = options[HammerCLI.option_accessor_name("organization_id")] ||
|
39
|
-
organization_id(scoped_options('organization', options))
|
40
|
-
|
42
|
+
def create_lifecycle_environments_search_options(options, mode = nil)
|
41
43
|
search_options = {}
|
42
|
-
|
44
|
+
if mode != :multi
|
45
|
+
name = options[HammerCLI.option_accessor_name("name")]
|
46
|
+
search_options['name'] = name if name
|
47
|
+
end
|
48
|
+
organization_id = organization_id(scoped_options('organization', options, :single))
|
49
|
+
|
43
50
|
if options['option_lifecycle_environment_names'] || name
|
44
51
|
search_options['organization_id'] = organization_id
|
45
52
|
end
|
46
53
|
search_options
|
47
54
|
end
|
48
55
|
|
49
|
-
def create_content_view_versions_search_options(options)
|
56
|
+
def create_content_view_versions_search_options(options, _mode = nil)
|
50
57
|
environment_id = options[HammerCLI.option_accessor_name("environment_id")]
|
51
58
|
content_view_id = options[HammerCLI.option_accessor_name("content_view_id")]
|
52
59
|
version = options[HammerCLI.option_accessor_name("version")]
|
@@ -59,18 +66,18 @@ module HammerCLIKatello
|
|
59
66
|
search_options
|
60
67
|
end
|
61
68
|
|
62
|
-
def create_host_collections_search_options(options)
|
69
|
+
def create_host_collections_search_options(options, mode = nil)
|
63
70
|
options[HammerCLI.option_accessor_name("organization_id")] ||= organization_id(
|
64
|
-
scoped_options("organization", options)
|
71
|
+
scoped_options("organization", options, :single)
|
65
72
|
)
|
66
73
|
search_options = create_search_options_with_katello_api(
|
67
|
-
options, api.resource(:host_collections)
|
74
|
+
options, api.resource(:host_collections), mode
|
68
75
|
) || {}
|
69
76
|
search_options['organization_id'] ||= options['option_organization_id']
|
70
77
|
search_options
|
71
78
|
end
|
72
79
|
|
73
|
-
def create_search_options_with_katello_api(options, resource)
|
80
|
+
def create_search_options_with_katello_api(options, resource, _mode = nil)
|
74
81
|
search_options = {}
|
75
82
|
searchables(resource).each do |s|
|
76
83
|
value = options[HammerCLI.option_accessor_name(s.name.to_s)]
|
@@ -19,6 +19,11 @@ module HammerCLIKatello
|
|
19
19
|
field :description, _("Description")
|
20
20
|
field :created_at, _("Created at"), Fields::Date
|
21
21
|
field :updated_at, _("Updated at"), Fields::Date
|
22
|
+
|
23
|
+
collection :products, _("Products") do
|
24
|
+
field :id, _("ID")
|
25
|
+
field :name, _("Name")
|
26
|
+
end
|
22
27
|
end
|
23
28
|
|
24
29
|
build_options
|
@@ -13,14 +13,14 @@ module HammerCLIKatello
|
|
13
13
|
include OrganizationHelpers
|
14
14
|
|
15
15
|
it 'allows minimal options' do
|
16
|
-
expect_lifecycle_environment_add('id' =>
|
16
|
+
expect_lifecycle_environment_add('id' => 1, 'environment_id' => 2)
|
17
17
|
|
18
18
|
run_cmd(%w(capsule content add-lifecycle-environment --id 1 --environment-id 2))
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'resolves environment ID from name' do
|
22
22
|
expect_lifecycle_environment_search('3', 'env2', 2)
|
23
|
-
expect_lifecycle_environment_add('id' =>
|
23
|
+
expect_lifecycle_environment_add('id' => 1, 'environment_id' => 2)
|
24
24
|
|
25
25
|
run_cmd(%w(capsule content add-lifecycle-environment --id 1 --environment env2
|
26
26
|
--organization-id 3))
|
@@ -29,7 +29,7 @@ module HammerCLIKatello
|
|
29
29
|
it 'resolves organization ID from name' do
|
30
30
|
expect_organization_search('org3', 3)
|
31
31
|
expect_lifecycle_environment_search(3, 'env2', 2)
|
32
|
-
expect_lifecycle_environment_add('id' =>
|
32
|
+
expect_lifecycle_environment_add('id' => 1, 'environment_id' => 2)
|
33
33
|
|
34
34
|
run_cmd(%w(capsule content add-lifecycle-environment --id 1 --environment env2
|
35
35
|
--organization org3))
|
@@ -15,7 +15,7 @@ describe 'capsule content cancel-synchronization' do
|
|
15
15
|
params = ['--id=3']
|
16
16
|
|
17
17
|
ex = api_expects(:capsule_content, :cancel_sync, 'Cancel sync') do |par|
|
18
|
-
par['id'] ==
|
18
|
+
par['id'] == 3
|
19
19
|
end
|
20
20
|
ex.returns("message" => MESSAGE)
|
21
21
|
|
@@ -27,10 +27,10 @@ describe 'capsule content cancel-synchronization' do
|
|
27
27
|
params = ['--name=capsule1']
|
28
28
|
|
29
29
|
ex = api_expects(:capsule_content, :cancel_sync, 'Cancel sync') do |par|
|
30
|
-
par['id'] ==
|
30
|
+
par['id'] == 3
|
31
31
|
end
|
32
32
|
ex.returns("message" => MESSAGE)
|
33
|
-
expect_capsule_search('capsule1',
|
33
|
+
expect_capsule_search('capsule1', 3)
|
34
34
|
|
35
35
|
run_cmd(@cmd + params)
|
36
36
|
end
|
@@ -16,7 +16,7 @@ describe 'capsule content info' do
|
|
16
16
|
]
|
17
17
|
|
18
18
|
ex = api_expects(:capsule_content, :sync_status, 'Get sync info') do |par|
|
19
|
-
par['id'] ==
|
19
|
+
par['id'] == 3
|
20
20
|
end
|
21
21
|
ex.returns(@sync_status)
|
22
22
|
|
@@ -48,9 +48,9 @@ describe 'capsule content info' do
|
|
48
48
|
params = ['--name=capsule1']
|
49
49
|
|
50
50
|
api_expects(:capsule_content, :sync_status, 'Get sync info') do |par|
|
51
|
-
par['id'] ==
|
51
|
+
par['id'] == 3
|
52
52
|
end
|
53
|
-
expect_capsule_search('capsule1',
|
53
|
+
expect_capsule_search('capsule1', 3)
|
54
54
|
|
55
55
|
run_cmd(@cmd + params)
|
56
56
|
end
|
@@ -9,7 +9,7 @@ module HammerCLIKatello
|
|
9
9
|
include CapsuleContentHelpers
|
10
10
|
|
11
11
|
it 'allows minimal options' do
|
12
|
-
expect_lifecycle_environments_list(params: {'id' =>
|
12
|
+
expect_lifecycle_environments_list(params: {'id' => 1}, returns: {})
|
13
13
|
|
14
14
|
run_cmd(%w(capsule content lifecycle-environments --id 1))
|
15
15
|
end
|
@@ -13,14 +13,14 @@ module HammerCLIKatello
|
|
13
13
|
include OrganizationHelpers
|
14
14
|
|
15
15
|
it 'allows minimal options' do
|
16
|
-
expect_lifecycle_environment_remove('id' =>
|
16
|
+
expect_lifecycle_environment_remove('id' => 1, 'environment_id' => 2)
|
17
17
|
|
18
18
|
run_cmd(%w(capsule content remove-lifecycle-environment --id 1 --environment-id 2))
|
19
19
|
end
|
20
20
|
|
21
21
|
it 'resolves environment ID from name' do
|
22
22
|
expect_lifecycle_environment_search('3', 'env2', 2)
|
23
|
-
expect_lifecycle_environment_remove('id' =>
|
23
|
+
expect_lifecycle_environment_remove('id' => 1, 'environment_id' => 2)
|
24
24
|
|
25
25
|
run_cmd(%w(capsule content remove-lifecycle-environment --id 1 --environment env2
|
26
26
|
--organization-id 3))
|
@@ -29,7 +29,7 @@ module HammerCLIKatello
|
|
29
29
|
it 'resolves organization ID from name' do
|
30
30
|
expect_organization_search('org3', 3)
|
31
31
|
expect_lifecycle_environment_search(3, 'env2', 2)
|
32
|
-
expect_lifecycle_environment_remove('id' =>
|
32
|
+
expect_lifecycle_environment_remove('id' => 1, 'environment_id' => 2)
|
33
33
|
|
34
34
|
run_cmd(%w(capsule content remove-lifecycle-environment --id 1 --environment env2
|
35
35
|
--organization org3))
|
@@ -14,7 +14,7 @@ describe 'capsule content synchronization_status' do
|
|
14
14
|
before do
|
15
15
|
@sync_status = load_json('./data/sync_status.json', __FILE__)
|
16
16
|
ex = api_expects(:capsule_content, :sync_status, 'Get sync info') do |par|
|
17
|
-
par['id'] ==
|
17
|
+
par['id'] == 3
|
18
18
|
end
|
19
19
|
ex.returns(@sync_status)
|
20
20
|
end
|
@@ -93,9 +93,9 @@ describe 'capsule content synchronization_status' do
|
|
93
93
|
params = ['--name=capsule1']
|
94
94
|
|
95
95
|
api_expects(:capsule_content, :sync_status, 'Get sync info') do |par|
|
96
|
-
par['id'] ==
|
96
|
+
par['id'] == 3
|
97
97
|
end
|
98
|
-
expect_capsule_search('capsule1',
|
98
|
+
expect_capsule_search('capsule1', 3)
|
99
99
|
|
100
100
|
run_cmd(@cmd + params)
|
101
101
|
end
|
@@ -11,4 +11,8 @@ module ContentViewHelpers
|
|
11
11
|
def expect_generic_content_view_search(args)
|
12
12
|
expect_generic_search(:content_views, args)
|
13
13
|
end
|
14
|
+
|
15
|
+
def expect_content_view_version_search(params, returns)
|
16
|
+
expect_generic_search(:content_view_versions, params: params, returns: returns)
|
17
|
+
end
|
14
18
|
end
|
@@ -91,7 +91,7 @@ describe 'content-view create' do
|
|
91
91
|
|
92
92
|
expected_result = usage_error_result(
|
93
93
|
@cmd,
|
94
|
-
'At least one of options --product-id, --product is required',
|
94
|
+
'At least one of options --product-id, --product is required.',
|
95
95
|
error_heading
|
96
96
|
)
|
97
97
|
|
@@ -105,7 +105,7 @@ describe 'content-view create' do
|
|
105
105
|
|
106
106
|
expected_result = usage_error_result(
|
107
107
|
@cmd,
|
108
|
-
"You can't set any of options --product-id, --product",
|
108
|
+
"You can't set any of options --product-id, --product.",
|
109
109
|
error_heading
|
110
110
|
)
|
111
111
|
|
@@ -26,7 +26,6 @@ module HammerCLIKatello
|
|
26
26
|
|
27
27
|
expect_organization_search('pkd', 1)
|
28
28
|
expect_content_view_search(1, 'darkly', 1)
|
29
|
-
expect_content_view_search(1, 'darkly', 1) # redmine #15930
|
30
29
|
|
31
30
|
ex = api_expects(:content_view_filters, :index, 'Content view filters list') do |par|
|
32
31
|
par['content_view_id'] == 1 && par['name'] == 'scanner'
|
@@ -45,7 +44,6 @@ module HammerCLIKatello
|
|
45
44
|
|
46
45
|
expect_organization_search('pkd', 1, field: 'label')
|
47
46
|
expect_content_view_search(1, 'darkly', 1)
|
48
|
-
expect_content_view_search(1, 'darkly', 1) # redmine #15930
|
49
47
|
|
50
48
|
ex = api_expects(:content_view_filters, :index, 'Content view filters list') do |par|
|
51
49
|
par['content_view_id'] == 1 && par['name'] == 'scanner'
|
@@ -63,7 +61,6 @@ module HammerCLIKatello
|
|
63
61
|
params = ['--name=scanner', '--content-view=darkly', '--organization-id=1']
|
64
62
|
|
65
63
|
expect_content_view_search('1', 'darkly', 1)
|
66
|
-
expect_content_view_search('1', 'darkly', 1) # redmine #15930
|
67
64
|
|
68
65
|
ex = api_expects(:content_view_filters, :index, 'Content view filters list') do |par|
|
69
66
|
par['content_view_id'] == 1 && par['name'] == 'scanner'
|
@@ -82,7 +79,7 @@ module HammerCLIKatello
|
|
82
79
|
expected_result = usage_error_result(
|
83
80
|
@cmd,
|
84
81
|
'At least one of options --organization-id, --organization, --organization-label ' \
|
85
|
-
|
82
|
+
'is required.',
|
86
83
|
'Could not delete the filter'
|
87
84
|
)
|
88
85
|
api_expects_no_call
|