foreman_scc_manager 1.8.0 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,226 +17,173 @@ msgstr ""
17
17
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
18
18
  "\n"
19
19
 
20
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:15
21
- msgid "List all scc_accounts"
20
+ msgid "Actions"
22
21
  msgstr ""
23
22
 
24
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:24
25
- msgid "Show scc_account"
26
- msgstr ""
23
+ msgid "Add SCC account"
24
+ msgstr "Add SCC account"
27
25
 
28
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:32
29
- msgid "Name of the scc_account"
30
- msgstr ""
26
+ msgid "Add SUSE Customer Center Account"
27
+ msgstr "Add SUSE Customer Center Account"
31
28
 
32
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:33 ../app/controllers/api/v2/scc_accounts_controller.rb:64
33
- msgid "Login id of scc_account"
34
- msgstr ""
29
+ msgid "Base URL"
30
+ msgstr "Base URL"
35
31
 
36
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:34 ../app/controllers/api/v2/scc_accounts_controller.rb:65
37
- msgid "Password of scc_account"
32
+ msgid "Bulk subscription of scc_products for scc_account"
38
33
  msgstr ""
39
34
 
40
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:35 ../app/controllers/api/v2/scc_accounts_controller.rb:66
41
- msgid "URL of SUSE for scc_account"
35
+ msgid "Create an scc_account"
42
36
  msgstr ""
43
37
 
44
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:36
45
- msgid "Interval for syncing scc_account"
38
+ msgid "Cron expression is not valid!"
46
39
  msgstr ""
47
40
 
48
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:37
49
- msgid "Last Sync time of scc_account"
41
+ msgid "Delete %s?"
50
42
  msgstr ""
51
43
 
52
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:41
53
- msgid "Create an scc_account"
44
+ msgid "Delete scc_account"
54
45
  msgstr ""
55
46
 
56
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:48
57
- msgid "Update scc_account"
47
+ msgid "Edit %s"
58
48
  msgstr ""
59
49
 
60
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:55
61
- msgid "Delete scc_account"
62
- msgstr ""
50
+ msgid "Failed to add task to queue: %s"
51
+ msgstr "Failed to add task to queue: %s"
63
52
 
64
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:61 ../app/controllers/api/v2/scc_accounts_controller.rb:62
65
- msgid "Test connection for scc_account"
66
- msgstr ""
53
+ msgid "Foreman plugin to sync SUSE Customer Center products and repositories into Katello."
54
+ msgstr "Foreman plugin to sync SUSE Customer Center products and repositories into Katello."
67
55
 
68
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:89
69
- msgid "Sync scc_account"
56
+ msgid "Interval cannot be nil"
70
57
  msgstr ""
71
58
 
72
- #: ../app/controllers/api/v2/scc_accounts_controller.rb:103
73
- msgid "Bulk subscription of scc_products for scc_account"
59
+ msgid "Interval for syncing scc_account"
74
60
  msgstr ""
75
61
 
76
- #: ../app/controllers/api/v2/scc_products_controller.rb:15
77
- msgid "List all products for scc_account"
62
+ msgid "Interval not set correctly"
78
63
  msgstr ""
79
64
 
80
- #: ../app/controllers/api/v2/scc_products_controller.rb:24
81
- msgid "Show an scc_account product"
65
+ msgid "Last Sync time of scc_account"
82
66
  msgstr ""
83
67
 
84
- #: ../app/controllers/api/v2/scc_products_controller.rb:29
85
- msgid "Subscribe product"
86
- msgstr ""
68
+ msgid "Last synced"
69
+ msgstr "Last synced"
87
70
 
88
- #: ../app/controllers/scc_accounts_controller.rb:64
89
- msgid "Sync task started."
90
- msgstr "Sync task started."
71
+ msgid "List all products for scc_account"
72
+ msgstr ""
91
73
 
92
- #: ../app/controllers/scc_accounts_controller.rb:66 ../app/controllers/scc_accounts_controller.rb:86
93
- msgid "Failed to add task to queue: %s"
94
- msgstr "Failed to add task to queue: %s"
74
+ msgid "List all scc_accounts"
75
+ msgstr ""
95
76
 
96
- #: ../app/controllers/scc_accounts_controller.rb:68 ../app/controllers/scc_accounts_controller.rb:88
97
77
  msgid "Lock on SCC account already taken: %s"
98
78
  msgstr "Lock on SCC account already taken: %s"
99
79
 
100
- #: ../app/controllers/scc_accounts_controller.rb:81
101
- msgid "Task to subscribe products started."
80
+ msgid "Login id of scc_account"
81
+ msgstr ""
82
+
83
+ msgid "Name of the scc_account"
102
84
  msgstr ""
103
85
 
104
- #: ../app/controllers/scc_accounts_controller.rb:83
105
86
  msgid "No products selected."
106
87
  msgstr ""
107
88
 
108
- #: ../app/lib/actions/scc_manager/subscribe_product.rb:5
89
+ msgid "Password of scc_account"
90
+ msgstr ""
91
+
92
+ msgid "Please sync your SUSE subscriptions first."
93
+ msgstr "Please sync your SUSE subscriptions first."
94
+
109
95
  msgid "Product already subscribed!"
110
96
  msgstr "Product already subscribed!"
111
97
 
112
- #: ../app/lib/actions/scc_manager/subscribe_product.rb:35 action_names.rb:21
113
- msgid "Subscribe SCC Product"
114
- msgstr "Subscribe SCC Product"
98
+ msgid "Products"
99
+ msgstr ""
115
100
 
116
- #: ../app/lib/actions/scc_manager/sync.rb:27 action_names.rb:22
117
- msgid "Sync SUSE subscriptions"
118
- msgstr "Sync SUSE subscriptions"
101
+ msgid "SUSE Customer Center"
102
+ msgstr "SUSE Customer Center"
119
103
 
120
- #: ../app/lib/actions/scc_manager/sync_plan_account_repositories.rb:31
121
- msgid "Update SUSE repositories %s"
122
- msgstr ""
104
+ msgid "SUSE Customer Center account"
105
+ msgstr "SUSE Customer Center account"
123
106
 
124
- #: ../app/lib/actions/scc_manager/sync_plan_account_repositories.rb:31
125
- msgid "Unknown"
107
+ msgid "SUSE Subscription"
126
108
  msgstr ""
127
109
 
128
- #: ../app/lib/actions/scc_manager/sync_plan_account_repositories.rb:33 action_names.rb:71
129
- msgid "Update SUSE repositories"
110
+ msgid "SUSE Subscription: "
130
111
  msgstr ""
131
112
 
132
- #: ../app/lib/actions/scc_manager/sync_products.rb:34 action_names.rb:72
133
- msgid "Sync SUSE subscriptions (Products)"
134
- msgstr "Sync SUSE subscriptions (Products)"
113
+ msgid "SUSE Subscriptions"
114
+ msgstr "SUSE Subscriptions"
135
115
 
136
- #: ../app/lib/actions/scc_manager/sync_repositories.rb:33 action_names.rb:73
137
- msgid "Sync SUSE subscriptions (Repositories)"
138
- msgstr "Sync SUSE subscriptions (Repositories)"
116
+ msgid "SUSE subscriptions"
117
+ msgstr "SUSE subscriptions"
139
118
 
140
- #: ../app/models/scc_account.rb:59
141
- msgid "never synced"
119
+ msgid "Select products"
142
120
  msgstr ""
143
121
 
144
- #: ../app/models/scc_account.rb:106
145
- msgid "Interval cannot be nil"
122
+ msgid "Show an scc_account product"
146
123
  msgstr ""
147
124
 
148
- #: ../app/models/scc_account.rb:113
149
- msgid "Interval not set correctly"
125
+ msgid "Show scc_account"
150
126
  msgstr ""
151
127
 
152
- #: ../app/models/scc_account.rb:118
153
- msgid "Cron expression is not valid!"
154
- msgstr ""
128
+ msgid "Subscribe SCC Product"
129
+ msgstr "Subscribe SCC Product"
155
130
 
156
- #: ../app/models/scc_account_sync_plan_task_group.rb:5
157
- msgid "SUSE Subscription"
131
+ msgid "Subscribe product"
158
132
  msgstr ""
159
133
 
160
- #: ../app/views/scc_account_sync_plan_task_groups/_scc_account_sync_plan_task_groups.html.erb:1
161
- msgid "SUSE Subscription: "
134
+ msgid "Sync"
135
+ msgstr "Sync"
136
+
137
+ msgid "Sync Date"
162
138
  msgstr ""
163
139
 
164
- #: ../app/views/scc_accounts/_form.html.erb:6
165
- msgid "SUSE Customer Center account"
166
- msgstr "SUSE Customer Center account"
140
+ msgid "Sync SUSE subscriptions"
141
+ msgstr "Sync SUSE subscriptions"
167
142
 
168
- #: ../app/views/scc_accounts/_form.html.erb:13
169
- msgid "Use your 'Organization credentials' obtained from the SUSE Customer Center."
170
- msgstr ""
143
+ msgid "Sync SUSE subscriptions (Products)"
144
+ msgstr "Sync SUSE subscriptions (Products)"
171
145
 
172
- #: ../app/views/scc_accounts/_form.html.erb:15
173
- msgid "Base URL"
174
- msgstr "Base URL"
146
+ msgid "Sync SUSE subscriptions (Repositories)"
147
+ msgstr "Sync SUSE subscriptions (Repositories)"
175
148
 
176
- #: ../app/views/scc_accounts/_form.html.erb:16
177
- msgid "Interval"
149
+ msgid "Sync interval"
178
150
  msgstr ""
179
151
 
180
- #: ../app/views/scc_accounts/_form.html.erb:17
181
- msgid "Sync Date"
152
+ msgid "Sync scc_account"
182
153
  msgstr ""
183
154
 
184
- #: ../app/views/scc_accounts/_form.html.erb:24
185
- msgid "Test Connection"
186
- msgstr "Test Connection"
155
+ msgid "Sync task started."
156
+ msgstr "Sync task started."
187
157
 
188
- #: ../app/views/scc_accounts/edit.html.erb:1
189
- msgid "Edit %s"
158
+ msgid "Task to subscribe products started."
190
159
  msgstr ""
191
160
 
192
- #: ../app/views/scc_accounts/index.html.erb:2
193
- msgid "SUSE subscriptions"
194
- msgstr "SUSE subscriptions"
195
-
196
- #: ../app/views/scc_accounts/index.html.erb:3
197
- msgid "Add SCC account"
198
- msgstr "Add SCC account"
161
+ msgid "Test Connection"
162
+ msgstr "Test Connection"
199
163
 
200
- #: ../app/views/scc_accounts/index.html.erb:9
201
- msgid "Products"
164
+ msgid "Test connection for scc_account"
202
165
  msgstr ""
203
166
 
204
- #: ../app/views/scc_accounts/index.html.erb:10
205
- msgid "Last synced"
206
- msgstr "Last synced"
207
-
208
- #: ../app/views/scc_accounts/index.html.erb:11
209
- msgid "Actions"
167
+ msgid "The sync interval is used to periodically update the SCC authentication tokens of any imported products."
210
168
  msgstr ""
211
169
 
212
- #: ../app/views/scc_accounts/index.html.erb:24
213
- msgid "Select products"
170
+ msgid "URL of SUSE for scc_account"
214
171
  msgstr ""
215
172
 
216
- #: ../app/views/scc_accounts/index.html.erb:25
217
- msgid "Sync"
218
- msgstr "Sync"
219
-
220
- #: ../app/views/scc_accounts/index.html.erb:28
221
- msgid "Delete %s?"
173
+ msgid "Unknown"
222
174
  msgstr ""
223
175
 
224
- #: ../app/views/scc_accounts/new.html.erb:1
225
- msgid "Add SUSE Customer Center Account"
226
- msgstr "Add SUSE Customer Center Account"
176
+ msgid "Update SUSE repositories"
177
+ msgstr ""
227
178
 
228
- #: ../app/views/scc_accounts/show.html.erb:25
229
- msgid "SUSE Customer Center"
230
- msgstr "SUSE Customer Center"
179
+ msgid "Update SUSE repositories %s"
180
+ msgstr ""
231
181
 
232
- #: ../app/views/scc_accounts/show.html.erb:36
233
- msgid "Please sync your SUSE subscriptions first."
234
- msgstr "Please sync your SUSE subscriptions first."
182
+ msgid "Update scc_account"
183
+ msgstr ""
235
184
 
236
- #: ../lib/foreman_scc_manager/engine.rb:64
237
- msgid "SUSE Subscriptions"
238
- msgstr "SUSE Subscriptions"
185
+ msgid "Use your 'Organization credentials' obtained from the SUSE Customer Center."
186
+ msgstr ""
239
187
 
240
- #: gemspec.rb:2
241
- msgid "Foreman plugin to sync SUSE Customer Center products and repositories into Katello."
242
- msgstr "Foreman plugin to sync SUSE Customer Center products and repositories into Katello."
188
+ msgid "never synced"
189
+ msgstr ""
@@ -8,8 +8,8 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: foreman_scc_manager 1.0.0\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2019-11-12 12:27+0000\n"
12
- "PO-Revision-Date: 2019-11-12 12:27+0000\n"
11
+ "POT-Creation-Date: 2020-03-02 13:47+0000\n"
12
+ "PO-Revision-Date: 2020-03-02 13:47+0000\n"
13
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
15
  "Language: \n"
@@ -116,11 +116,11 @@ msgstr ""
116
116
  msgid "Product already subscribed!"
117
117
  msgstr ""
118
118
 
119
- #: ../app/lib/actions/scc_manager/subscribe_product.rb:35 action_names.rb:21
119
+ #: ../app/lib/actions/scc_manager/subscribe_product.rb:35 action_names.rb:68
120
120
  msgid "Subscribe SCC Product"
121
121
  msgstr ""
122
122
 
123
- #: ../app/lib/actions/scc_manager/sync.rb:27 action_names.rb:22
123
+ #: ../app/lib/actions/scc_manager/sync.rb:27 action_names.rb:69
124
124
  msgid "Sync SUSE subscriptions"
125
125
  msgstr ""
126
126
 
@@ -133,15 +133,15 @@ msgid "Unknown"
133
133
  msgstr ""
134
134
 
135
135
  #: ../app/lib/actions/scc_manager/sync_plan_account_repositories.rb:33
136
- #: action_names.rb:71
136
+ #: action_names.rb:70
137
137
  msgid "Update SUSE repositories"
138
138
  msgstr ""
139
139
 
140
- #: ../app/lib/actions/scc_manager/sync_products.rb:34 action_names.rb:72
140
+ #: ../app/lib/actions/scc_manager/sync_products.rb:34 action_names.rb:71
141
141
  msgid "Sync SUSE subscriptions (Products)"
142
142
  msgstr ""
143
143
 
144
- #: ../app/lib/actions/scc_manager/sync_repositories.rb:33 action_names.rb:73
144
+ #: ../app/lib/actions/scc_manager/sync_repositories.rb:33 action_names.rb:72
145
145
  msgid "Sync SUSE subscriptions (Repositories)"
146
146
  msgstr ""
147
147
 
@@ -182,15 +182,21 @@ msgstr ""
182
182
  msgid "Base URL"
183
183
  msgstr ""
184
184
 
185
- #: ../app/views/scc_accounts/_form.html.erb:16
186
- msgid "Interval"
185
+ #: ../app/views/scc_accounts/_form.html.erb:17
186
+ msgid "Sync interval"
187
187
  msgstr ""
188
188
 
189
189
  #: ../app/views/scc_accounts/_form.html.erb:17
190
+ msgid ""
191
+ "The sync interval is used to periodically update the SCC authentication tokens"
192
+ " of any imported products."
193
+ msgstr ""
194
+
195
+ #: ../app/views/scc_accounts/_form.html.erb:18
190
196
  msgid "Sync Date"
191
197
  msgstr ""
192
198
 
193
- #: ../app/views/scc_accounts/_form.html.erb:24
199
+ #: ../app/views/scc_accounts/_form.html.erb:25
194
200
  msgid "Test Connection"
195
201
  msgstr ""
196
202
 
@@ -242,7 +248,7 @@ msgstr ""
242
248
  msgid "Please sync your SUSE subscriptions first."
243
249
  msgstr ""
244
250
 
245
- #: ../lib/foreman_scc_manager/engine.rb:64
251
+ #: ../lib/foreman_scc_manager/engine.rb:66
246
252
  msgid "SUSE Subscriptions"
247
253
  msgstr ""
248
254
 
@@ -19,3 +19,27 @@ two:
19
19
  friendly_name: number two
20
20
  description: lorem ipsum dolor sit amet
21
21
  product_type: extras
22
+
23
+ three:
24
+ scc_account_id: test_account1
25
+ scc_id: 333
26
+ name: three
27
+ version: 3
28
+ arch: x86_128
29
+ friendly_name: number three
30
+ description: lorem ipsum dolor sit amet
31
+ product_type: base
32
+
33
+ # create a couple of products as scc_extensions
34
+ <% 1.upto(10) do |i| %>
35
+ p_extension_<%= i %>:
36
+ scc_account_id: test_account1
37
+ scc_id: <%= i %>
38
+ name: p_ext_<%= i%>
39
+ version: 3
40
+ arch: x86_128
41
+ friendly_name: number <%= i%>
42
+ description: lorem ipsum dolor sit amet
43
+ product_type: extension
44
+ <% end %>
45
+
@@ -0,0 +1,15 @@
1
+ # repositories for testing the empty repository filtering
2
+ <% 1.upto(8) do |i| %>
3
+ repo_<%= i %>:
4
+ id: <%= i %>
5
+ scc_account_id: 1
6
+ scc_id: <%= 63 + i %>
7
+ name: SLE10-Debuginfo-Updates_<%= i %>
8
+ distro_target: sles_<%= i %>
9
+ description: SLE10-Debuginfo-Updates for sles-10-ppc_<%= i %>
10
+ url: https://updates.suse.com/repo/example_<%= i %>
11
+ token: token_<%= i %>
12
+ autorefresh: true
13
+ installer_updates: false
14
+ <% end %>
15
+
@@ -17,7 +17,11 @@ end
17
17
 
18
18
  class SccProductSearchTest < ActiveSupport::TestCase
19
19
  test 'default ordered by name' do
20
- assert_equal SccProduct.all.pluck(:name), ['one', 'two'].sort
20
+ product_names = ['one', 'two', 'three',
21
+ 'p_ext_1', 'p_ext_10', 'p_ext_2', 'p_ext_3',
22
+ 'p_ext_4', 'p_ext_5', 'p_ext_6', 'p_ext_7',
23
+ 'p_ext_8', 'p_ext_9']
24
+ assert_equal SccProduct.all.pluck(:name), product_names.sort
21
25
  end
22
26
 
23
27
  test 'search name' do
@@ -30,3 +34,54 @@ class SccProductSearchTest < ActiveSupport::TestCase
30
34
  assert_empty empty
31
35
  end
32
36
  end
37
+
38
+ # These produt extension tests are pre-tests for the class ProductEmptyRepoAvailableTests.
39
+ # They do not test any direct functionality of the plugin.
40
+ class SccProductExtensionsTest < ActiveSupport::TestCase
41
+ def setup
42
+ @product_with_extensions = scc_products(:one)
43
+ @product_with_extensions.scc_extensions = scc_products.select { |p| p.product_type == 'extension' }
44
+ @product_with_wrong_extensions = scc_products(:two)
45
+ @product_with_wrong_extensions.scc_extensions = [scc_products(:three)]
46
+ @product_without_extensions = scc_products(:three)
47
+ end
48
+
49
+ test 'check product extensions available' do
50
+ assert_equal @product_with_extensions.scc_extensions.count, 10
51
+ assert_not_empty @product_with_extensions.scc_extensions
52
+ assert_empty @product_without_extensions.scc_extensions
53
+ end
54
+
55
+ test 'product extension of correct type' do
56
+ assert_empty(@product_with_extensions.scc_extensions.reject { |p| p.product_type == 'extension' })
57
+ assert_not_empty(@product_with_wrong_extensions.scc_extensions.reject { |p| p.product_type == 'extension' })
58
+ end
59
+ end
60
+
61
+ class SccProductEmptyRepoAvailableTest < ActiveSupport::TestCase
62
+ def setup
63
+ @product_with_repos = scc_products(:one)
64
+ @product_with_repos.scc_extensions = scc_products.select { |p| p.product_type == 'extension' }
65
+ @product_with_repos.scc_repositories = scc_repositories[0..2]
66
+ @product_with_repos.scc_extensions[1].scc_repositories = scc_repositories[3..4]
67
+ @product_with_repos.scc_extensions[2].scc_repositories = scc_repositories[5..7]
68
+ end
69
+
70
+ test 'products with empty repositories' do
71
+ products_with_repos = SccProduct.only_products_with_repos
72
+ assert_equal SccProduct.all.count { |prod| !prod.scc_repositories.empty? }, 3
73
+ assert_equal products_with_repos.count, 3
74
+ end
75
+ end
76
+
77
+ class SccProductNoRepoTest < ActiveSupport::TestCase
78
+ def setup
79
+ @product_with_repos = scc_products(:one)
80
+ @product_with_repos.scc_extensions = scc_products.select { |p| p.product_type == 'extension' }
81
+ end
82
+
83
+ test 'products without any repositories' do
84
+ products_with_repos = SccProduct.only_products_with_repos
85
+ assert_empty products_with_repos
86
+ end
87
+ end