hammer_cli_katello 1.1.3 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hammer_cli_katello/foreman_search_options_creators.rb +0 -12
  3. data/lib/hammer_cli_katello/host_collection.rb +6 -0
  4. data/lib/hammer_cli_katello/host_errata.rb +1 -1
  5. data/lib/hammer_cli_katello/repository.rb +0 -27
  6. data/lib/hammer_cli_katello/version.rb +1 -1
  7. data/test/data/2.5/foreman_api.json +1 -0
  8. data/test/data/3.0/foreman_api.json +1 -0
  9. data/test/data/3.10/foreman_api.json +1 -0
  10. data/test/data/3.11/foreman_api.json +1 -0
  11. data/test/data/3.12/foreman_api.json +1 -0
  12. data/test/data/3.13/foreman_api.json +1 -0
  13. data/test/data/3.14/foreman_api.json +1 -0
  14. data/test/data/3.15/foreman_api.json +1 -0
  15. data/test/data/3.16/foreman_api.json +1 -0
  16. data/test/data/3.17/foreman_api.json +1 -0
  17. data/test/data/3.18/foreman_api.json +1 -0
  18. data/test/data/3.19/foreman_api.json +1 -0
  19. data/test/data/3.2/foreman_api.json +1 -0
  20. data/test/data/3.4/foreman_api.json +1 -0
  21. data/test/data/3.5/foreman_api.json +1 -0
  22. data/test/data/3.6/foreman_api.json +1 -0
  23. data/test/data/3.7/foreman_api.json +1 -0
  24. data/test/data/3.8/foreman_api.json +1 -0
  25. data/test/data/3.9/foreman_api.json +1 -0
  26. data/test/data/4.0/foreman_api.json +1 -0
  27. data/test/data/4.1/foreman_api.json +1 -0
  28. data/test/data/Readme.md +5 -0
  29. data/test/functional/activation_key/add_host_collection_test.rb +62 -0
  30. data/test/functional/activation_key/content_override_test.rb +92 -0
  31. data/test/functional/activation_key/create_test.rb +33 -0
  32. data/test/functional/activation_key/data/activation_key.json +17 -0
  33. data/test/functional/activation_key/info_test.rb +29 -0
  34. data/test/functional/activation_key/list_test.rb +68 -0
  35. data/test/functional/activation_key/product_content_test.rb +23 -0
  36. data/test/functional/activation_key/remove_host_collection_test.rb +62 -0
  37. data/test/functional/activation_key/subscriptions_test.rb +74 -0
  38. data/test/functional/activation_key/update_test.rb +26 -0
  39. data/test/functional/apipie_helper_test.rb +31 -0
  40. data/test/functional/capsule/capsule_helpers.rb +13 -0
  41. data/test/functional/capsule/content/add_lifecycle_environment_test.rb +40 -0
  42. data/test/functional/capsule/content/cancel_synchronization_test.rb +42 -0
  43. data/test/functional/capsule/content/capsule_content_helpers.rb +24 -0
  44. data/test/functional/capsule/content/data/library_env.json +47 -0
  45. data/test/functional/capsule/content/data/sync_status.json +6 -0
  46. data/test/functional/capsule/content/data/sync_tasks.json +62 -0
  47. data/test/functional/capsule/content/info_test.rb +61 -0
  48. data/test/functional/capsule/content/lifecycle_environments_test.rb +19 -0
  49. data/test/functional/capsule/content/remove_lifecycle_environment_test.rb +40 -0
  50. data/test/functional/capsule/content/synchronization_status_test.rb +107 -0
  51. data/test/functional/capsule/info_test.rb +25 -0
  52. data/test/functional/capsule/list_test.rb +24 -0
  53. data/test/functional/content_credentials/create_test.rb +32 -0
  54. data/test/functional/content_credentials/data/test_cert.json +43 -0
  55. data/test/functional/content_credentials/info_test.rb +50 -0
  56. data/test/functional/content_credentials/list_test.rb +66 -0
  57. data/test/functional/content_export/complete/library_test.rb +155 -0
  58. data/test/functional/content_export/complete/version_test.rb +252 -0
  59. data/test/functional/content_export/content_export_helpers.rb +26 -0
  60. data/test/functional/content_export/generate_metadata_test.rb +64 -0
  61. data/test/functional/content_export/incremental/library_test.rb +172 -0
  62. data/test/functional/content_export/incremental/version_test.rb +268 -0
  63. data/test/functional/content_export/list_test.rb +64 -0
  64. data/test/functional/content_import/library_test.rb +85 -0
  65. data/test/functional/content_import/list_test.rb +65 -0
  66. data/test/functional/content_import/metadata.json +1 -0
  67. data/test/functional/content_import/version_test.rb +85 -0
  68. data/test/functional/content_view/add_content_view_version_test.rb +88 -0
  69. data/test/functional/content_view/add_repository_test.rb +21 -0
  70. data/test/functional/content_view/component/add_test.rb +177 -0
  71. data/test/functional/content_view/component/list_test.rb +55 -0
  72. data/test/functional/content_view/component/remove_test.rb +107 -0
  73. data/test/functional/content_view/component/update_test.rb +134 -0
  74. data/test/functional/content_view/content_view_helpers.rb +20 -0
  75. data/test/functional/content_view/copy_test.rb +53 -0
  76. data/test/functional/content_view/create_test.rb +34 -0
  77. data/test/functional/content_view/delete_test.rb +62 -0
  78. data/test/functional/content_view/filter/create_test.rb +57 -0
  79. data/test/functional/content_view/filter/delete_test.rb +90 -0
  80. data/test/functional/content_view/filter/info_test.rb +89 -0
  81. data/test/functional/content_view/filter/list_test.rb +98 -0
  82. data/test/functional/content_view/filter/update_test.rb +91 -0
  83. data/test/functional/content_view/list_test.rb +68 -0
  84. data/test/functional/content_view/publish_test.rb +24 -0
  85. data/test/functional/content_view/purge_test.rb +97 -0
  86. data/test/functional/content_view/remove_content_view_version_test.rb +88 -0
  87. data/test/functional/content_view/remove_test.rb +79 -0
  88. data/test/functional/content_view/update_test.rb +53 -0
  89. data/test/functional/content_view/version/incremental_update_test.rb +108 -0
  90. data/test/functional/content_view/version/list_test.rb +44 -0
  91. data/test/functional/content_view/version/promote_test.rb +34 -0
  92. data/test/functional/content_view/version/republish_repositories_test.rb +34 -0
  93. data/test/functional/content_view/version/update_test.rb +48 -0
  94. data/test/functional/erratum/erratum_helpers.rb +91 -0
  95. data/test/functional/erratum/info_test.rb +29 -0
  96. data/test/functional/erratum/list_test.rb +108 -0
  97. data/test/functional/file/file_helpers.rb +13 -0
  98. data/test/functional/file/info_test.rb +162 -0
  99. data/test/functional/file/list_test.rb +112 -0
  100. data/test/functional/filter_rule/create_test.rb +99 -0
  101. data/test/functional/filter_rule/delete_test.rb +104 -0
  102. data/test/functional/filter_rule/filter_rule_helpers.rb +12 -0
  103. data/test/functional/filter_rule/info_test.rb +104 -0
  104. data/test/functional/filter_rule/list_test.rb +91 -0
  105. data/test/functional/filter_rule/update_test.rb +104 -0
  106. data/test/functional/host/errata/apply_test.rb +45 -0
  107. data/test/functional/host/errata/info_test.rb +27 -0
  108. data/test/functional/host/errata/list_test.rb +49 -0
  109. data/test/functional/host/errata/recalculate_test.rb +40 -0
  110. data/test/functional/host/extensions/create_test.rb +95 -0
  111. data/test/functional/host/extensions/data/host.json +320 -0
  112. data/test/functional/host/extensions/data/host_list.json +117 -0
  113. data/test/functional/host/extensions/info_test.rb +35 -0
  114. data/test/functional/host/extensions/list_test.rb +21 -0
  115. data/test/functional/host/extensions/update_test.rb +70 -0
  116. data/test/functional/host/host_helpers.rb +8 -0
  117. data/test/functional/host/subscription/attach_test.rb +54 -0
  118. data/test/functional/host/subscription/auto_attach_test.rb +35 -0
  119. data/test/functional/host/subscription/content_override_test.rb +96 -0
  120. data/test/functional/host/subscription/product_content_test.rb +27 -0
  121. data/test/functional/host/subscription/register_test.rb +53 -0
  122. data/test/functional/host/subscription/remove_test.rb +52 -0
  123. data/test/functional/host/subscription/unregister_test.rb +37 -0
  124. data/test/functional/host/traces/list_test.rb +37 -0
  125. data/test/functional/host/traces/resolve_test.rb +31 -0
  126. data/test/functional/host_collection/add_host_test.rb +90 -0
  127. data/test/functional/host_collection/content_api_expectations.rb +35 -0
  128. data/test/functional/host_collection/content_install_test.rb +62 -0
  129. data/test/functional/host_collection/content_remove_test.rb +37 -0
  130. data/test/functional/host_collection/content_update_test.rb +37 -0
  131. data/test/functional/host_collection/copy_test.rb +64 -0
  132. data/test/functional/host_collection/create_test.rb +54 -0
  133. data/test/functional/host_collection/delete_test.rb +57 -0
  134. data/test/functional/host_collection/hosts_test.rb +39 -0
  135. data/test/functional/host_collection/info_test.rb +57 -0
  136. data/test/functional/host_collection/list_test.rb +63 -0
  137. data/test/functional/host_collection/remove_host_test.rb +90 -0
  138. data/test/functional/host_collection/update_test.rb +57 -0
  139. data/test/functional/hostgroup/create_test.rb +112 -0
  140. data/test/functional/hostgroup/data/hostgroup.json +50 -0
  141. data/test/functional/hostgroup/info_test.rb +33 -0
  142. data/test/functional/hostgroup/update_test.rb +120 -0
  143. data/test/functional/lifecycle_environment/create_test.rb +14 -0
  144. data/test/functional/lifecycle_environment/lifecycle_environment_helpers.rb +18 -0
  145. data/test/functional/lifecycle_environment/list_test.rb +38 -0
  146. data/test/functional/lifecycle_environment/update_test.rb +14 -0
  147. data/test/functional/local_helper_test.rb +30 -0
  148. data/test/functional/module_stream/info_test.rb +58 -0
  149. data/test/functional/module_stream/list_test.rb +53 -0
  150. data/test/functional/organization/delete_test.rb +26 -0
  151. data/test/functional/organization/info_test.rb +22 -0
  152. data/test/functional/organization/organization_helpers.rb +10 -0
  153. data/test/functional/package/list_test.rb +158 -0
  154. data/test/functional/package_group/list_test.rb +38 -0
  155. data/test/functional/ping_test.rb +59 -0
  156. data/test/functional/product/create_test.rb +54 -0
  157. data/test/functional/product/delete_test.rb +41 -0
  158. data/test/functional/product/info_test.rb +33 -0
  159. data/test/functional/product/list_test.rb +58 -0
  160. data/test/functional/product/product_helpers.rb +24 -0
  161. data/test/functional/product/remove_sync_plan_test.rb +35 -0
  162. data/test/functional/product/set_sync_plan_test.rb +49 -0
  163. data/test/functional/product/update_proxy.rb +48 -0
  164. data/test/functional/product/update_test.rb +46 -0
  165. data/test/functional/repository/create_test.rb +21 -0
  166. data/test/functional/repository/delete_test.rb +95 -0
  167. data/test/functional/repository/info_test.rb +156 -0
  168. data/test/functional/repository/list_test.rb +68 -0
  169. data/test/functional/repository/remove_content_test.rb +108 -0
  170. data/test/functional/repository/repository_helpers.rb +18 -0
  171. data/test/functional/repository/synchronize_test.rb +57 -0
  172. data/test/functional/repository/update_test.rb +149 -0
  173. data/test/functional/repository/upload_test.rb +345 -0
  174. data/test/functional/repository_set/available_repositories_test.rb +18 -0
  175. data/test/functional/repository_set/disable_test.rb +42 -0
  176. data/test/functional/repository_set/enable_test.rb +42 -0
  177. data/test/functional/repository_set/info_test.rb +17 -0
  178. data/test/functional/repository_set/list_test.rb +18 -0
  179. data/test/functional/repository_set/repository_set_helpers.rb +20 -0
  180. data/test/functional/search_helpers.rb +17 -0
  181. data/test/functional/simple_content_access/disable_test.rb +48 -0
  182. data/test/functional/simple_content_access/enable_test.rb +46 -0
  183. data/test/functional/srpm/list_test.rb +92 -0
  184. data/test/functional/subscription/list_test.rb +86 -0
  185. data/test/functional/sync_plan/create_test.rb +60 -0
  186. data/test/functional/sync_plan/delete_test.rb +46 -0
  187. data/test/functional/sync_plan/info_test.rb +37 -0
  188. data/test/functional/sync_plan/list_test.rb +31 -0
  189. data/test/functional/sync_plan/sync_plan_helpers.rb +8 -0
  190. data/test/functional/sync_plan/update_test.rb +44 -0
  191. data/test/functional/test_helper.rb +24 -0
  192. data/test/task_helper.rb +7 -0
  193. data/test/test_helper.rb +38 -0
  194. data/test/unit/id_name_options_validator_test.rb +96 -0
  195. data/test/unit/id_resolver_test.rb +58 -0
  196. data/test/unit/messages_test.rb +7 -0
  197. data/test/unit/search_options_creators_test.rb +145 -0
  198. metadata +388 -6
@@ -0,0 +1,320 @@
1
+ {
2
+ "ip":"192.168.121.86",
3
+ "environment_id":null,
4
+ "environment_name":null,
5
+ "last_report":null,
6
+ "mac":"52:54:00:bc:d3:71",
7
+ "realm_id":null,
8
+ "realm_name":null,
9
+ "sp_mac":null,
10
+ "sp_ip":null,
11
+ "sp_name":null,
12
+ "domain_id":null,
13
+ "domain_name":null,
14
+ "architecture_id":1,
15
+ "architecture_name":"x86_64",
16
+ "operatingsystem_id":null,
17
+ "operatingsystem_name":null,
18
+ "subnet_id":null,
19
+ "subnet_name":null,
20
+ "sp_subnet_id":null,
21
+ "ptable_id":null,
22
+ "ptable_name":null,
23
+ "medium_id":null,
24
+ "medium_name":null,
25
+ "build":false,
26
+ "comment":null,
27
+ "disk":null,
28
+ "installed_at":null,
29
+ "model_id":1,
30
+ "hostgroup_id":null,
31
+ "owner_id":3,
32
+ "owner_type":"User",
33
+ "enabled":true,
34
+ "puppet_ca_proxy_id":null,
35
+ "managed":false,
36
+ "use_image":null,
37
+ "image_file":"",
38
+ "uuid":null,
39
+ "compute_resource_id":null,
40
+ "compute_resource_name":null,
41
+ "compute_profile_id":null,
42
+ "compute_profile_name":null,
43
+ "capabilities":[
44
+ "build"
45
+ ],
46
+ "provision_method":"build",
47
+ "puppet_proxy_id":null,
48
+ "certname":"robot.example.com",
49
+ "image_id":null,
50
+ "image_name":null,
51
+ "created_at":"2016-05-25 09:39:20 -0400",
52
+ "updated_at":"2016-05-26 10:46:26 -0400",
53
+ "last_compile":"2016-05-26 10:46:19 -0400",
54
+ "global_status":1,
55
+ "global_status_label":"Warning",
56
+ "organization_id":1,
57
+ "organization_name":"Default Organization",
58
+ "location_id":2,
59
+ "location_name":"Default Location",
60
+ "puppet_status":0,
61
+ "model_name":"Standard PC (i440FX + PIIX, 1996)",
62
+ "errata_status":1,
63
+ "errata_status_label":"Could not calculate errata status, ensure host is registered and katello-agent is installed",
64
+ "subscription_status":0,
65
+ "subscription_status_label":"Fully entitled",
66
+ "name":"robot.example.com",
67
+ "id":1,
68
+ "hostgroup_name":null,
69
+ "hostgroup_title":null,
70
+ "content_facet_attributes":{
71
+ "id":1,
72
+ "uuid":"179834bf-779a-457f-a1fa-b06ae0acb21a",
73
+ "content_view_id":1,
74
+ "content_view_name":"Default Organization View",
75
+ "lifecycle_environment_id":1,
76
+ "lifecycle_environment_name":"Library",
77
+ "content_source_id":2,
78
+ "content_source_name":"capsule",
79
+ "kickstart_repository_id":10000,
80
+ "kickstart_repository_name":"Rhel 7",
81
+ "content_view":{
82
+ "id":1,
83
+ "name":"Default Organization View"
84
+ },
85
+ "lifecycle_environment":{
86
+ "id":1,
87
+ "name":"Library"
88
+ },
89
+ "errata_counts":{
90
+ "security":0,
91
+ "bugfix":0,
92
+ "enhancement":0,
93
+ "total":0
94
+ },
95
+ "content_view_version":"1.0",
96
+ "content_view_version_id":1,
97
+ "content_view_default?":true,
98
+ "lifecycle_environment_library?":true,
99
+ "katello_agent_installed":true,
100
+ "applicable_package_count": 5,
101
+ "upgradable_package_count": 4
102
+ },
103
+ "traces_status_label":"Updated",
104
+ "subscription_facet_attributes":{
105
+ "id":2,
106
+ "uuid":"179834bf-779a-457f-a1fa-b06ae0acb21a",
107
+ "last_checkin":"2016-05-26 10:46:18 -0400",
108
+ "service_level":"high",
109
+ "release_version":"7Server",
110
+ "purpose_usage":"Production",
111
+ "purpose_role":"Role",
112
+ "purpose_addons":"Test Addon1, Test Addon2",
113
+ "autoheal":true,
114
+ "registered_at":"2016-05-26 10:46:22 -0400",
115
+ "activation_keys":[
116
+
117
+ ],
118
+ "compliance_reasons":[
119
+
120
+ ],
121
+ "virtual_host":null,
122
+ "virtual_guests":[
123
+
124
+ ],
125
+ "installed_products":[
126
+
127
+ ]
128
+ },
129
+ "content_host_id":2,
130
+ "parameters":[
131
+
132
+ ],
133
+ "interfaces":[
134
+ {
135
+ "id":2,
136
+ "name":null,
137
+ "ip":"172.17.42.1",
138
+ "mac":"02:42:d1:70:84:d0",
139
+ "identifier":"docker0",
140
+ "primary":false,
141
+ "provision":false,
142
+ "type":"interface"
143
+ },
144
+ {
145
+ "id":1,
146
+ "name":"robot.example.com",
147
+ "ip":"192.168.121.86",
148
+ "mac":"52:54:00:bc:d3:71",
149
+ "identifier":"eth0",
150
+ "primary":true,
151
+ "provision":true,
152
+ "type":"interface"
153
+ }
154
+ ],
155
+ "puppetclasses":[
156
+
157
+ ],
158
+ "config_groups":[
159
+
160
+ ],
161
+ "all_parameters":[
162
+
163
+ ],
164
+ "all_puppetclasses":[
165
+
166
+ ],
167
+ "facts":{
168
+ "dmi::system::uuid":"63C9E5F3-0CC7-47B2-BD76-FE3B2E947F7A",
169
+ "lscpu::l1d_cache":"32K",
170
+ "distribution::name":"CentOS Linux",
171
+ "dmi::memory::manufacturer":"QEMU",
172
+ "net::interface::eth0::mac_address":"52:54:00:BC:D3:71",
173
+ "dmi::bios::address":"0xe8000",
174
+ "distribution::id":"Core",
175
+ "dmi::processor::family":"Other",
176
+ "dmi::memory::assettag":"Not Specified",
177
+ "dmi::chassis::manufacturer":"QEMU",
178
+ "dmi::memory::bank_locator":"Not Specified",
179
+ "lscpu::numa_node(s)":"1",
180
+ "virt::host_type":"kvm",
181
+ "lscpu::l1i_cache":"32K",
182
+ "lscpu::vendor_id":"GenuineIntel",
183
+ "virt::is_guest":"true",
184
+ "dmi::chassis::security_status":"Unknown",
185
+ "uname::sysname":"Linux",
186
+ "dmi::processor::type":"Central Processor",
187
+ "lscpu::hypervisor_vendor":"KVM",
188
+ "lscpu::cpu_op-mode(s)":"32-bit, 64-bit",
189
+ "net::interface::eth0::ipv4_netmask":"24",
190
+ "net::interface::eth0::ipv4_address":"192.168.121.86",
191
+ "dmi::system::family":"Not Specified",
192
+ "cpu::core(s)_per_socket":"1",
193
+ "distribution::version":"7",
194
+ "network::ipv4_address":"127.0.0.1",
195
+ "dmi::bios::vendor":"SeaBIOS",
196
+ "net::interface::eth0::ipv6_address::link":"fe80::5054:ff:febc:d371",
197
+ "dmi::bios::bios_revision":"0.0",
198
+ "dmi::system::version":"pc-i440fx-2.4",
199
+ "net::interface::eth0::ipv6_netmask::link":"64",
200
+ "lscpu::stepping":"3",
201
+ "dmi::chassis::type":"Other",
202
+ "dmi::chassis::serial_number":"Not Specified",
203
+ "dmi::chassis::power_supply_state":"Safe",
204
+ "net::interface::lo::ipv6_netmask::host":"128",
205
+ "lscpu::bogomips":"5387.52",
206
+ "dmi::chassis::lock":"Not Present",
207
+ "network::ipv6_address":"fe80::5054:ff:febc:d371",
208
+ "net::interface::lo::ipv4_address":"127.0.0.1",
209
+ "lscpu::thread(s)_per_core":"1",
210
+ "dmi::system::serial_number":"Not Specified",
211
+ "dmi::chassis::boot-up_state":"Safe",
212
+ "dmi::processor::status":"Populated:Enabled",
213
+ "net::interface::lo::ipv4_broadcast":"Unknown",
214
+ "lscpu::on-line_cpu(s)_list":"0-2",
215
+ "dmi::memory::locator":"DIMM 0",
216
+ "dmi::chassis::asset_tag":"Not Specified",
217
+ "dmi::system::status":"No errors detected",
218
+ "dmi::chassis::version":"pc-i440fx-2.4",
219
+ "dmi::processor::part_number":"Not Specified",
220
+ "dmi::memory::location":"Other",
221
+ "net::interface::lo::ipv4_netmask":"8",
222
+ "cpu::cpu(s)":"3",
223
+ "network::hostname":"robot.example.com",
224
+ "dmi::system::manufacturer":"QEMU",
225
+ "net::interface::lo::ipv6_address::host":"::1",
226
+ "uname::version":"#1 SMP Tue Feb 16 17:03:50 UTC 2016",
227
+ "dmi::memory::use":"System Memory",
228
+ "lscpu::cpu(s)":"3",
229
+ "dmi::processor::upgrade":"Other",
230
+ "lscpu::byte_order":"Little Endian",
231
+ "memory::memtotal":"5356760",
232
+ "dmi::bios::version":"1.8.2-20150714_191134-",
233
+ "lscpu::model_name":"QEMU Virtual CPU version 2.4.1",
234
+ "dmi::bios::runtime_size":"96 KB",
235
+ "lscpu::cpu_family":"6",
236
+ "lscpu::virtualization_type":"full",
237
+ "system::certificate_version":"3.2",
238
+ "dmi::memory::part_number":"Not Specified",
239
+ "dmi::chassis::thermal_state":"Safe",
240
+ "lscpu::numa_node0_cpu(s)":"0-2",
241
+ "lscpu::architecture":"x86_64",
242
+ "lscpu::model":"6",
243
+ "dmi::memory::maximum_capacity":"5560 MB",
244
+ "dmi::memory::error_correction_type":"Multi-bit ECC",
245
+ "lscpu::core(s)_per_socket":"1",
246
+ "net::interface::docker0::ipv4_netmask":"16",
247
+ "virt::uuid":"63C9E5F3-0CC7-47B2-BD76-FE3B2E947F7A",
248
+ "lscpu::cpu_mhz":"2693.762",
249
+ "dmi::system::product_name":"Standard PC (i440FX + PIIX, 1996)",
250
+ "dmi::processor::version":"pc-i440fx-2.4",
251
+ "dmi::memory::form_factor":"DIMM",
252
+ "memory::swaptotal":"1048572",
253
+ "net::interface::eth0::ipv4_broadcast":"192.168.121.255",
254
+ "net::interface::docker0::ipv4_address":"172.17.42.1",
255
+ "uname::release":"3.10.0-327.10.1.el7.x86_64",
256
+ "cpu::topology_source":"kernel /sys cpu sibling lists",
257
+ "dmi::bios::rom_size":"64 KB",
258
+ "dmi::memory::type":"RAM",
259
+ "net::interface::docker0::ipv4_broadcast":"Unknown",
260
+ "dmi::processor::socket_designation":"CPU 1",
261
+ "dmi::processor::serial_number":"Not Specified",
262
+ "dmi::memory::size":"5560 MB",
263
+ "cpu::thread(s)_per_core":"1",
264
+ "dmi::bios::relase_date":"04/01/2014",
265
+ "dmi::memory::serial_number":"Not Specified",
266
+ "uname::machine":"x86_64",
267
+ "dmi::memory::error_information_handle":"Not Provided",
268
+ "uname::nodename":"robot.example.com",
269
+ "dmi::memory::array_handle":"0x1000",
270
+ "dmi::system::sku_number":"Not Specified",
271
+ "dmi::processor::asset_tag":"Not Specified",
272
+ "lscpu::socket(s)":"3",
273
+ "lscpu::l2_cache":"4096K",
274
+ "dmi::system::wake-up_type":"Power Switch",
275
+ "cpu::cpu_socket(s)":"3",
276
+ "dmi::memory::speed":" (ns)",
277
+ "dmi":null,
278
+ "dmi::system":null,
279
+ "lscpu":null,
280
+ "distribution":null,
281
+ "dmi::memory":null,
282
+ "net":null,
283
+ "net::interface":null,
284
+ "net::interface::eth0":null,
285
+ "dmi::bios":null,
286
+ "dmi::processor":null,
287
+ "dmi::chassis":null,
288
+ "virt":null,
289
+ "uname":null,
290
+ "cpu":null,
291
+ "network":null,
292
+ "net::interface::eth0::ipv6_address":null,
293
+ "net::interface::eth0::ipv6_netmask":null,
294
+ "net::interface::docker0":null,
295
+ "net::interface::lo":null,
296
+ "net::interface::lo::ipv6_netmask":null,
297
+ "net::interface::lo::ipv6_address":null,
298
+ "memory":null,
299
+ "system":null,
300
+ "net::interface::docker0::mac_address":"02:42:BB:4D:22:C5",
301
+ "_timestamp":"2016-05-26T10:46:19-04:00"
302
+ },
303
+ "host_collections":[
304
+ {
305
+ "id":1,
306
+ "name":"my host collection"
307
+ }
308
+ ],
309
+ "permissions":{
310
+ "view_hosts":true,
311
+ "create_hosts":true,
312
+ "edit_hosts":true,
313
+ "destroy_hosts":true,
314
+ "build_hosts":true,
315
+ "power_hosts":true,
316
+ "console_hosts":true,
317
+ "ipmi_boot":true,
318
+ "puppetrun_hosts":true
319
+ }
320
+ }
@@ -0,0 +1,117 @@
1
+ {
2
+ "total":1,
3
+ "subtotal":1,
4
+ "page":1,
5
+ "per_page":20,
6
+ "search":null,
7
+ "sort":{
8
+ "by":null,
9
+ "order":null
10
+ },
11
+ "results":[
12
+ {
13
+ "ip":"192.168.121.86",
14
+ "environment_id":null,
15
+ "environment_name":null,
16
+ "last_report":null,
17
+ "mac":"52:54:00:bc:d3:71",
18
+ "realm_id":null,
19
+ "realm_name":null,
20
+ "sp_mac":null,
21
+ "sp_ip":null,
22
+ "sp_name":null,
23
+ "domain_id":null,
24
+ "domain_name":null,
25
+ "architecture_id":1,
26
+ "architecture_name":"x86_64",
27
+ "operatingsystem_id":null,
28
+ "operatingsystem_name":null,
29
+ "subnet_id":null,
30
+ "subnet_name":null,
31
+ "sp_subnet_id":null,
32
+ "ptable_id":null,
33
+ "ptable_name":null,
34
+ "medium_id":null,
35
+ "medium_name":null,
36
+ "build":false,
37
+ "comment":null,
38
+ "disk":null,
39
+ "installed_at":null,
40
+ "model_id":1,
41
+ "hostgroup_id":null,
42
+ "owner_id":3,
43
+ "owner_type":"User",
44
+ "enabled":true,
45
+ "puppet_ca_proxy_id":null,
46
+ "managed":false,
47
+ "use_image":null,
48
+ "image_file":"",
49
+ "uuid":null,
50
+ "compute_resource_id":null,
51
+ "compute_resource_name":null,
52
+ "compute_profile_id":null,
53
+ "compute_profile_name":null,
54
+ "capabilities":[
55
+ "build"
56
+ ],
57
+ "provision_method":"build",
58
+ "puppet_proxy_id":null,
59
+ "certname":"robot.example.com",
60
+ "image_id":null,
61
+ "image_name":null,
62
+ "created_at":"2016-05-25 09:39:20 -0400",
63
+ "updated_at":"2016-05-26 10:46:26 -0400",
64
+ "last_compile":"2016-05-26 10:46:19 -0400",
65
+ "global_status":1,
66
+ "global_status_label":"Warning",
67
+ "organization_id":1,
68
+ "organization_name":"Default Organization",
69
+ "location_id":2,
70
+ "location_name":"Default Location",
71
+ "puppet_status":0,
72
+ "model_name":"Standard PC (i440FX + PIIX, 1996)",
73
+ "errata_status":1,
74
+ "errata_status_label":"Could not calculate errata status, ensure host is registered and katello-agent is installed",
75
+ "subscription_status":0,
76
+ "subscription_status_label":"Fully entitled",
77
+ "traces_status":0,
78
+ "traces_status_label":"updated",
79
+ "name":"robot.example.com",
80
+ "id":1,
81
+ "hostgroup_name":null,
82
+ "hostgroup_title":null,
83
+ "content_facet_attributes":{
84
+ "id":1,
85
+ "uuid":"179834bf-779a-457f-a1fa-b06ae0acb21a",
86
+ "content_view_id":1,
87
+ "content_view_name":"Default Organization View",
88
+ "lifecycle_environment_id":1,
89
+ "lifecycle_environment_name":"Library",
90
+ "content_view":{
91
+ "id":1,
92
+ "name":"Default Organization View"
93
+ },
94
+ "lifecycle_environment":{
95
+ "id":1,
96
+ "name":"Library"
97
+ },
98
+ "errata_counts":{
99
+ "security":0,
100
+ "bugfix":0,
101
+ "enhancement":0,
102
+ "total":0
103
+ }
104
+ },
105
+ "subscription_facet_attributes":{
106
+ "id":2,
107
+ "uuid":"179834bf-779a-457f-a1fa-b06ae0acb21a",
108
+ "last_checkin":"2016-05-26 10:46:18 -0400",
109
+ "service_level":null,
110
+ "release_version":"{\"releaseVer\"=>nil}",
111
+ "autoheal":true,
112
+ "registered_at":"2016-05-26 10:46:22 -0400"
113
+ },
114
+ "content_host_id":2
115
+ }
116
+ ]
117
+ }
@@ -0,0 +1,35 @@
1
+ require File.join(File.dirname(__FILE__), '../../test_helper')
2
+
3
+ describe 'host info' do
4
+ before do
5
+ @cmd = %w(host info)
6
+ end
7
+
8
+ it "includes katello attributes" do
9
+ params = ['--id', '1']
10
+ ex = api_expects(:hosts, :show, 'Host show') do |par|
11
+ par['id'] == '1'
12
+ end
13
+
14
+ json_file = File.join(File.dirname(__FILE__), 'data', 'host.json')
15
+ ex.returns(JSON.parse(File.read(json_file)))
16
+
17
+ result = run_cmd(@cmd + params)
18
+ # rubocop:disable Style/WordArray
19
+ expected_fields = [['Name', 'Library'],
20
+ ['Name', 'Default Organization View'],
21
+ ['Release Version', '7Server'],
22
+ ['Name', 'Rhel 7'],
23
+ ['Name', 'capsule'],
24
+ ['Bug Fix', '0'],
25
+ ['Name', 'my host collection'],
26
+ ['Applicable Packages', '5'],
27
+ ['Upgradable Packages', '4'],
28
+ ['Purpose Usage', 'Production'],
29
+ ['Purpose Role', 'Role'],
30
+ ['Purpose Addons', 'Test Addon1, Test Addon2'],
31
+ ['Trace Status', 'Updated']]
32
+ expected_results = expected_fields.map { |field| success_result(FieldMatcher.new(*field)) }
33
+ expected_results.each { |expected| assert_cmd(expected, result) }
34
+ end
35
+ end
@@ -0,0 +1,21 @@
1
+ require File.join(File.dirname(__FILE__), '../../test_helper')
2
+
3
+ describe 'host list' do
4
+ before do
5
+ @cmd = %w(host list)
6
+ end
7
+
8
+ it "list hosts" do
9
+ ex = api_expects(:hosts, :index, 'Host index')
10
+
11
+ json_file = File.join(File.dirname(__FILE__), 'data', 'host_list.json')
12
+ ex.returns(JSON.parse(File.read(json_file)))
13
+
14
+ result = run_cmd(@cmd)
15
+
16
+ fields = ['CONTENT VIEW', 'LIFECYCLE ENVIRONMENT', 'TRACE STATUS']
17
+ values = ['Default Organization View', 'Library', 'updated']
18
+ expected_result = success_result(IndexMatcher.new([fields, values]))
19
+ assert_cmd(expected_result, result)
20
+ end
21
+ end
@@ -0,0 +1,70 @@
1
+ require File.join(File.dirname(__FILE__), '../../test_helper')
2
+ require 'hammer_cli_foreman/host'
3
+
4
+ module HammerCLIForeman
5
+ describe Host do
6
+ # These tests are only for the extensions Katello adds to the hostgroup command
7
+ # See hammer-cli-foreman for the core hostgroup tests
8
+ describe UpdateCommand do
9
+ it 'allows kickstart repository name' do
10
+ env_name = "world"
11
+ env_id = 100
12
+ cv_id = 200
13
+ repo_name = "life_of_kickstart"
14
+ repo_id = 111
15
+ host_id = 777
16
+ organization_id = 329
17
+ api_expects(:lifecycle_environments, :index).
18
+ with_params('name' => env_name,
19
+ 'organization_id' => organization_id).
20
+ returns(index_response([{'id' => env_id}]))
21
+
22
+ api_expects(:repositories, :index).
23
+ with_params('name' => repo_name,
24
+ 'environment_id' => env_id,
25
+ 'content_view_id' => cv_id).
26
+ returns(index_response([{'id' => repo_id}]))
27
+
28
+ api_expects(:hosts, :update).
29
+ with_params('id' => host_id.to_s,
30
+ 'organization_id' => organization_id,
31
+ 'host' => {
32
+ 'content_facet_attributes' => {
33
+ 'content_view_id' => cv_id,
34
+ 'lifecycle_environment_id' => env_id,
35
+ 'kickstart_repository_id' => repo_id
36
+ },
37
+ 'subscription_facet_attributes' => {}
38
+ })
39
+
40
+ cmd = "host update --id=#{host_id}"\
41
+ " --content-view-id=#{cv_id}"\
42
+ " --lifecycle-environment=#{env_name}"\
43
+ " --kickstart-repository=#{repo_name}"\
44
+ " --organization-id=#{organization_id}"
45
+ run_cmd(cmd.split)
46
+ end
47
+
48
+ it 'allows content source name' do
49
+ content_source_name = "life_of_cs"
50
+ content_source_id = 111
51
+ host_id = 441
52
+
53
+ api_expects(:smart_proxies, :index).
54
+ with_params(:search => "name = \"#{content_source_name}\"").
55
+ returns(index_response([{'id' => content_source_id}]))
56
+
57
+ api_expects(:hosts, :update).
58
+ with_params('id' => host_id.to_s,
59
+ 'host' => {
60
+ 'content_facet_attributes' => {
61
+ 'content_source_id' => content_source_id
62
+ }
63
+ })
64
+
65
+ cmd = "host update --id #{host_id} --content-source #{content_source_name}"
66
+ run_cmd(cmd.split)
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,8 @@
1
+ module HostHelpers
2
+ def expect_host_search(name, id)
3
+ ex = api_expects(:hosts, :index, 'Find the host') do |par|
4
+ par[:search] == "name = \"#{name}\""
5
+ end
6
+ ex.returns(index_response([{'id' => id}]))
7
+ end
8
+ end
@@ -0,0 +1,54 @@
1
+ require File.join(File.dirname(__FILE__), '../../test_helper')
2
+ require File.join(File.dirname(__FILE__), '../host_helpers')
3
+
4
+ describe 'host subscription attach' do
5
+ include HostHelpers
6
+
7
+ before do
8
+ @cmd = %w(host subscription attach)
9
+ end
10
+ it "attach a subscription to a host No Quantity" do
11
+ params = ['--host-id=3', '--subscription-id=100']
12
+ ex = api_expects(:host_subscriptions, :add_subscriptions, "attach host") do |par|
13
+ par['host_id'] == 3 && par[:subscriptions][0][:id].to_s == '100' &&
14
+ par[:subscriptions][0][:quantity].to_s == '1'
15
+ end
16
+ ex.returns({})
17
+
18
+ expected_result = success_result(
19
+ 'Subscription attached to the host successfully.
20
+ '
21
+ )
22
+
23
+ result = run_cmd(@cmd + params)
24
+ assert_cmd(expected_result, result)
25
+ end
26
+
27
+ it "attach a subscription to a host with Quantity" do
28
+ params = ['--host-id=3', '--subscription-id=100', "--quantity=10"]
29
+ ex = api_expects(:host_subscriptions, :add_subscriptions, "attach host") do |par|
30
+ par['host_id'] == 3 && par[:subscriptions][0][:id].to_s == '100' &&
31
+ par[:subscriptions][0][:quantity].to_s == '10'
32
+ end
33
+ ex.returns({})
34
+
35
+ expected_result = success_result(
36
+ 'Subscription attached to the host successfully.
37
+ '
38
+ )
39
+
40
+ result = run_cmd(@cmd + params)
41
+ assert_cmd(expected_result, result)
42
+ end
43
+
44
+ it "resolves id from name" do
45
+ params = ['--host=boo', '--subscription-id=100']
46
+ api_expects(:host_subscriptions, :add_subscriptions, "attach host") do |par|
47
+ par['host_id'].to_s == "3" && par[:subscriptions][0][:id].to_s == '100' &&
48
+ par[:subscriptions][0][:quantity].to_s == '1'
49
+ end
50
+ expect_host_search('boo', '3')
51
+
52
+ run_cmd(@cmd + params)
53
+ end
54
+ end
@@ -0,0 +1,35 @@
1
+ require File.join(File.dirname(__FILE__), '../../test_helper')
2
+ require File.join(File.dirname(__FILE__), '../host_helpers')
3
+
4
+ describe 'host subscription auto-attach' do
5
+ include HostHelpers
6
+
7
+ before do
8
+ @cmd = %w(host subscription auto-attach)
9
+ end
10
+ it "auto-attach to a host" do
11
+ params = ['--host-id=3']
12
+ ex = api_expects(:host_subscriptions, :auto_attach, "auto-attach subs host") do |par|
13
+ par['host_id'] == 3
14
+ end
15
+ ex.returns({})
16
+
17
+ expected_result = success_result(
18
+ 'Auto attached subscriptions to the host successfully.
19
+ '
20
+ )
21
+
22
+ result = run_cmd(@cmd + params)
23
+ assert_cmd(expected_result, result)
24
+ end
25
+
26
+ it "resolves id from name" do
27
+ params = ['--host=boo']
28
+ api_expects(:host_subscriptions, :auto_attach, "auto-attach subs host") do |par|
29
+ par['host_id'].to_s == "3"
30
+ end
31
+ expect_host_search('boo', '3')
32
+
33
+ run_cmd(@cmd + params)
34
+ end
35
+ end