action #136943
Updated by leli over 1 year ago
## Observation
https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/29eb08b71b43cb7f3a0e37c866d081d9c17c2d4b/tests/installation/addon_products_yast2.pm#L25
While it's only in two places, we have code that is repeated, and that could possibly lead to problems should something change in terms of the proxy.scc; for now I'm only raising the flag, but the code seems identical. As this is still being used in few places, it would be a good idea to give it some love.
```
foursixnine@tyr ~/.../openQA/test-distri (newkidontheblock %) $ ag -Q " ('url: http://' . (is_sle('<15') ? 'server-' : 'all-') . get_var('BUILD_SLE'));" -C 8
tests/installation/addon_products_via_SCC_yast2.pm
22- x11_start_program('xterm');
23- turn_off_gnome_screensaver;
24- become_root;
25- # We use image which is registered, so remove previous registration first
26- if (is_sle('>=15')) {
27- cleanup_registration();
28- }
29-
30: my @addon_proxy = ('url: http://' . (is_sle('<15') ? 'server-' : 'all-') . get_var('BUILD_SLE'));
31- # Add every used addon to regurl for proxy SCC, sle12 addons can have different build numbers
32- if (get_var('SCC_ADDONS') && is_sle('<15')) {
33- for my $addon (split(/,/, get_var('SCC_ADDONS', ''))) {
34- my $uc_addon = uc $addon; # change to uppercase to match variable
35- push(@addon_proxy, "\b.$addon-" . get_var("BUILD_$uc_addon"));
36- }
37- }
38-
tests/installation/addon_products_yast2.pm
17-use registration qw(fill_in_registration_data skip_registration register_addons);
18-use List::MoreUtils 'firstidx';
19-
20-sub test_setup {
21- x11_start_program('xterm');
22- turn_off_gnome_screensaver;
23- become_root;
24-
25: my @addon_proxy = ('url: http://' . (is_sle('<15') ? 'server-' : 'all-') . get_var('BUILD_SLE'));
26- # Add every used addon to regurl for proxy SCC, sle12 addons can have different build numbers
27- if (get_var('ADDONS') && is_sle('<15')) {
28- for my $addon (split(/,/, get_var('ADDONS', ''))) {
29- my $uc_addon = uc $addon; # change to uppercase to match variable
30- push(@addon_proxy, "\b.$addon-" . get_var("BUILD_$uc_addon"));
31- }
32- }
33-
```
## Acceptance criteria
**AC1**: Search in code to replace with function in lib to unify handling of addon proxy in the old installer.