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.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hammer_cli_katello.rb +6 -14
  3. data/lib/hammer_cli_katello/activation_key.rb +5 -5
  4. data/lib/hammer_cli_katello/capsule.rb +2 -3
  5. data/lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb +10 -7
  6. data/lib/hammer_cli_katello/command_extensions/lifecycle_environments.rb +11 -8
  7. data/lib/hammer_cli_katello/content_credential.rb +20 -19
  8. data/lib/hammer_cli_katello/content_export.rb +1 -0
  9. data/lib/hammer_cli_katello/content_export_helper.rb +23 -14
  10. data/lib/hammer_cli_katello/content_view.rb +16 -31
  11. data/lib/hammer_cli_katello/content_view_version.rb +18 -13
  12. data/lib/hammer_cli_katello/cv_import_export_helper.rb +21 -0
  13. data/lib/hammer_cli_katello/deb_package.rb +3 -3
  14. data/lib/hammer_cli_katello/erratum.rb +1 -1
  15. data/lib/hammer_cli_katello/erratum_info_command.rb +1 -1
  16. data/lib/hammer_cli_katello/file.rb +3 -3
  17. data/lib/hammer_cli_katello/filter.rb +2 -2
  18. data/lib/hammer_cli_katello/foreman_search_options_creators.rb +0 -12
  19. data/lib/hammer_cli_katello/host_collection.rb +2 -2
  20. data/lib/hammer_cli_katello/host_deb.rb +1 -1
  21. data/lib/hammer_cli_katello/host_errata.rb +1 -1
  22. data/lib/hammer_cli_katello/host_extensions.rb +5 -5
  23. data/lib/hammer_cli_katello/host_package.rb +1 -1
  24. data/lib/hammer_cli_katello/hostgroup_extensions.rb +4 -4
  25. data/lib/hammer_cli_katello/id_resolver.rb +5 -6
  26. data/lib/hammer_cli_katello/lifecycle_environment.rb +2 -2
  27. data/lib/hammer_cli_katello/module_stream.rb +8 -8
  28. data/lib/hammer_cli_katello/organization_options.rb +8 -6
  29. data/lib/hammer_cli_katello/ostree_branch.rb +2 -2
  30. data/lib/hammer_cli_katello/package.rb +5 -5
  31. data/lib/hammer_cli_katello/package_group.rb +4 -4
  32. data/lib/hammer_cli_katello/ping.rb +0 -14
  33. data/lib/hammer_cli_katello/product.rb +3 -3
  34. data/lib/hammer_cli_katello/product_content.rb +2 -2
  35. data/lib/hammer_cli_katello/repository.rb +6 -37
  36. data/lib/hammer_cli_katello/repository_set.rb +4 -4
  37. data/lib/hammer_cli_katello/simple_content_access.rb +40 -0
  38. data/lib/hammer_cli_katello/srpm.rb +2 -2
  39. data/lib/hammer_cli_katello/subscription.rb +2 -3
  40. data/lib/hammer_cli_katello/sync_plan.rb +2 -2
  41. data/lib/hammer_cli_katello/version.rb +1 -1
  42. data/test/data/3.18/foreman_api.json +1 -1
  43. data/test/data/3.19/foreman_api.json +1 -0
  44. data/test/data/4.0/foreman_api.json +1 -0
  45. data/test/functional/capsule/content/info_test.rb +1 -2
  46. data/test/functional/content_credentials/create_test.rb +32 -0
  47. data/test/functional/{repository → content_credentials}/data/test_cert.json +0 -0
  48. data/test/functional/content_credentials/list_test.rb +6 -8
  49. data/test/functional/content_export/complete/version_test.rb +35 -3
  50. data/test/functional/content_export/content_export_helpers.rb +19 -14
  51. data/test/functional/content_export/incremental/version_test.rb +35 -3
  52. data/test/functional/content_export/list_test.rb +33 -3
  53. data/test/functional/content_view/content_view_helpers.rb +3 -1
  54. data/test/functional/content_view/list_test.rb +0 -2
  55. data/test/functional/content_view/publish_test.rb +0 -21
  56. data/test/functional/content_view/version/cv_import_export_helper_test.rb +20 -0
  57. data/test/functional/content_view/version/export_test.rb +12 -0
  58. data/test/functional/content_view/version/import_test.rb +28 -0
  59. data/test/functional/content_view/version/promote_test.rb +1 -2
  60. data/test/functional/content_view/version/republish_repositories_test.rb +1 -2
  61. data/test/functional/host/errata/apply_test.rb +0 -2
  62. data/test/functional/host/errata/recalculate_test.rb +0 -2
  63. data/test/functional/lifecycle_environment/lifecycle_environment_helpers.rb +1 -1
  64. data/test/functional/ping_test.rb +0 -2
  65. data/test/functional/repository/create_test.rb +0 -30
  66. data/test/functional/repository/info_test.rb +4 -4
  67. data/test/functional/repository/list_test.rb +0 -2
  68. data/test/functional/search_helpers.rb +11 -0
  69. data/test/functional/simple_content_access/disable_test.rb +48 -0
  70. data/test/functional/simple_content_access/enable_test.rb +46 -0
  71. data/test/test_helper.rb +1 -1
  72. metadata +18 -18
  73. data/lib/hammer_cli_katello/content_view_puppet_module.rb +0 -60
  74. data/lib/hammer_cli_katello/gpg_key.rb +0 -67
  75. data/lib/hammer_cli_katello/puppet_module.rb +0 -59
  76. data/test/functional/content_view/puppet_module/add_test.rb +0 -24
  77. data/test/functional/content_view/puppet_module/remove_test.rb +0 -54
  78. data/test/functional/gpg_test.rb +0 -39
  79. data/test/functional/repository/data/test_ca.json +0 -43
  80. data/test/functional/repository/data/test_key.json +0 -43
@@ -1,24 +0,0 @@
1
- require_relative '../../test_helper'
2
- require 'hammer_cli_katello/content_view_puppet_module'
3
-
4
- module HammerCLIKatello
5
- describe ContentViewPuppetModule do
6
- it 'allows adding a puppet module' do
7
- ex = api_expects(:organizations, :index) do |p|
8
- p[:search] == "name = \"org1\""
9
- end
10
- ex.returns(index_response([{'id' => 1}]))
11
-
12
- ex = api_expects(:content_views, :index) do |p|
13
- p['name'] == 'cv' && p['organization_id'] == 1
14
- end
15
- ex.returns(index_response([{'id' => 3}]))
16
-
17
- api_expects(:content_view_puppet_modules, :create) do |p|
18
- p['content_view_id'] == 3
19
- end
20
-
21
- run_cmd(%w(content-view puppet-module add --organization org1 --content-view cv --id 1))
22
- end
23
- end
24
- end
@@ -1,54 +0,0 @@
1
- require_relative '../../test_helper'
2
- require_relative '../../content_view/content_view_helpers'
3
- require_relative '../../organization/organization_helpers'
4
- require 'hammer_cli_katello/content_view_puppet_module'
5
-
6
- module HammerCLIKatello
7
- describe ContentViewPuppetModule::DeleteCommand do
8
- include ContentViewHelpers
9
- include OrganizationHelpers
10
-
11
- def expect_module_destroy(opts)
12
- api_expects(:content_view_puppet_modules, :destroy).with_params(opts[:params])
13
- end
14
-
15
- it 'allows minimal options' do
16
- expect_module_destroy(params: {'content_view_id' => 1, 'id' => 2})
17
-
18
- run_cmd(%w(content-view puppet-module remove --content-view-id 1 --id 2))
19
- end
20
-
21
- it 'resolves puppet module ID from UUID' do
22
- expect_generic_search(:content_view_puppet_modules,
23
- params: {'uuid' => 'abcd1234', 'content_view_id' => 1},
24
- returns: {'id' => 2})
25
- expect_module_destroy(params: {'content_view_id' => 1, 'id' => 2})
26
-
27
- run_cmd(%w(content-view puppet-module remove --content-view-id 1 --uuid abcd1234))
28
- end
29
-
30
- it 'resolves content view ID from name' do
31
- expect_content_view_search('3', 'cv1', 1)
32
- expect_module_destroy(params: {'content_view_id' => 1, 'id' => 2})
33
-
34
- run_cmd(%w(content-view puppet-module remove --content-view cv1 --organization-id 3 --id 2))
35
- end
36
-
37
- it 'resolves organization ID from name' do
38
- expect_organization_search('org3', 3)
39
- expect_content_view_search(3, 'cv1', 1)
40
- expect_module_destroy(params: {'content_view_id' => 1, 'id' => 2})
41
-
42
- run_cmd(%w(content-view puppet-module remove --content-view cv1 --organization org3 --id 2))
43
- end
44
-
45
- it 'resolves organization ID from label' do
46
- expect_organization_search('org3', 3, field: 'label')
47
- expect_content_view_search(3, 'cv1', 1)
48
- expect_module_destroy(params: {'content_view_id' => 1, 'id' => 2})
49
-
50
- run_cmd(%w(content-view puppet-module remove --content-view cv1 --organization-label
51
- org3 --id 2))
52
- end
53
- end
54
- end
@@ -1,39 +0,0 @@
1
- require_relative 'test_helper'
2
- require 'hammer_cli_katello/gpg_key'
3
-
4
- module HammerCLIKatello
5
- describe GpgKeyCommand::ListCommand do
6
- it 'warns of deprecation' do
7
- result = run_cmd(%w(gpg list))
8
- assert_match(/deprecated/, result.err)
9
- end
10
- end
11
-
12
- describe GpgKeyCommand::InfoCommand do
13
- it 'warns of deprecation' do
14
- result = run_cmd(%w(gpg info))
15
- assert_match(/deprecated/, result.err)
16
- end
17
- end
18
-
19
- describe GpgKeyCommand::CreateCommand do
20
- it 'warns of deprecation' do
21
- result = run_cmd(%w(gpg create))
22
- assert_match(/deprecated/, result.err)
23
- end
24
- end
25
-
26
- describe GpgKeyCommand::UpdateCommand do
27
- it 'warns of deprecation' do
28
- result = run_cmd(%w(gpg update))
29
- assert_match(/deprecated/, result.err)
30
- end
31
- end
32
-
33
- describe GpgKeyCommand::DeleteCommand do
34
- it 'warns of deprecation' do
35
- result = run_cmd(%w(gpg delete))
36
- assert_match(/deprecated/, result.err)
37
- end
38
- end
39
- end
@@ -1,43 +0,0 @@
1
- {
2
- "name":"test_ca",
3
- "content_type":"cert",
4
- "content":"hi",
5
- "id":1,
6
- "organization_id":1,
7
- "organization":{
8
- "name":"org2",
9
- "label":"org2",
10
- "id":1
11
- },
12
- "created_at":"2020-01-28 09:30:54 -0500",
13
- "updated_at":"2020-01-28 09:30:54 -0500",
14
- "gpg_key_products":[
15
-
16
- ],
17
- "gpg_key_repos":[
18
-
19
- ],
20
- "ssl_ca_products":[
21
-
22
- ],
23
- "ssl_ca_root_repos":[
24
-
25
- ],
26
- "ssl_client_products":[
27
-
28
- ],
29
- "ssl_client_root_repos":[
30
-
31
- ],
32
- "ssl_key_products":[
33
-
34
- ],
35
- "ssl_key_root_repos":[
36
-
37
- ],
38
- "permissions":{
39
- "view_content_credenials":true,
40
- "edit_content_credenials":true,
41
- "destroy_content_credenials":true
42
- }
43
- }
@@ -1,43 +0,0 @@
1
- {
2
- "name":"test_key",
3
- "content_type":"cert",
4
- "content":"hi again",
5
- "id":3,
6
- "organization_id":1,
7
- "organization":{
8
- "name":"org2",
9
- "label":"org2",
10
- "id":1
11
- },
12
- "created_at":"2020-01-28 09:31:05 -0500",
13
- "updated_at":"2020-01-28 09:31:05 -0500",
14
- "gpg_key_products":[
15
-
16
- ],
17
- "gpg_key_repos":[
18
-
19
- ],
20
- "ssl_ca_products":[
21
-
22
- ],
23
- "ssl_ca_root_repos":[
24
-
25
- ],
26
- "ssl_client_products":[
27
-
28
- ],
29
- "ssl_client_root_repos":[
30
-
31
- ],
32
- "ssl_key_products":[
33
-
34
- ],
35
- "ssl_key_root_repos":[
36
-
37
- ],
38
- "permissions":{
39
- "view_content_credenials":true,
40
- "edit_content_credenials":true,
41
- "destroy_content_credenials":true
42
- }
43
- }