foreman_scc_manager 1.8.8 → 1.8.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -8
- data/Rakefile +5 -9
- data/app/controllers/api/v2/scc_products_controller.rb +14 -3
- data/app/controllers/scc_accounts_controller.rb +3 -3
- data/app/lib/scc_manager.rb +5 -9
- data/app/models/scc_account.rb +8 -13
- data/app/models/scc_repository.rb +2 -2
- data/config/routes.rb +1 -1
- data/db/migrate/20210713092440_add_permissions.rb +19 -0
- data/db/migrate/20211022100718_add_product_class_to_scc_product.rb +5 -0
- data/lib/foreman_scc_manager/engine.rb +26 -6
- data/lib/foreman_scc_manager/version.rb +1 -1
- data/locale/de/foreman_scc_manager.edit.po +125 -128
- data/locale/en/foreman_scc_manager.edit.po +99 -103
- data/test/actions/sync_test.rb +24 -0
- data/test/controllers/api/v2/scc_accounts_test.rb +46 -1
- data/test/controllers/api/v2/scc_products_test.rb +21 -1
- data/test/controllers/scc_accounts_controller_test.rb +51 -1
- data/test/controllers/scc_accounts_controller_test2.rb +2 -0
- data/test/fixtures/models/katello_products.yml.bak +10 -0
- data/test/fixtures/models/scc_accounts.yml +2 -0
- data/test/fixtures/models/scc_products.yml +18 -3
- data/test/models/katello_products.rb +10 -0
- data/test/models/scc_product_test.rb +1 -1
- data/test/test_controller_helper.rb +6 -2
- data/test/test_plugin_helper.rb +2 -0
- data/test/unit/access_permissions_test.rb +18 -0
- metadata +24 -8
@@ -10,6 +10,7 @@ one:
|
|
10
10
|
description: "<p> lorem ipsum dolor sit amet </p>"
|
11
11
|
product_type: base
|
12
12
|
subscription_valid: nil
|
13
|
+
product_id: nil
|
13
14
|
|
14
15
|
two:
|
15
16
|
scc_account_id: test_account1
|
@@ -21,6 +22,7 @@ two:
|
|
21
22
|
description: "<p> lorem ipsum dolor sit amet </p><p> lorem lorem lorem </p>"
|
22
23
|
product_type: extras
|
23
24
|
subscription_valid: true
|
25
|
+
product_id: nil
|
24
26
|
|
25
27
|
three:
|
26
28
|
scc_account_id: test_account1
|
@@ -32,18 +34,31 @@ three:
|
|
32
34
|
description: lorem ipsum dolor sit amet
|
33
35
|
product_type: base
|
34
36
|
subscription_valid: nil
|
37
|
+
product_id: 1
|
38
|
+
|
39
|
+
four:
|
40
|
+
scc_account_id: test_account1
|
41
|
+
scc_id: 444
|
42
|
+
name: four
|
43
|
+
version: 4
|
44
|
+
arch: x86_128
|
45
|
+
friendly_name: number four
|
46
|
+
description: lorem ipsum dolor sit amet
|
47
|
+
product_type: base
|
48
|
+
subscription_valid: nil
|
49
|
+
product_id: 2
|
35
50
|
|
36
51
|
# create a couple of products as scc_extensions
|
37
52
|
<% 1.upto(10) do |i| %>
|
38
53
|
p_extension_<%= i %>:
|
39
54
|
scc_account_id: test_account1
|
40
55
|
scc_id: <%= i %>
|
41
|
-
name: p_ext_<%= i%>
|
56
|
+
name: p_ext_<%= i%>
|
42
57
|
version: 3
|
43
58
|
arch: x86_128
|
44
|
-
friendly_name: number <%= i%>
|
59
|
+
friendly_name: number <%= i%>
|
45
60
|
description: lorem ipsum dolor sit amet
|
46
61
|
product_type: extension
|
47
62
|
subscription_valid: nil
|
63
|
+
product_id: nil
|
48
64
|
<% end %>
|
49
|
-
|
@@ -30,7 +30,7 @@ end
|
|
30
30
|
|
31
31
|
class SccProductSearchTest < ActiveSupport::TestCase
|
32
32
|
test 'default ordered by name' do
|
33
|
-
product_names = ['one', 'two', 'three',
|
33
|
+
product_names = ['one', 'two', 'three', 'four',
|
34
34
|
'p_ext_1', 'p_ext_10', 'p_ext_2', 'p_ext_3',
|
35
35
|
'p_ext_4', 'p_ext_5', 'p_ext_6', 'p_ext_7',
|
36
36
|
'p_ext_8', 'p_ext_9']
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# This calls the main test_helper in Foreman-core
|
2
4
|
require 'test_helper'
|
3
5
|
# require "#{Katello::Engine.root}/test/katello_test_helper"
|
@@ -10,6 +12,8 @@ module SignInHelper
|
|
10
12
|
end
|
11
13
|
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
+
module ActionDispatch
|
16
|
+
class IntegrationTest
|
17
|
+
include SignInHelper
|
18
|
+
end
|
15
19
|
end
|
data/test/test_plugin_helper.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'test_plugin_helper'
|
4
|
+
require 'unit/shared/access_permissions_test_base'
|
5
|
+
|
6
|
+
# Permissions are added in AccessPermissions with lists of controllers and
|
7
|
+
# actions that they enable access to. For non-admin users, we need to test
|
8
|
+
# that there are permissions available that cover every controller action, else
|
9
|
+
# it can't be delegated and this will lead to parts of the application that
|
10
|
+
# aren't functional for non-admin users.
|
11
|
+
#
|
12
|
+
# In particular, it's important that actions for AJAX requests are added to
|
13
|
+
# an appropriate permission so views using those requests function.
|
14
|
+
class AccessPermissionsTest < ActiveSupport::TestCase
|
15
|
+
include AccessPermissionsTestBase
|
16
|
+
|
17
|
+
check_routes(ForemanSccManager::Engine.routes, [])
|
18
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_scc_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ATIX AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -16,42 +16,48 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 6.3.1
|
20
23
|
type: :development
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
29
|
+
version: '6'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 6.3.1
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rubocop
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
39
|
+
version: 0.89.0
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
46
|
+
version: 0.89.0
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rubocop-rails
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.
|
53
|
+
version: 2.8.1
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.
|
60
|
+
version: 2.8.1
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: webmock
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,6 +164,8 @@ files:
|
|
158
164
|
- db/migrate/20210205082733_add_subscription_valid_to_scc_products_and_repos.rb
|
159
165
|
- db/migrate/20210210104407_add_root_repository_id_to_scc_repository.rb
|
160
166
|
- db/migrate/20210224095050_connect_katello_root_repository_to_scc_repository.rb
|
167
|
+
- db/migrate/20210713092440_add_permissions.rb
|
168
|
+
- db/migrate/20211022100718_add_product_class_to_scc_product.rb
|
161
169
|
- lib/foreman_scc_manager.rb
|
162
170
|
- lib/foreman_scc_manager/engine.rb
|
163
171
|
- lib/foreman_scc_manager/version.rb
|
@@ -175,6 +183,7 @@ files:
|
|
175
183
|
- locale/en/foreman_scc_manager.po.time_stamp
|
176
184
|
- locale/foreman_scc_manager.pot
|
177
185
|
- locale/gemspec.rb
|
186
|
+
- test/actions/sync_test.rb
|
178
187
|
- test/controllers/api/v2/scc_accounts_test.rb
|
179
188
|
- test/controllers/api/v2/scc_products_test.rb
|
180
189
|
- test/controllers/scc_accounts_controller_test.rb
|
@@ -185,15 +194,18 @@ files:
|
|
185
194
|
- test/fixtures/files/data_products_page2.json
|
186
195
|
- test/fixtures/files/data_repositories.json
|
187
196
|
- test/fixtures/files/data_subscriptions.json
|
197
|
+
- test/fixtures/models/katello_products.yml.bak
|
188
198
|
- test/fixtures/models/scc_accounts.yml
|
189
199
|
- test/fixtures/models/scc_extendings.yml
|
190
200
|
- test/fixtures/models/scc_products.yml
|
191
201
|
- test/fixtures/models/scc_repositories.yml
|
202
|
+
- test/models/katello_products.rb
|
192
203
|
- test/models/scc_account_test.rb
|
193
204
|
- test/models/scc_product_test.rb
|
194
205
|
- test/support/fixtures_support.rb
|
195
206
|
- test/test_controller_helper.rb
|
196
207
|
- test/test_plugin_helper.rb
|
208
|
+
- test/unit/access_permissions_test.rb
|
197
209
|
- test/unit/foreman_scc_manager_test.rb
|
198
210
|
homepage: https://www.orcharhino.com/
|
199
211
|
licenses:
|
@@ -219,18 +231,22 @@ signing_key:
|
|
219
231
|
specification_version: 4
|
220
232
|
summary: Suse Customer Center plugin for Foreman
|
221
233
|
test_files:
|
234
|
+
- test/unit/access_permissions_test.rb
|
222
235
|
- test/unit/foreman_scc_manager_test.rb
|
223
236
|
- test/test_controller_helper.rb
|
224
237
|
- test/features/sync_test.rb
|
225
238
|
- test/models/scc_product_test.rb
|
239
|
+
- test/models/katello_products.rb
|
226
240
|
- test/models/scc_account_test.rb
|
227
241
|
- test/factories/foreman_scc_manager_factories.rb
|
228
242
|
- test/controllers/api/v2/scc_accounts_test.rb
|
229
243
|
- test/controllers/api/v2/scc_products_test.rb
|
230
244
|
- test/controllers/scc_accounts_controller_test2.rb
|
231
245
|
- test/controllers/scc_accounts_controller_test.rb
|
246
|
+
- test/actions/sync_test.rb
|
232
247
|
- test/support/fixtures_support.rb
|
233
248
|
- test/fixtures/models/scc_accounts.yml
|
249
|
+
- test/fixtures/models/katello_products.yml.bak
|
234
250
|
- test/fixtures/models/scc_repositories.yml
|
235
251
|
- test/fixtures/models/scc_products.yml
|
236
252
|
- test/fixtures/models/scc_extendings.yml
|