hammer_cli_csv 2.0.0 → 2.1.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.
Files changed (87) hide show
  1. checksums.yaml +5 -13
  2. data/config/cli_config.yml +9 -24
  3. data/lib/hammer_cli_csv/activation_keys.rb +220 -95
  4. data/lib/hammer_cli_csv/architectures.rb +7 -11
  5. data/lib/hammer_cli_csv/base.rb +67 -41
  6. data/lib/hammer_cli_csv/compute_profiles.rb +11 -15
  7. data/lib/hammer_cli_csv/compute_resources.rb +11 -15
  8. data/lib/hammer_cli_csv/containers.rb +10 -12
  9. data/lib/hammer_cli_csv/content_hosts.rb +285 -203
  10. data/lib/hammer_cli_csv/content_view_filters.rb +32 -36
  11. data/lib/hammer_cli_csv/content_views.rb +33 -37
  12. data/lib/hammer_cli_csv/csv.rb +17 -1
  13. data/lib/hammer_cli_csv/domains.rb +15 -19
  14. data/lib/hammer_cli_csv/export.rb +13 -5
  15. data/lib/hammer_cli_csv/host_collections.rb +20 -22
  16. data/lib/hammer_cli_csv/host_groups.rb +73 -65
  17. data/lib/hammer_cli_csv/hosts.rb +30 -34
  18. data/lib/hammer_cli_csv/import.rb +24 -10
  19. data/lib/hammer_cli_csv/installation_media.rb +74 -0
  20. data/lib/hammer_cli_csv/job_templates.rb +37 -41
  21. data/lib/hammer_cli_csv/lifecycle_environments.rb +15 -19
  22. data/lib/hammer_cli_csv/locations.rb +4 -6
  23. data/lib/hammer_cli_csv/operating_systems.rb +17 -21
  24. data/lib/hammer_cli_csv/organizations.rb +11 -13
  25. data/lib/hammer_cli_csv/partition_tables.rb +17 -21
  26. data/lib/hammer_cli_csv/products.rb +200 -92
  27. data/lib/hammer_cli_csv/provisioning_templates.rb +19 -23
  28. data/lib/hammer_cli_csv/puppet_environments.rb +8 -12
  29. data/lib/hammer_cli_csv/puppet_facts.rb +20 -24
  30. data/lib/hammer_cli_csv/puppet_reports.rb +47 -51
  31. data/lib/hammer_cli_csv/reports.rb +6 -10
  32. data/lib/hammer_cli_csv/roles.rb +12 -16
  33. data/lib/hammer_cli_csv/settings.rb +8 -6
  34. data/lib/hammer_cli_csv/smart_proxies.rb +9 -13
  35. data/lib/hammer_cli_csv/splice.rb +1 -3
  36. data/lib/hammer_cli_csv/subnets.rb +24 -28
  37. data/lib/hammer_cli_csv/subscriptions.rb +39 -91
  38. data/lib/hammer_cli_csv/sync_plans.rb +20 -24
  39. data/lib/hammer_cli_csv/users.rb +25 -29
  40. data/lib/hammer_cli_csv/utils/subscriptions.rb +130 -0
  41. data/lib/hammer_cli_csv/version.rb +1 -1
  42. data/lib/hammer_cli_csv.rb +2 -2
  43. data/test/csv_test.rb +32 -0
  44. data/test/csv_test_helper.rb +17 -2
  45. data/test/data/content-hosts.csv +3 -2
  46. data/test/data/hosts.csv +0 -11
  47. data/test/data/settings.csv +1 -0
  48. data/test/data/setup/content-hosts.csv +1 -0
  49. data/test/data/setup/content-views.csv +2 -0
  50. data/test/data/setup/lifecycle-environments.csv +5 -0
  51. data/test/data/setup/locations.csv +6 -0
  52. data/test/data/setup/organizations.csv +2 -0
  53. data/test/data/setup/subscriptions.csv +5 -0
  54. data/test/data/subscriptions.csv +15 -17
  55. data/test/export_test.rb +27 -0
  56. data/test/fixtures/vcr_cassettes/apipie.yml +18528 -0
  57. data/test/fixtures/vcr_cassettes/resources/activation_keys_import/create_and_update.yml +38033 -0
  58. data/test/fixtures/vcr_cassettes/resources/content_hosts_export/export.yml +18846 -0
  59. data/test/fixtures/vcr_cassettes/resources/content_hosts_export/export_subscriptions.yml +323 -0
  60. data/test/fixtures/vcr_cassettes/resources/content_hosts_import/create_and_update.yml +41884 -0
  61. data/test/fixtures/vcr_cassettes/resources/content_hosts_import/import_single_line.yml +38248 -0
  62. data/test/fixtures/vcr_cassettes/resources/settings_import/update_settings.yml +18832 -0
  63. data/test/fixtures/vcr_cassettes/resources/settings_import/update_settings_continue.yml +316 -0
  64. data/test/fixtures/vcr_cassettes/resources/subscriptions_import/manifest_does_not_exist.yml +18785 -0
  65. data/test/fixtures/vcr_cassettes/setup/setup_content_views/setup.yml +19090 -0
  66. data/test/fixtures/vcr_cassettes/setup/setup_lifecycle_environments/setup.yml +924 -0
  67. data/test/fixtures/vcr_cassettes/setup/setup_locations/setup.yml +21102 -0
  68. data/test/fixtures/vcr_cassettes/setup/setup_organizations/setup.yml +19278 -0
  69. data/test/fixtures/vcr_cassettes/setup/setup_subscriptions/setup.yml +419 -0
  70. data/test/import_test.rb +20 -25
  71. data/test/resources/activation_keys_test.rb +72 -0
  72. data/test/resources/content_hosts_test.rb +132 -0
  73. data/test/resources/settings_test.rb +81 -0
  74. data/test/resources/subscriptions_test.rb +56 -0
  75. data/test/setup/setup_content_views.rb +17 -0
  76. data/test/setup/setup_lifecycle_environments.rb +17 -0
  77. data/test/setup/setup_locations.rb +17 -0
  78. data/test/setup/setup_organizations.rb +17 -0
  79. data/test/setup/setup_subscriptions.rb +20 -0
  80. data/test/setup/setup_test.rb +10 -0
  81. data/test/test_runner.rb +175 -0
  82. data/test/vcr_setup.rb +54 -0
  83. metadata +77 -13
  84. data/lib/hammer_cli_csv/exception_handler.rb +0 -42
  85. data/lib/hammer_cli_csv/installation_medias.rb +0 -77
  86. data/test/content_hosts_test.rb +0 -61
  87. data/test/settings_test.rb +0 -30
@@ -0,0 +1,419 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://admin:changeme@katello:3000/api/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ X-Frame-Options:
22
+ - SAMEORIGIN
23
+ X-Xss-Protection:
24
+ - 1; mode=block
25
+ X-Content-Type-Options:
26
+ - nosniff
27
+ Foreman-Version:
28
+ - 1.13.0-develop
29
+ Foreman-Api-Version:
30
+ - '2'
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ Apipie-Checksum:
34
+ - e98945ba1db6bdbb4c25ce4988912344
35
+ Etag:
36
+ - W/"f536fd8685b76bb26a943d472593c93e"
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ Set-Cookie:
40
+ - _session_id=5445fbe40c7aa95490b96a4cbe46aa5b; path=/; HttpOnly
41
+ X-Request-Id:
42
+ - 1009f71c-a680-46be-8063-2a747885ee8d
43
+ X-Runtime:
44
+ - '0.313078'
45
+ Transfer-Encoding:
46
+ - chunked
47
+ body:
48
+ encoding: UTF-8
49
+ string: '{"result":"ok","status":200,"version":"1.13.0-develop","api_version":2}'
50
+ http_version:
51
+ recorded_at: Tue, 16 Aug 2016 19:07:56 GMT
52
+ - request:
53
+ method: get
54
+ uri: http://admin:changeme@katello:3000/api/v2/plugins
55
+ body:
56
+ encoding: US-ASCII
57
+ string: ''
58
+ headers:
59
+ Accept-Encoding:
60
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
61
+ Accept:
62
+ - '*/*'
63
+ User-Agent:
64
+ - Ruby
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ X-Frame-Options:
71
+ - SAMEORIGIN
72
+ X-Xss-Protection:
73
+ - 1; mode=block
74
+ X-Content-Type-Options:
75
+ - nosniff
76
+ Foreman-Version:
77
+ - 1.13.0-develop
78
+ Foreman-Api-Version:
79
+ - '2'
80
+ Content-Type:
81
+ - application/json; charset=utf-8
82
+ Apipie-Checksum:
83
+ - e98945ba1db6bdbb4c25ce4988912344
84
+ Etag:
85
+ - W/"dc4a8351c6668134273bfe99879f93b1"
86
+ Cache-Control:
87
+ - max-age=0, private, must-revalidate
88
+ Set-Cookie:
89
+ - _session_id=994b2faf62d26283376717e80e3ef140; path=/; HttpOnly
90
+ X-Request-Id:
91
+ - 190781af-169d-4640-95a6-5e08ae195067
92
+ X-Runtime:
93
+ - '0.209304'
94
+ Transfer-Encoding:
95
+ - chunked
96
+ body:
97
+ encoding: ASCII-8BIT
98
+ string: !binary |-
99
+ ewogICJ0b3RhbCI6IDQsCiAgInN1YnRvdGFsIjogNCwKICAicGFnZSI6IDEs
100
+ CiAgInBlcl9wYWdlIjogMjAsCiAgInNlYXJjaCI6IG51bGwsCiAgInNvcnQi
101
+ OiB7CiAgICAiYnkiOiBudWxsLAogICAgIm9yZGVyIjogbnVsbAogIH0sCiAg
102
+ InJlc3VsdHMiOiBbeyJpZCI6ImZvcmVtYW4tdGFza3MiLCJuYW1lIjoiZm9y
103
+ ZW1hbi10YXNrcyIsImF1dGhvciI6Ikl2YW4gTmXEjWFzIiwiZGVzY3JpcHRp
104
+ b24iOiJUaGUgZ29hbCBvZiB0aGlzIHBsdWdpbiBpcyB0byB1bmlmeSB0aGUg
105
+ d2F5IG9mIHNob3dpbmcgdGFzayBzdGF0dXNlcyBhY3Jvc3MgdGhlIEZvcmVt
106
+ YW4gaW5zdGFuY2UuXG5JdCBkZWZpbmVzIFRhc2sgbW9kZWwgZm9yIGtlZXBp
107
+ bmcgdGhlIGluZm9ybWF0aW9uIGFib3V0IHRoZSB0YXNrcyBhbmQgTG9jayBm
108
+ b3IgYXNzaWduaW5nIHRoZSB0YXNrc1xudG8gcmVzb3VyY2VzLiBUaGUgbG9j
109
+ a2luZyBhbGxvd3MgZGVhbGluZyB3aXRoIHByZXZlbnRpbmcgbXVsdGlwbGUg
110
+ Y29sbGlkaW5nIHRhc2tzIHRvIGJlIHJ1biBvbiB0aGVcbnNhbWUgcmVzb3Vy
111
+ Y2UuIEl0IGFsc28gb3B0aW9uYWxseSBwcm92aWRlcyBEeW5mbG93IGluZnJh
112
+ c3RydWN0dXJlIGZvciB1c2luZyBpdCBmb3IgbWFuYWdpbmcgdGhlIHRhc2tz
113
+ LlxuIiwidXJsIjoiaHR0cHM6Ly9naXRodWIuY29tL3RoZWZvcmVtYW4vZm9y
114
+ ZW1hbi10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ZW1hbiIsInVybCI6Imh0dHA6Ly93d3cua2F0ZWxsby5vcmciLCJ2ZXJz
131
+ aW9uIjoiMy4yLjAifV0KfQo=
132
+ http_version:
133
+ recorded_at: Tue, 16 Aug 2016 19:07:56 GMT
134
+ - request:
135
+ method: get
136
+ uri: http://admin:changeme@katello:3000/katello/api/organizations?per_page=999999
137
+ body:
138
+ encoding: US-ASCII
139
+ string: ''
140
+ headers:
141
+ Accept:
142
+ - application/json;version=2
143
+ Accept-Encoding:
144
+ - gzip, deflate
145
+ Content-Type:
146
+ - application/json
147
+ User-Agent:
148
+ - Ruby
149
+ response:
150
+ status:
151
+ code: 200
152
+ message: OK
153
+ headers:
154
+ X-Frame-Options:
155
+ - SAMEORIGIN
156
+ X-Xss-Protection:
157
+ - 1; mode=block
158
+ X-Content-Type-Options:
159
+ - nosniff
160
+ Foreman-Version:
161
+ - 1.13.0-develop
162
+ Foreman-Api-Version:
163
+ - '2'
164
+ Content-Type:
165
+ - application/json; charset=utf-8
166
+ Apipie-Checksum:
167
+ - e98945ba1db6bdbb4c25ce4988912344
168
+ Etag:
169
+ - W/"4334603e104dcf3bf9d4222dd9a77b6a"
170
+ Cache-Control:
171
+ - max-age=0, private, must-revalidate
172
+ Set-Cookie:
173
+ - _session_id=681c0d55e6bbb4adfce557ea81d3789f; path=/; HttpOnly
174
+ X-Request-Id:
175
+ - c18d9b8f-3f91-4dad-a09c-0f97471e7ca7
176
+ X-Runtime:
177
+ - '0.259700'
178
+ Transfer-Encoding:
179
+ - chunked
180
+ body:
181
+ encoding: UTF-8
182
+ string: |
183
+ {
184
+ "total": 3,
185
+ "subtotal": 3,
186
+ "page": 1,
187
+ "per_page": 999999,
188
+ "search": null,
189
+ "sort": {
190
+ "by": null,
191
+ "order": null
192
+ },
193
+ "results": [{"label":"Default_Organization","created_at":"2016-08-10 12:38:23 UTC","updated_at":"2016-08-10 12:38:23 UTC","id":1,"name":"Default Organization","title":"Default Organization","description":null},{"label":"examplecorp","created_at":"2016-08-10 13:40:47 UTC","updated_at":"2016-08-10 13:40:47 UTC","id":3,"name":"Example Corporation","title":"Example Corporation","description":"The number one example company in the world!"},{"label":"testcorp","created_at":"2016-08-16 12:46:24 UTC","updated_at":"2016-08-16 12:46:24 UTC","id":4,"name":"Test Corporation","title":"Test Corporation","description":"Testing today for a better tomorrow"}]
194
+ }
195
+ http_version:
196
+ recorded_at: Tue, 16 Aug 2016 19:07:56 GMT
197
+ - request:
198
+ method: get
199
+ uri: http://admin:changeme@katello:3000/katello/api/organizations/4
200
+ body:
201
+ encoding: US-ASCII
202
+ string: ''
203
+ headers:
204
+ Accept:
205
+ - application/json;version=2
206
+ Accept-Encoding:
207
+ - gzip, deflate
208
+ Content-Type:
209
+ - application/json
210
+ User-Agent:
211
+ - Ruby
212
+ response:
213
+ status:
214
+ code: 200
215
+ message: OK
216
+ headers:
217
+ X-Frame-Options:
218
+ - SAMEORIGIN
219
+ X-Xss-Protection:
220
+ - 1; mode=block
221
+ X-Content-Type-Options:
222
+ - nosniff
223
+ Foreman-Version:
224
+ - 1.13.0-develop
225
+ Foreman-Api-Version:
226
+ - '2'
227
+ Content-Type:
228
+ - application/json; charset=utf-8
229
+ Apipie-Checksum:
230
+ - e98945ba1db6bdbb4c25ce4988912344
231
+ Etag:
232
+ - W/"b5577d462bb47ed33171b7965924a357"
233
+ Cache-Control:
234
+ - max-age=0, private, must-revalidate
235
+ Set-Cookie:
236
+ - _session_id=0b38e2e65c2972c62aa1ad297e9244d4; path=/; HttpOnly
237
+ X-Request-Id:
238
+ - 9750eb67-4bf4-4551-b698-3a0f8efad5d8
239
+ X-Runtime:
240
+ - '3.796441'
241
+ Transfer-Encoding:
242
+ - chunked
243
+ body:
244
+ encoding: UTF-8
245
+ string: '{"label":"testcorp","owner_details":{"parentOwner":null,"id":"4028f901567474d4015693638d7c155a","key":"testcorp","displayName":"Test
246
+ Corporation","contentPrefix":"/testcorp/$env","defaultServiceLevel":null,"upstreamConsumer":{"id":"4028f901567474d4015693796d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IdfAmBYPWBqbwf80croGh\nY5xBcNqRw3cxfi0joE+LY4brEW5vJF8DnxhEX0eIJtjas+zb3ckeUJgYIyirXdHJ\nqrAANWjUfh9JFehwjAigx6TnGK+pr+zpbKTX9O7lhmvsCf+82NVlZmY342IUE8Ss\npWjhsydl8NT80fGJV/1fwpgyos9EvpjayXh9bYxZhDkiHaUUL/WBInEdyi4xFJgf\nPXnaV+2q48/3oOVZa2Ng/vcaBG5nEZYvK+jTG205t9d9X9Tp46iH/mvyIH8VIF0H\np/OtIoRnGLjliYP0dHp91G4UTTEpg8Cxa77r77qlwASORsFF8MJGMKMJg/YNO7fQ\nCskpqb7UZfSXmvZ5AIZ/Kzncuj1IvZMLhjMr/QAwSO0/v/GnmSqLwMamM2viq8un\nef2TQy9Xcuxcp0n7mcDHUUaTpiW1tPc5ikUmCUQ2ZuNTjE6Noa0kSV3AHG3TbSkU\n+qT9B5RSL1YBAEw5xwttvjlju2jaYaYT6xI4LioXIVJ8lEwdrggxmqTj1ArgqP2c\nHAtS6vziTnwbP+sS3g==\n-----END
249
+ CERTIFICATE-----\n","id":"4028f901567474d4015693796d151561","serial":{"id":3577432943086335221,"revoked":false,"collected":false,"expiration":"2017-08-16T12:29:31.000+0000","serial":3577432943086335221,"created":"2016-08-16T13:10:23.762+0000","updated":"2016-08-16T13:10:23.762+0000"},"created":"2016-08-16T13:10:23.765+0000","updated":"2016-08-16T13:10:23.765+0000"},"type":{"id":"4028f901567474d4015674b03e910005","label":"satellite","manifest":true,"created":"2016-08-10T13:42:02.641+0000","updated":"2016-08-10T13:42:02.641+0000"},"ownerId":"4028f901567474d4015693638d7c155a","webUrl":"access.stage.redhat.com/management/distributors/","apiUrl":"https://subscription.rhn.stage.redhat.com/subscription/consumers/","created":"2016-08-16T13:10:23.772+0000","updated":"2016-08-16T13:10:23.772+0000"},"logLevel":null,"href":"/owners/testcorp","created":"2016-08-16T12:46:30.268+0000","updated":"2016-08-16T13:10:23.871+0000"},"redhat_repository_url":"https://cdn.redhat.com","service_levels":["Premium","Standard"],"service_level":null,"select_all_types":[],"description":"Testing
250
+ today for a better tomorrow","created_at":"2016-08-16 12:46:24 UTC","updated_at":"2016-08-16
251
+ 12:46:24 UTC","ancestry":null,"parent_id":null,"parent_name":null,"id":4,"name":"Test
252
+ Corporation","title":"Test Corporation","users":[],"smart_proxies":[],"subnets":[],"compute_resources":[],"media":[],"config_templates":[{"id":7,"name":"Alterator
253
+ default","template_kind_id":4,"template_kind_name":"provision"},{"id":8,"name":"Alterator
254
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":9,"name":"Alterator
255
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":44,"name":"alterator_pkglist","template_kind_id":null,"template_kind_name":null},{"id":10,"name":"Atomic
256
+ Kickstart default","template_kind_id":4,"template_kind_name":"provision"},{"id":11,"name":"AutoYaST
257
+ default","template_kind_id":4,"template_kind_name":"provision"},{"id":14,"name":"AutoYaST
258
+ default iPXE","template_kind_id":3,"template_kind_name":"iPXE"},{"id":13,"name":"AutoYaST
259
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":12,"name":"AutoYaST
260
+ SLES default","template_kind_id":4,"template_kind_name":"provision"},{"id":45,"name":"chef_client","template_kind_id":null,"template_kind_name":null},{"id":46,"name":"coreos_cloudconfig","template_kind_id":null,"template_kind_name":null},{"id":15,"name":"CoreOS
261
+ provision","template_kind_id":4,"template_kind_name":"provision"},{"id":16,"name":"CoreOS
262
+ PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":47,"name":"epel","template_kind_id":null,"template_kind_name":null},{"id":48,"name":"fix_hosts","template_kind_id":null,"template_kind_name":null},{"id":17,"name":"FreeBSD
263
+ (mfsBSD) finish","template_kind_id":5,"template_kind_name":"finish"},{"id":18,"name":"FreeBSD
264
+ (mfsBSD) provision","template_kind_id":4,"template_kind_name":"provision"},{"id":19,"name":"FreeBSD
265
+ (mfsBSD) PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":49,"name":"freeipa_register","template_kind_id":null,"template_kind_name":null},{"id":20,"name":"Grubby
266
+ default","template_kind_id":6,"template_kind_name":"script"},{"id":50,"name":"http_proxy","template_kind_id":null,"template_kind_name":null},{"id":21,"name":"Jumpstart
267
+ default","template_kind_id":4,"template_kind_name":"provision"},{"id":22,"name":"Jumpstart
268
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":23,"name":"Jumpstart
269
+ default PXEGrub","template_kind_id":2,"template_kind_name":"PXEGrub"},{"id":26,"name":"Junos
270
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":24,"name":"Junos
271
+ default SLAX","template_kind_id":4,"template_kind_name":"provision"},{"id":25,"name":"Junos
272
+ default ZTP config","template_kind_id":8,"template_kind_name":"ZTP"},{"id":77,"name":"Katello
273
+ Atomic Kickstart Default","template_kind_id":4,"template_kind_name":"provision"},{"id":73,"name":"Katello
274
+ Kickstart Default","template_kind_id":4,"template_kind_name":"provision"},{"id":75,"name":"Katello
275
+ Kickstart Default Finish","template_kind_id":5,"template_kind_name":"finish"},{"id":74,"name":"Katello
276
+ Kickstart Default User Data","template_kind_id":7,"template_kind_name":"user_data"},{"id":27,"name":"Kickstart
277
+ default","template_kind_id":4,"template_kind_name":"provision"},{"id":29,"name":"Kickstart
278
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":31,"name":"Kickstart
279
+ default iPXE","template_kind_id":3,"template_kind_name":"iPXE"},{"id":30,"name":"Kickstart
280
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":32,"name":"Kickstart
281
+ default user data","template_kind_id":7,"template_kind_name":"user_data"},{"id":51,"name":"kickstart_networking_setup","template_kind_id":null,"template_kind_name":null},{"id":28,"name":"Kickstart
282
+ RHEL default","template_kind_id":4,"template_kind_name":"provision"},{"id":33,"name":"NX-OS
283
+ default POAP setup","template_kind_id":9,"template_kind_name":"POAP"},{"id":34,"name":"Preseed
284
+ default","template_kind_id":4,"template_kind_name":"provision"},{"id":35,"name":"Preseed
285
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":37,"name":"Preseed
286
+ default iPXE","template_kind_id":3,"template_kind_name":"iPXE"},{"id":36,"name":"Preseed
287
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":38,"name":"Preseed
288
+ default user data","template_kind_id":7,"template_kind_name":"user_data"},{"id":52,"name":"preseed_networking_setup","template_kind_id":null,"template_kind_name":null},{"id":53,"name":"puppet.conf","template_kind_id":null,"template_kind_name":null},{"id":54,"name":"puppet_setup","template_kind_id":null,"template_kind_name":null},{"id":4,"name":"PXEGrub
289
+ default local boot","template_kind_id":2,"template_kind_name":"PXEGrub"},{"id":5,"name":"PXELinux
290
+ chain iPXE","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":6,"name":"PXELinux
291
+ chain iPXE UNDI","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":2,"name":"PXELinux
292
+ default local boot","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":3,"name":"PXELinux
293
+ default memdisk","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":55,"name":"pxelinux_discovery","template_kind_id":null,"template_kind_name":null},{"id":1,"name":"PXELinux
294
+ global default","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":56,"name":"redhat_register","template_kind_id":null,"template_kind_name":null},{"id":57,"name":"remote_execution_ssh_keys","template_kind_id":null,"template_kind_name":null},{"id":58,"name":"saltstack_minion","template_kind_id":null,"template_kind_name":null},{"id":59,"name":"saltstack_setup","template_kind_id":null,"template_kind_name":null},{"id":76,"name":"subscription_manager_registration","template_kind_id":null,"template_kind_name":null},{"id":39,"name":"UserData
295
+ default","template_kind_id":7,"template_kind_name":"user_data"},{"id":40,"name":"WAIK
296
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":41,"name":"XenServer
297
+ default answerfile","template_kind_id":4,"template_kind_name":"provision"},{"id":42,"name":"XenServer
298
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":43,"name":"XenServer
299
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"}],"ptables":[{"os_family":"Suse","created_at":"2016-08-10
300
+ 12:38:25 UTC","updated_at":"2016-08-10 12:38:25 UTC","name":"AutoYaST entire
301
+ SCSI disk","id":60},{"os_family":"Suse","created_at":"2016-08-10 12:38:25
302
+ UTC","updated_at":"2016-08-10 12:38:25 UTC","name":"AutoYaST entire virtual
303
+ disk","id":61},{"os_family":"Suse","created_at":"2016-08-10 12:38:25 UTC","updated_at":"2016-08-10
304
+ 12:38:25 UTC","name":"AutoYaST LVM","id":62},{"os_family":"Coreos","created_at":"2016-08-10
305
+ 12:38:25 UTC","updated_at":"2016-08-10 12:38:25 UTC","name":"CoreOS default
306
+ fake","id":63},{"os_family":"Freebsd","created_at":"2016-08-10 12:38:25 UTC","updated_at":"2016-08-10
307
+ 12:38:25 UTC","name":"FreeBSD","id":64},{"os_family":"Solaris","created_at":"2016-08-10
308
+ 12:38:25 UTC","updated_at":"2016-08-10 12:38:25 UTC","name":"Jumpstart default","id":65},{"os_family":"Solaris","created_at":"2016-08-10
309
+ 12:38:25 UTC","updated_at":"2016-08-10 12:38:25 UTC","name":"Jumpstart mirrored","id":66},{"os_family":"Junos","created_at":"2016-08-10
310
+ 12:38:25 UTC","updated_at":"2016-08-10 12:38:25 UTC","name":"Junos default
311
+ fake","id":67},{"os_family":"Redhat","created_at":"2016-08-10 12:38:25 UTC","updated_at":"2016-08-10
312
+ 12:38:25 UTC","name":"Kickstart default","id":68},{"os_family":"NXOS","created_at":"2016-08-10
313
+ 12:38:25 UTC","updated_at":"2016-08-10 12:38:25 UTC","name":"NX-OS default
314
+ fake","id":69},{"os_family":"Debian","created_at":"2016-08-10 12:38:25 UTC","updated_at":"2016-08-10
315
+ 12:38:25 UTC","name":"Preseed custom LVM","id":71},{"os_family":"Debian","created_at":"2016-08-10
316
+ 12:38:25 UTC","updated_at":"2016-08-10 12:38:25 UTC","name":"Preseed default","id":70},{"os_family":"Xenserver","created_at":"2016-08-10
317
+ 12:38:25 UTC","updated_at":"2016-08-10 12:38:25 UTC","name":"XenServer default","id":72}],"provisioning_templates":[{"id":7,"name":"Alterator
318
+ default","template_kind_id":4,"template_kind_name":"provision"},{"id":8,"name":"Alterator
319
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":9,"name":"Alterator
320
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":44,"name":"alterator_pkglist","template_kind_id":null,"template_kind_name":null},{"id":10,"name":"Atomic
321
+ Kickstart default","template_kind_id":4,"template_kind_name":"provision"},{"id":11,"name":"AutoYaST
322
+ default","template_kind_id":4,"template_kind_name":"provision"},{"id":14,"name":"AutoYaST
323
+ default iPXE","template_kind_id":3,"template_kind_name":"iPXE"},{"id":13,"name":"AutoYaST
324
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":12,"name":"AutoYaST
325
+ SLES default","template_kind_id":4,"template_kind_name":"provision"},{"id":45,"name":"chef_client","template_kind_id":null,"template_kind_name":null},{"id":46,"name":"coreos_cloudconfig","template_kind_id":null,"template_kind_name":null},{"id":15,"name":"CoreOS
326
+ provision","template_kind_id":4,"template_kind_name":"provision"},{"id":16,"name":"CoreOS
327
+ PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":47,"name":"epel","template_kind_id":null,"template_kind_name":null},{"id":48,"name":"fix_hosts","template_kind_id":null,"template_kind_name":null},{"id":17,"name":"FreeBSD
328
+ (mfsBSD) finish","template_kind_id":5,"template_kind_name":"finish"},{"id":18,"name":"FreeBSD
329
+ (mfsBSD) provision","template_kind_id":4,"template_kind_name":"provision"},{"id":19,"name":"FreeBSD
330
+ (mfsBSD) PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":49,"name":"freeipa_register","template_kind_id":null,"template_kind_name":null},{"id":20,"name":"Grubby
331
+ default","template_kind_id":6,"template_kind_name":"script"},{"id":50,"name":"http_proxy","template_kind_id":null,"template_kind_name":null},{"id":21,"name":"Jumpstart
332
+ default","template_kind_id":4,"template_kind_name":"provision"},{"id":22,"name":"Jumpstart
333
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":23,"name":"Jumpstart
334
+ default PXEGrub","template_kind_id":2,"template_kind_name":"PXEGrub"},{"id":26,"name":"Junos
335
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":24,"name":"Junos
336
+ default SLAX","template_kind_id":4,"template_kind_name":"provision"},{"id":25,"name":"Junos
337
+ default ZTP config","template_kind_id":8,"template_kind_name":"ZTP"},{"id":77,"name":"Katello
338
+ Atomic Kickstart Default","template_kind_id":4,"template_kind_name":"provision"},{"id":73,"name":"Katello
339
+ Kickstart Default","template_kind_id":4,"template_kind_name":"provision"},{"id":75,"name":"Katello
340
+ Kickstart Default Finish","template_kind_id":5,"template_kind_name":"finish"},{"id":74,"name":"Katello
341
+ Kickstart Default User Data","template_kind_id":7,"template_kind_name":"user_data"},{"id":27,"name":"Kickstart
342
+ default","template_kind_id":4,"template_kind_name":"provision"},{"id":29,"name":"Kickstart
343
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":31,"name":"Kickstart
344
+ default iPXE","template_kind_id":3,"template_kind_name":"iPXE"},{"id":30,"name":"Kickstart
345
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":32,"name":"Kickstart
346
+ default user data","template_kind_id":7,"template_kind_name":"user_data"},{"id":51,"name":"kickstart_networking_setup","template_kind_id":null,"template_kind_name":null},{"id":28,"name":"Kickstart
347
+ RHEL default","template_kind_id":4,"template_kind_name":"provision"},{"id":33,"name":"NX-OS
348
+ default POAP setup","template_kind_id":9,"template_kind_name":"POAP"},{"id":34,"name":"Preseed
349
+ default","template_kind_id":4,"template_kind_name":"provision"},{"id":35,"name":"Preseed
350
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":37,"name":"Preseed
351
+ default iPXE","template_kind_id":3,"template_kind_name":"iPXE"},{"id":36,"name":"Preseed
352
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":38,"name":"Preseed
353
+ default user data","template_kind_id":7,"template_kind_name":"user_data"},{"id":52,"name":"preseed_networking_setup","template_kind_id":null,"template_kind_name":null},{"id":53,"name":"puppet.conf","template_kind_id":null,"template_kind_name":null},{"id":54,"name":"puppet_setup","template_kind_id":null,"template_kind_name":null},{"id":4,"name":"PXEGrub
354
+ default local boot","template_kind_id":2,"template_kind_name":"PXEGrub"},{"id":5,"name":"PXELinux
355
+ chain iPXE","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":6,"name":"PXELinux
356
+ chain iPXE UNDI","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":2,"name":"PXELinux
357
+ default local boot","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":3,"name":"PXELinux
358
+ default memdisk","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":55,"name":"pxelinux_discovery","template_kind_id":null,"template_kind_name":null},{"id":1,"name":"PXELinux
359
+ global default","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":56,"name":"redhat_register","template_kind_id":null,"template_kind_name":null},{"id":57,"name":"remote_execution_ssh_keys","template_kind_id":null,"template_kind_name":null},{"id":58,"name":"saltstack_minion","template_kind_id":null,"template_kind_name":null},{"id":59,"name":"saltstack_setup","template_kind_id":null,"template_kind_name":null},{"id":76,"name":"subscription_manager_registration","template_kind_id":null,"template_kind_name":null},{"id":39,"name":"UserData
360
+ default","template_kind_id":7,"template_kind_name":"user_data"},{"id":40,"name":"WAIK
361
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"},{"id":41,"name":"XenServer
362
+ default answerfile","template_kind_id":4,"template_kind_name":"provision"},{"id":42,"name":"XenServer
363
+ default finish","template_kind_id":5,"template_kind_name":"finish"},{"id":43,"name":"XenServer
364
+ default PXELinux","template_kind_id":1,"template_kind_name":"PXELinux"}],"domains":[],"realms":[],"environments":[],"hostgroups":[],"locations":[],"parameters":[],"default_content_view_id":4,"library_id":7}'
365
+ http_version:
366
+ recorded_at: Tue, 16 Aug 2016 19:08:00 GMT
367
+ - request:
368
+ method: get
369
+ uri: http://admin:changeme@katello:3000/katello/api/organizations/4/subscriptions?per_page=999999
370
+ body:
371
+ encoding: US-ASCII
372
+ string: ''
373
+ headers:
374
+ Accept:
375
+ - application/json;version=2
376
+ Accept-Encoding:
377
+ - gzip, deflate
378
+ Content-Type:
379
+ - application/json
380
+ User-Agent:
381
+ - Ruby
382
+ response:
383
+ status:
384
+ code: 200
385
+ message: OK
386
+ headers:
387
+ X-Frame-Options:
388
+ - SAMEORIGIN
389
+ X-Xss-Protection:
390
+ - 1; mode=block
391
+ X-Content-Type-Options:
392
+ - nosniff
393
+ Foreman-Version:
394
+ - 1.13.0-develop
395
+ Foreman-Api-Version:
396
+ - '2'
397
+ Content-Type:
398
+ - application/json; charset=utf-8
399
+ Apipie-Checksum:
400
+ - e98945ba1db6bdbb4c25ce4988912344
401
+ Etag:
402
+ - W/"5814c3d87ac21748ae8ed264bdad9c12"
403
+ Cache-Control:
404
+ - max-age=0, private, must-revalidate
405
+ Set-Cookie:
406
+ - _session_id=e229838a42f85b4e2bd8a18ac52a4941; path=/; HttpOnly
407
+ X-Request-Id:
408
+ - a4bf898b-7ca6-4129-969b-c17deba5bc79
409
+ X-Runtime:
410
+ - '1.993998'
411
+ Transfer-Encoding:
412
+ - chunked
413
+ body:
414
+ encoding: UTF-8
415
+ string: |
416
+ {"organization":{},"total":2,"subtotal":2,"page":1,"per_page":"999999","error":null,"search":null,"sort":{"by":null,"order":null},"results":[{"id":79,"cp_id":"4028f901567474d40156937974d915e3","subscription_id":59,"name":"Red Hat Enterprise Linux for Virtual Datacenters, Standard","start_date":"2016-06-20T04:00:00.000+0000","end_date":"2017-06-20T03:59:59.000+0000","available":1,"quantity":1,"consumed":0,"account_number":5700573,"contract_number":10999110,"support_level":"Standard","product_id":"RH00002","sockets":2,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":0,"multi_entitlement":true,"type":"NORMAL","product_name":"Red Hat Enterprise Linux for Virtual Datacenters, Standard","unmapped_guest":false,"virt_only":false},{"id":81,"cp_id":"4028f901567474d40156937975bd1635","subscription_id":60,"name":"Red Hat Enterprise Linux for Virtual Datacenters, Premium","start_date":"2016-06-20T04:00:00.000+0000","end_date":"2017-06-20T03:59:59.000+0000","available":1,"quantity":1,"consumed":0,"account_number":5700573,"contract_number":10999116,"support_level":"Premium","product_id":"RH00001","sockets":2,"cores":null,"ram":null,"instance_multiplier":1,"stacking_id":0,"multi_entitlement":true,"type":"NORMAL","product_name":"Red Hat Enterprise Linux for Virtual Datacenters, Premium","unmapped_guest":false,"virt_only":false}]}
417
+ http_version:
418
+ recorded_at: Tue, 16 Aug 2016 19:08:02 GMT
419
+ recorded_with: VCR 3.0.3
data/test/import_test.rb CHANGED
@@ -1,13 +1,28 @@
1
1
  require File.join(File.dirname(__FILE__), 'csv_test_helper')
2
2
 
3
- require 'stringio'
4
- require 'tempfile'
5
-
6
3
  describe 'import' do
7
4
  extend CommandTestHelper
8
5
 
9
- before :each do
10
- HammerCLI::Settings.load_from_file 'test/config.yml'
6
+ context "help" do
7
+ it "displays supported options" do
8
+ set_user 'admin'
9
+
10
+ stdout,stderr = capture {
11
+ hammer.run(%W{csv import --help})
12
+ }
13
+ stderr.must_equal ''
14
+ stdout.must_equal <<-HELP
15
+ Usage:
16
+ csv import [OPTIONS]
17
+
18
+ Options:
19
+ --dir DIRECTORY directory to import from
20
+ --organization ORGANIZATION Only process organization matching this name
21
+ --settings FILE csv file for settings
22
+ -h, --help print help
23
+ -v, --verbose be verbose
24
+ HELP
25
+ end
11
26
  end
12
27
 
13
28
  context "--dir" do
@@ -19,26 +34,6 @@ describe 'import' do
19
34
  stdout.must_equal(
20
35
  <<-eos
21
36
  Skipping settings because 'does-not-exist/settings.csv' does not exist
22
- Skipping organizations because 'does-not-exist/organizations.csv' does not exist
23
- Skipping locations because 'does-not-exist/locations.csv' does not exist
24
- Skipping puppet_environments because 'does-not-exist/puppet-environments.csv' does not exist
25
- Skipping operating_systems because 'does-not-exist/operating-systems.csv' does not exist
26
- Skipping domains because 'does-not-exist/domains.csv' does not exist
27
- Skipping architectures because 'does-not-exist/architectures.csv' does not exist
28
- Skipping partition_tables because 'does-not-exist/partition-tables.csv' does not exist
29
- Skipping lifecycle_environments because 'does-not-exist/lifecycle-environments.csv' does not exist
30
- Skipping host_collections because 'does-not-exist/host-collections.csv' does not exist
31
- Skipping provisioning_templates because 'does-not-exist/provisioning-templates.csv' does not exist
32
- Skipping subscriptions because 'does-not-exist/subscriptions.csv' does not exist
33
- Skipping products because 'does-not-exist/products.csv' does not exist
34
- Skipping content_views because 'does-not-exist/content-views.csv' does not exist
35
- Skipping content_view_filters because 'does-not-exist/content-view_filters.csv' does not exist
36
- Skipping activation_keys because 'does-not-exist/activation-keys.csv' does not exist
37
- Skipping hosts because 'does-not-exist/hosts.csv' does not exist
38
- Skipping content_hosts because 'does-not-exist/content-hosts.csv' does not exist
39
- Skipping reports because 'does-not-exist/reports.csv' does not exist
40
- Skipping roles because 'does-not-exist/roles.csv' does not exist
41
- Skipping users because 'does-not-exist/users.csv' does not exist
42
37
  eos
43
38
  )
44
39
  end
@@ -0,0 +1,72 @@
1
+ require './test/csv_test_helper'
2
+ require './lib/hammer_cli_csv'
3
+
4
+ module Resources
5
+ class TestActivationKeysUsage < MiniTest::Unit::TestCase
6
+ def test_usage
7
+ start_vcr
8
+ set_user 'admin'
9
+
10
+ stdout,stderr = capture {
11
+ hammer.run(%W{csv activation-keys --help})
12
+ }
13
+ assert_equal '', stderr
14
+ assert_equal stdout, <<-HELP
15
+ Usage:
16
+ csv activation-keys [OPTIONS]
17
+
18
+ Options:
19
+ --continue-on-error Continue processing even if individual resource error
20
+ --export Export current data instead of importing
21
+ --file FILE_NAME CSV file (default to /dev/stdout with --export, otherwise required)
22
+ --itemized-subscriptions Export one subscription per row, only process update subscriptions on import
23
+ --organization ORGANIZATION Only process organization matching this name
24
+ -h, --help print help
25
+ -v, --verbose be verbose
26
+ HELP
27
+ stop_vcr
28
+ end
29
+ end
30
+
31
+ class TestActivationKeysImport < MiniTest::Unit::TestCase
32
+ def test_create_and_update
33
+ start_vcr
34
+ set_user 'admin'
35
+
36
+ @name = "testakey1"
37
+
38
+ file = Tempfile.new('activation_keys_test')
39
+ file.write("Name,Organization,Description,Limit,Environment,Content View,Host Collections,Auto-Attach,Service Level,Release Version,Subscriptions\n")
40
+ file.write("#{@name},Test Corporation,,,,Default Organization View,"",No,,,\n")
41
+ file.rewind
42
+
43
+ stdout,stderr = capture {
44
+ hammer.run(%W{csv activation-keys --verbose --file #{file.path}})
45
+ }
46
+ assert_equal '', stderr
47
+ assert_equal stdout[0..-2], "Creating activation key '#{@name}'...done"
48
+
49
+ file.rewind
50
+
51
+ stdout,stderr = capture {
52
+ hammer.run(%W{csv activation-keys --verbose --file #{file.path}})
53
+ }
54
+ assert_equal '', stderr
55
+ assert_equal stdout[0..-2], "Updating activation key '#{@name}'...done"
56
+ file.unlink
57
+
58
+ stdout,stderr = capture {
59
+ hammer.run(%W(activation-key list --organization Test\ Corporation --search name=#{@name}))
60
+ }
61
+ assert_equal '', stderr
62
+ assert_equal stdout.split("\n").length, 5
63
+
64
+ id = stdout.split("\n")[3].split(" ")[0]
65
+ stdout,stderr = capture {
66
+ hammer.run(%W(activation-key delete --id #{id}))
67
+ }
68
+
69
+ stop_vcr
70
+ end
71
+ end
72
+ end