Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-firstboot for openSUSE:Factory 
checked in at 2023-12-22 22:40:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-firstboot (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-firstboot.new.28375 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-firstboot"

Fri Dec 22 22:40:35 2023 rev:120 rq:1134619 version:5.0.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-firstboot/yast2-firstboot.changes  
2023-10-20 23:17:50.564874733 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-firstboot.new.28375/yast2-firstboot.changes   
    2023-12-22 22:40:37.234429604 +0100
@@ -1,0 +2,6 @@
+Thu Dec 14 20:38:43 UTC 2023 - Josef Reidinger <jreidin...@suse.com>
+
+- Allow selecting WSL systemd pattern (jsc#PED-5644, jsc#PED-5099)
+- 5.0.1
+
+-------------------------------------------------------------------

Old:
----
  yast2-firstboot-5.0.0.tar.bz2

New:
----
  yast2-firstboot-5.0.1.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-firstboot.spec ++++++
--- /var/tmp/diff_new_pack.dnW2d7/_old  2023-12-22 22:40:38.130462572 +0100
+++ /var/tmp/diff_new_pack.dnW2d7/_new  2023-12-22 22:40:38.130462572 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-firstboot
-Version:        5.0.0
+Version:        5.0.1
 Release:        0
 Summary:        YaST2 - Initial System Configuration
 License:        GPL-2.0-only

++++++ yast2-firstboot-5.0.0.tar.bz2 -> yast2-firstboot-5.0.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-firstboot-5.0.0/.github/workflows/ci.yml 
new/yast2-firstboot-5.0.1/.github/workflows/ci.yml
--- old/yast2-firstboot-5.0.0/.github/workflows/ci.yml  2023-10-18 
23:15:41.000000000 +0200
+++ new/yast2-firstboot-5.0.1/.github/workflows/ci.yml  2023-12-22 
13:06:13.000000000 +0100
@@ -1,9 +1,8 @@
-
 # See 
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
 
 name: CI
 
-on: [push, pull_request]
+on: [ push, pull_request ]
 
 jobs:
   Tests:
@@ -12,36 +11,36 @@
     strategy:
       fail-fast: false
       matrix:
-        distro:  [ "tumbleweed", "leap_latest" ]
+        distro: [ "tumbleweed" ]
 
     container:
       image: 
registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
 
     steps:
+      - name: Git Checkout
+        uses: actions/checkout@v2
 
-    - name: Git Checkout
-      uses: actions/checkout@v2
-
-    - name: Install Dependencies
-      run: zypper --non-interactive install --no-recommends 
yast2-configuration-management yast2-users
-
-    # just for easier debugging...
-    - name: Inspect Installed Packages
-      run: rpm -qa | sort
-
-    - name: Unit Tests
-      run: rake test:unit
-      # enable code coverage reporting
-      env:
-        COVERAGE: 1
-
-    # send the coverage report to coveralls.io
-    - name: Coveralls Report
-      # send it only from the TW build to avoid duplicate submits
-      if: ${{ matrix.distro == 'tumbleweed' }}
-      uses: coverallsapp/github-action@master
-      with:
-        github-token: ${{ secrets.GITHUB_TOKEN }}
+      - name: Install Dependencies
+        run: zypper --non-interactive install --no-recommends
+          yast2-configuration-management yast2-users
+
+      # just for easier debugging...
+      - name: Inspect Installed Packages
+        run: rpm -qa | sort
+
+      - name: Unit Tests
+        run: rake test:unit
+        # enable code coverage reporting
+        env:
+          COVERAGE: 1
+
+      # send the coverage report to coveralls.io
+      - name: Coveralls Report
+        # send it only from the TW build to avoid duplicate submits
+        if: ${{ matrix.distro == 'tumbleweed' }}
+        uses: coverallsapp/github-action@master
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
 
   Rubocop:
     runs-on: ubuntu-latest
@@ -49,18 +48,17 @@
     strategy:
       fail-fast: false
       matrix:
-        distro: [ "leap_latest" ]
+        distro: [ "tumbleweed" ]
 
     container:
       image: 
registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
 
     steps:
+      - name: Git Checkout
+        uses: actions/checkout@v2
 
-    - name: Git Checkout
-      uses: actions/checkout@v2
-
-    - name: Rubocop
-      run: rake check:rubocop
+      - name: Rubocop
+        run: rake check:rubocop
 
   Package:
     runs-on: ubuntu-latest
@@ -68,25 +66,24 @@
     strategy:
       fail-fast: false
       matrix:
-        distro:  [ "tumbleweed", "leap_latest" ]
+        distro: [ "tumbleweed" ]
 
     container:
       image: 
registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
 
     steps:
+      - name: Git Checkout
+        uses: actions/checkout@v2
 
-    - name: Git Checkout
-      uses: actions/checkout@v2
+      - name: Install Dependencies
+        run: zypper --non-interactive install --no-recommends 
docbook-xsl-stylesheets
 
-    - name: Install Dependencies
-      run: zypper --non-interactive install --no-recommends 
docbook-xsl-stylesheets
+      # just for easier debugging...
+      - name: Inspect Installed Packages
+        run: rpm -qa | sort
 
-    # just for easier debugging...
-    - name: Inspect Installed Packages
-      run: rpm -qa | sort
-
-    - name: Package Build
-      run: yast-ci-ruby -o package
+      - name: Package Build
+        run: yast-ci-ruby -o package
 
   Yardoc:
     runs-on: ubuntu-latest
@@ -94,18 +91,17 @@
     strategy:
       fail-fast: false
       matrix:
-        distro: [ "leap_latest" ]
+        distro: [ "tumbleweed" ]
 
     container:
       image: 
registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
 
     steps:
+      - name: Git Checkout
+        uses: actions/checkout@v2
 
-    - name: Git Checkout
-      uses: actions/checkout@v2
-
-    - name: Yardoc
-      run: rake check:doc
+      - name: Yardoc
+        run: rake check:doc
 
   # downloading the Docker image takes some time so bundling several fast
   # checks into one job avoids that overhead
@@ -115,15 +111,14 @@
     strategy:
       fail-fast: false
       matrix:
-        distro: [ "leap_latest" ]
+        distro: [ "tumbleweed" ]
 
     container:
       image: 
registry.opensuse.org/yast/head/containers_${{matrix.distro}}/yast-ruby
 
     steps:
+      - name: Git Checkout
+        uses: actions/checkout@v2
 
-    - name: Git Checkout
-      uses: actions/checkout@v2
-
-    - name: POT Check
-      run: rake check:pot
+      - name: POT Check
+        run: rake check:pot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-firstboot-5.0.0/.rubocop.yml 
new/yast2-firstboot-5.0.1/.rubocop.yml
--- old/yast2-firstboot-5.0.0/.rubocop.yml      2023-10-18 23:15:41.000000000 
+0200
+++ new/yast2-firstboot-5.0.1/.rubocop.yml      2023-12-22 13:06:13.000000000 
+0100
@@ -1,6 +1,6 @@
 # use the shared YaST defaults
 inherit_from:
-  /usr/share/YaST2/data/devtools/data/rubocop-0.71.0_yast_style.yml
+  /usr/share/YaST2/data/devtools/data/rubocop-1.24.1_yast_style.yml
 
 # We need to be sure that everything works fine before enabling it
 Style/FrozenStringLiteralComment:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-firstboot-5.0.0/doc/testing_wsl.md 
new/yast2-firstboot-5.0.1/doc/testing_wsl.md
--- old/yast2-firstboot-5.0.0/doc/testing_wsl.md        1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-firstboot-5.0.1/doc/testing_wsl.md        2023-12-22 
13:06:13.000000000 +0100
@@ -0,0 +1,19 @@
+## Testing WSL Changes
+
+This document serve as reminder how is the optimal way to test changes done 
for WSL firstboot as working with
+windows server can be linux unfriendly and we would like to test without any 
mocking to get the best results.
+
+### Creating Testing APPX
+
+The easiest way is to use OBS. Find the target release for WSL image like 
`SUSE:SLE-15-SP6:Update:WSL`
+and branch there `kiwi-images-wsl` that is responsible for creation of appx. 
In your branch create package
+yast2-firstboot ( as it is usually inherited from target and does not live in 
WSL subproject ) and copy there
+modified sources with rake tarball. It is also mandatory to link or branch 
package `wsl-appx` as it ensures
+that certificate used for appx matches with the one used in kiwi.
+Another important think is to ensure that certificate for home repo is valid 
and not outdated. To check it use
+`osc signkey --sslcert home:...` and if it is invalid use `osc signkey 
--sslcert --create home:...`.
+
+### Installing Modified APPX
+
+Just follow instructions at https://en.opensuse.org/WSL/Manual_Installation
+Appx installer reports quite useless error when there is any issue, so use 
help at https://en.opensuse.org/WSL/Debugging_Hints
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-5.0.0/package/yast2-firstboot.changes 
new/yast2-firstboot-5.0.1/package/yast2-firstboot.changes
--- old/yast2-firstboot-5.0.0/package/yast2-firstboot.changes   2023-10-18 
23:15:41.000000000 +0200
+++ new/yast2-firstboot-5.0.1/package/yast2-firstboot.changes   2023-12-22 
13:06:13.000000000 +0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Thu Dec 14 20:38:43 UTC 2023 - Josef Reidinger <jreidin...@suse.com>
+
+- Allow selecting WSL systemd pattern (jsc#PED-5644, jsc#PED-5099)
+- 5.0.1
+
+-------------------------------------------------------------------
 Wed Aug 30 20:16:10 UTC 2023 - Josef Reidinger <jreidin...@suse.cz>
 
 - 5.0.0 (bsc#1185510)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-firstboot-5.0.0/package/yast2-firstboot.spec 
new/yast2-firstboot-5.0.1/package/yast2-firstboot.spec
--- old/yast2-firstboot-5.0.0/package/yast2-firstboot.spec      2023-10-18 
23:15:41.000000000 +0200
+++ new/yast2-firstboot-5.0.1/package/yast2-firstboot.spec      2023-12-22 
13:06:13.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-firstboot
-Version:        5.0.0
+Version:        5.0.1
 Release:        0
 Summary:        YaST2 - Initial System Configuration
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-5.0.0/src/lib/y2firstboot/clients/hostname.rb 
new/yast2-firstboot-5.0.1/src/lib/y2firstboot/clients/hostname.rb
--- old/yast2-firstboot-5.0.0/src/lib/y2firstboot/clients/hostname.rb   
2023-10-18 23:15:41.000000000 +0200
+++ new/yast2-firstboot-5.0.1/src/lib/y2firstboot/clients/hostname.rb   
2023-12-22 13:06:13.000000000 +0100
@@ -56,6 +56,8 @@
 
       def initialize
         textdomain "firstboot"
+
+        super
       end
 
       def run
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-5.0.0/src/lib/y2firstboot/clients/licenses.rb 
new/yast2-firstboot-5.0.1/src/lib/y2firstboot/clients/licenses.rb
--- old/yast2-firstboot-5.0.0/src/lib/y2firstboot/clients/licenses.rb   
2023-10-18 23:15:41.000000000 +0200
+++ new/yast2-firstboot-5.0.1/src/lib/y2firstboot/clients/licenses.rb   
2023-12-22 13:06:13.000000000 +0100
@@ -34,6 +34,7 @@
       def initialize
         textdomain "firstboot"
 
+        super
         @args = GetInstArgs.argmap
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-5.0.0/src/lib/y2firstboot/clients/wsl.rb 
new/yast2-firstboot-5.0.1/src/lib/y2firstboot/clients/wsl.rb
--- old/yast2-firstboot-5.0.0/src/lib/y2firstboot/clients/wsl.rb        
2023-10-18 23:15:41.000000000 +0200
+++ new/yast2-firstboot-5.0.1/src/lib/y2firstboot/clients/wsl.rb        
2023-12-22 13:06:13.000000000 +0100
@@ -92,7 +92,7 @@
 
           # TRANSLATORS: Error message, %s is a pattern name
           Yast::Report.Error(_("Cannot select pattern\n\"%s\" to install.\n" \
-            "Some software might be missing.") % pattern)
+                               "Some software might be missing.") % pattern)
         end
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-5.0.0/src/lib/y2firstboot/clients/wsl_product_selection.rb 
new/yast2-firstboot-5.0.1/src/lib/y2firstboot/clients/wsl_product_selection.rb
--- 
old/yast2-firstboot-5.0.0/src/lib/y2firstboot/clients/wsl_product_selection.rb  
    2023-10-18 23:15:41.000000000 +0200
+++ 
new/yast2-firstboot-5.0.1/src/lib/y2firstboot/clients/wsl_product_selection.rb  
    2023-12-22 13:06:13.000000000 +0100
@@ -38,12 +38,17 @@
         return :auto if products.none?
 
         dialog = Dialogs::WSLProductSelection.new(products,
-          default_product: product,
-          wsl_gui_pattern: wsl_gui_pattern?)
+          default_product:     product,
+          wsl_gui_pattern:     wsl_gui_pattern?,
+          wsl_systemd_pattern: wsl_systemd_pattern?)
 
         result = dialog.run
 
-        save(product: dialog.product, wsl_gui_pattern: dialog.wsl_gui_pattern) 
if result == :next
+        if result == :next
+          save(product:             dialog.product,
+            wsl_gui_pattern:     dialog.wsl_gui_pattern,
+            wsl_systemd_pattern: dialog.wsl_systemd_pattern)
+        end
 
         result
       end
@@ -52,14 +57,17 @@
 
       WSL_GUI_PATTERN = "wsl_gui".freeze
       private_constant :WSL_GUI_PATTERN
+      WSL_SYSTEMD_PATTERN = "wsl_systemd".freeze
+      private_constant :WSL_SYSTEMD_PATTERN
 
       # Saves changes
       #
       # @param product [Hash] Selected product
       # @param wsl_gui_pattern [Boolean] Whether to install WSL GUI pattern
-      def save(product:, wsl_gui_pattern:)
+      def save(product:, wsl_gui_pattern:, wsl_systemd_pattern:)
         self.product = product
         self.wsl_gui_pattern = wsl_gui_pattern
+        self.wsl_systemd_pattern = wsl_systemd_pattern
         update_registration
       end
 
@@ -101,6 +109,26 @@
         end
       end
 
+      # Whether the WSL systemd pattern should be installed
+      #
+      # @see ẂSLConfig
+      #
+      # @return [Boolean]
+      def wsl_systemd_pattern?
+        WSLConfig.instance.patterns.include?(WSL_SYSTEMD_PATTERN)
+      end
+
+      # Sets whether to install the WSL systemd pattern
+      #
+      # @param value [Boolean]
+      def wsl_systemd_pattern=(value)
+        if value
+          WSLConfig.instance.patterns.push(WSL_SYSTEMD_PATTERN).uniq!
+        else
+          WSLConfig.instance.patterns.delete(WSL_SYSTEMD_PATTERN)
+        end
+      end
+
       # Updates values stored in registration
       #
       # Those values indicates to registration what product was selected and 
whether the product
@@ -109,7 +137,8 @@
       # @see Registration::Storage::InstallationOptions
       def update_registration
         yaml_product = WSLConfig.instance.product
-        force_registration = WSLConfig.instance.product_switched? || 
wsl_gui_pattern?
+        force_registration = WSLConfig.instance.product_switched? ||
+          wsl_gui_pattern? || wsl_systemd_pattern?
 
         Registration::Storage::InstallationOptions.instance.yaml_product = 
yaml_product
         Registration::Storage::InstallationOptions.instance.force_registration 
= force_registration
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-5.0.0/src/lib/y2firstboot/dialogs/wsl_product_selection.rb 
new/yast2-firstboot-5.0.1/src/lib/y2firstboot/dialogs/wsl_product_selection.rb
--- 
old/yast2-firstboot-5.0.0/src/lib/y2firstboot/dialogs/wsl_product_selection.rb  
    2023-10-18 23:15:41.000000000 +0200
+++ 
new/yast2-firstboot-5.0.1/src/lib/y2firstboot/dialogs/wsl_product_selection.rb  
    2023-12-22 13:06:13.000000000 +0100
@@ -39,18 +39,26 @@
       # @return [Boolean]
       attr_reader :wsl_gui_pattern
 
+      # Whether the WSL systemd pattern was selected
+      #
+      # @return [Boolean]
+      attr_reader :wsl_systemd_pattern
+
       # Constructor
       #
       # @param products [Array<Hash>] All possible products
       # @param default_product [Hash] Product selected by default
       # @param wsl_gui_pattern [Boolean] Whether WSL GUI pattern is selected 
by default
-      def initialize(products, default_product: nil, wsl_gui_pattern: false)
+      # @param wsl_systemd_pattern [Boolean] Whether WSL systemd pattern is 
selected by default
+      def initialize(products, default_product: nil, wsl_gui_pattern: false,
+        wsl_systemd_pattern: false)
         textdomain "firstboot"
 
         super()
         @products = products
         @product = default_product || products.first
         @wsl_gui_pattern = wsl_gui_pattern
+        @wsl_systemd_pattern = wsl_systemd_pattern
       end
 
       def next_handler
@@ -65,6 +73,8 @@
         _("Product Selection")
       end
 
+      # disable rubocop metrics as yast ui is constructed with methods
+      # rubocop:disable Metrics/AbcSize
       def dialog_content
         items = products.map { |p| item_for(p) }
 
@@ -81,24 +91,40 @@
             ),
             VSpacing(2),
             # TRANSLATORS:
-            Label(_("The WSL GUI pattern provides some needed packages for\n" \
-              "a better experience with graphical applications in WSL.")),
+            Left(Label(_("The WSL GUI pattern provides some needed packages 
for\n" \
+                         "a better experience with graphical applications in 
WSL."))),
             VSpacing(1),
             # TRANSLATORS: check box label
             Left(CheckBox(Id(:wsl_gui_pattern),
               _("Install WSL GUI pattern (requires registration)"),
-              wsl_gui_pattern))
+              wsl_gui_pattern)),
+            VSpacing(2),
+            # TRANSLATORS:
+            Left(Label(_("The WSL systemd pattern provides wsl.conf 
adjustment\n" \
+                         "and init symlink for systemd enablement in WSL."))),
+            VSpacing(1),
+            # TRANSLATORS: check box label
+            Left(CheckBox(Id(:wsl_systemd_pattern),
+              _("Install WSL systemd pattern (requires registration)"),
+              wsl_systemd_pattern))
           )
         )
       end
+      # rubocop:enable Metrics/AbcSize
 
       def help_text
-        # TRANSLATORS: help text (1/2)
+        # TRANSLATORS: help text (1/3)
         _("<p>Select the product to use with Windows Subsystem for Linux 
(WSL). " \
           "Some products might require registration.</p>") +
-          # TRANSLATORS: help text (2/2)
-          _("<p>To use graphical programs in WSL you need to install the WSL 
GUI pattern. " \
-              "In that case the system needs to be registered as well.</p>")
+          # TRANSLATORS: help text (2/3)
+          _("<p>For smoother experience with graphical programs in WSL " \
+            "the WSL GUI pattern provides recommended config, tools and 
libraries. " \
+            "In that case the system needs to be registered as well.</p>") +
+          # TRANSLATORS: help text (3/3)
+          _("<p>For enablement of systemd in WSL the WSL systemd pattern 
provides wsl.conf " \
+            "and /sbin/init adjustments. " \
+            "In that case the system needs to be registered as well. " \
+            "Relaunch is required to use systemd.</p>")
       end
 
     private
@@ -146,6 +172,7 @@
 
       def save
         @wsl_gui_pattern = Yast::UI.QueryWidget(Id(:wsl_gui_pattern), :Value)
+        @wsl_systemd_pattern = Yast::UI.QueryWidget(Id(:wsl_systemd_pattern), 
:Value)
 
         selected_id = Yast::UI.QueryWidget(Id(:product_selector), :Value)
         @product = products.find { |p| item_id(p) == selected_id }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-5.0.0/test/y2firstboot/clients/wsl_product_selection_test.rb
 
new/yast2-firstboot-5.0.1/test/y2firstboot/clients/wsl_product_selection_test.rb
--- 
old/yast2-firstboot-5.0.0/test/y2firstboot/clients/wsl_product_selection_test.rb
    2023-10-18 23:15:41.000000000 +0200
+++ 
new/yast2-firstboot-5.0.1/test/y2firstboot/clients/wsl_product_selection_test.rb
    2023-12-22 13:06:13.000000000 +0100
@@ -104,14 +104,16 @@
 
         let(:dialog) do
           instance_double(Y2Firstboot::Dialogs::WSLProductSelection,
-            run:             dialog_result,
-            product:         selected_product,
-            wsl_gui_pattern: wsl_gui_pattern)
+            run:                 dialog_result,
+            product:             selected_product,
+            wsl_gui_pattern:     wsl_gui_pattern,
+            wsl_systemd_pattern: wsl_systemd_pattern)
         end
 
         let(:dialog_result) { :abort }
         let(:selected_product) { nil }
         let(:wsl_gui_pattern) { nil }
+        let(:wsl_systemd_pattern) { nil }
 
         let(:product_switched) { false }
 
@@ -159,6 +161,34 @@
             end
           end
 
+          context "if the WSL systemd pattern was selected" do
+            let(:wsl_systemd_pattern) { true }
+
+            before do
+              Y2Firstboot::WSLConfig.instance.patterns = []
+            end
+
+            it "stores the WSL systemd pattern in the WSL config" do
+              subject.run
+
+              expect(Y2Firstboot::WSLConfig.instance.patterns).to 
include("wsl_systemd")
+            end
+          end
+
+          context "if the WSL systemd pattern was not selected" do
+            let(:wsl_systemd_pattern) { false }
+
+            before do
+              Y2Firstboot::WSLConfig.instance.patterns = ["wsl_systemd"]
+            end
+
+            it "does not store the WSL systemd pattern in the WSL config" do
+              subject.run
+
+              expect(Y2Firstboot::WSLConfig.instance.patterns).to_not 
include("wsl_systemd")
+            end
+          end
+
           it "updates the product in registration storage" do
             Registration::Storage::InstallationOptions.instance.yaml_product = 
nil
 
@@ -170,6 +200,7 @@
           context "if the product was switched" do
             let(:product_switched) { true }
             let(:wsl_gui_pattern) { false }
+            let(:wsl_systemd_pattern) { false }
 
             it "updates registration storage to force registration" do
               
Registration::Storage::InstallationOptions.instance.force_registration = false
@@ -200,13 +231,30 @@
             context "and the WSL GUI pattern was not selected" do
               let(:wsl_gui_pattern) { false }
 
-              it "updates registration storage to not force registration" do
-                
Registration::Storage::InstallationOptions.instance.force_registration = true
+              context "and the WSL systemd pattern was selected" do
+                let(:wsl_systemd_pattern) { true }
 
-                subject.run
+                it "updates registration storage to force registration" do
+                  
Registration::Storage::InstallationOptions.instance.force_registration = false
 
-                
expect(Registration::Storage::InstallationOptions.instance.force_registration)
-                  .to eq(false)
+                  subject.run
+
+                  
expect(Registration::Storage::InstallationOptions.instance.force_registration)
+                    .to eq(true)
+                end
+              end
+
+              context "and the WSL systemd pattern was not selected" do
+                let(:wsl_systemd_pattern) { false }
+
+                it "updates registration storage to not force registration" do
+                  
Registration::Storage::InstallationOptions.instance.force_registration = true
+
+                  subject.run
+
+                  
expect(Registration::Storage::InstallationOptions.instance.force_registration)
+                    .to eq(false)
+                end
               end
             end
           end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-5.0.0/test/y2firstboot/dialogs/wsl_product_selection_test.rb
 
new/yast2-firstboot-5.0.1/test/y2firstboot/dialogs/wsl_product_selection_test.rb
--- 
old/yast2-firstboot-5.0.0/test/y2firstboot/dialogs/wsl_product_selection_test.rb
    2023-10-18 23:15:41.000000000 +0200
+++ 
new/yast2-firstboot-5.0.1/test/y2firstboot/dialogs/wsl_product_selection_test.rb
    2023-12-22 13:06:13.000000000 +0100
@@ -43,7 +43,9 @@
 
   subject do
     described_class.new(products,
-      default_product: default_product, wsl_gui_pattern: wsl_gui_pattern)
+      default_product:     default_product,
+      wsl_gui_pattern:     wsl_gui_pattern,
+      wsl_systemd_pattern: wsl_systemd_pattern)
   end
 
   let(:products) { [sles, sled] }
@@ -52,6 +54,7 @@
 
   let(:default_product) { sled }
   let(:wsl_gui_pattern) { false }
+  let(:wsl_systemd_pattern) { false }
 
   let(:installed_product) { double(Y2Packager::Resolvable, name: "SLES", 
version_version: "15.4") }
   before do
@@ -80,6 +83,12 @@
       expect(widget).to_not be_nil
     end
 
+    it "shows a check box for selecting the WSL systemd pattern" do
+      widget = find_widget(:wsl_systemd_pattern, subject.send(:dialog_content))
+
+      expect(widget).to_not be_nil
+    end
+
     it "automatically selects the default product" do
       widget = find_widget(/SLED/, subject.send(:dialog_content))
 
@@ -105,12 +114,34 @@
         expect(widget.params.last).to eq(false)
       end
     end
+
+    context "when WSL systemd pattern is indicated as selected" do
+      let(:wsl_systemd_pattern) { true }
+
+      it "selects WSL systemd pattern checkbox by default" do
+        widget = find_widget(:wsl_systemd_pattern, 
subject.send(:dialog_content))
+
+        expect(widget.params.last).to eq(true)
+      end
+    end
+
+    context "when WSL systemd pattern is not indicated as selected" do
+      let(:wsl_systemd_pattern) { false }
+
+      it "does not select WSL systemd pattern checkbox by default" do
+        widget = find_widget(:wsl_systemd_pattern, 
subject.send(:dialog_content))
+
+        expect(widget.params.last).to eq(false)
+      end
+    end
   end
 
   describe "#next_handler" do
     before do
       allow(Yast::UI).to receive(:QueryWidget).and_call_original
       allow(Yast::UI).to receive(:QueryWidget).with(Id(:wsl_gui_pattern), 
:Value).and_return(true)
+      allow(Yast::UI).to receive(:QueryWidget).with(Id(:wsl_systemd_pattern), 
:Value)
+        .and_return(true)
       allow(Yast::UI).to receive(:QueryWidget).with(Id(:product_selector), 
:Value)
         .and_return("SLES:15.4")
     end
@@ -123,6 +154,14 @@
       expect(subject.wsl_gui_pattern).to eq(true)
     end
 
+    it "saves whether the WSL GUI pattern checkbox was selected" do
+      expect(subject.wsl_systemd_pattern).to eq(false)
+
+      subject.next_handler
+
+      expect(subject.wsl_systemd_pattern).to eq(true)
+    end
+
     it "saves the selected product" do
       expect(subject.product).to eq(sled)
 

Reply via email to