diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05a36fd57..b00843f9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: [push, pull_request] jobs: Tests: runs-on: ubuntu-latest - container: registry.opensuse.org/yast/head/containers/yast-ruby:latest + container: registry.opensuse.org/yast/sle-15/sp3/containers/yast-ruby:latest steps: @@ -37,7 +37,7 @@ jobs: Rubocop: runs-on: ubuntu-latest - container: registry.opensuse.org/yast/head/containers/yast-ruby:latest + container: registry.opensuse.org/yast/sle-15/sp3/containers/yast-ruby:latest steps: @@ -49,7 +49,7 @@ jobs: Package: runs-on: ubuntu-latest - container: registry.opensuse.org/yast/head/containers/yast-ruby:latest + container: registry.opensuse.org/yast/sle-15/sp3/containers/yast-ruby:latest steps: @@ -61,7 +61,7 @@ jobs: Yardoc: runs-on: ubuntu-latest - container: registry.opensuse.org/yast/head/containers/yast-ruby:latest + container: registry.opensuse.org/yast/sle-15/sp3/containers/yast-ruby:latest steps: @@ -75,7 +75,7 @@ jobs: # checks into one job avoids that overhead Checks: runs-on: ubuntu-latest - container: registry.opensuse.org/yast/head/containers/yast-ruby:latest + container: registry.opensuse.org/yast/sle-15/sp3/containers/yast-ruby:latest steps: diff --git a/Rakefile b/Rakefile index 0ebcf2e9e..2ec5b618b 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,7 @@ require "yast/rake" +Yast::Tasks.submit_to :sle15sp3 + Yast::Tasks.configuration do |conf| # lets ignore license check for now conf.skip_license_check << /.*/ diff --git a/library/general/src/lib/cfa/login_defs.rb b/library/general/src/lib/cfa/login_defs.rb index 5edc56b9b..c1966bffe 100644 --- a/library/general/src/lib/cfa/login_defs.rb +++ b/library/general/src/lib/cfa/login_defs.rb @@ -65,6 +65,8 @@ class LoginDefs < BaseModel :userdel_precmd ].freeze + DEFAULT_PATH = "/etc/login.defs".freeze + class << self # Returns the list of known attributes # @@ -80,7 +82,7 @@ def known_attributes # @param file_handler [#read,#write] something able to read/write a string (like File) # @param file_path [String] File path # @return [LoginDefs] File with the already loaded content - def load(file_path:, file_handler: Yast::TargetFile) + def load(file_path: DEFAULT_PATH, file_handler: Yast::TargetFile) new(file_path: file_path, file_handler: file_handler).tap(&:load) end end @@ -98,7 +100,7 @@ def load(file_path:, file_handler: Yast::TargetFile) # @param file_path [String] File path # # @see CFA::BaseModel#initialize - def initialize(file_path:, file_handler: Yast::TargetFile) + def initialize(file_path: DEFAULT_PATH, file_handler: Yast::TargetFile) super(AugeasParser.new("login_defs.lns"), file_path, file_handler: file_handler) end diff --git a/library/general/src/modules/ShadowConfig.rb b/library/general/src/modules/ShadowConfig.rb index 2118ed36a..253812f51 100644 --- a/library/general/src/modules/ShadowConfig.rb +++ b/library/general/src/modules/ShadowConfig.rb @@ -23,7 +23,6 @@ module Yast # This class allows to access the API to handle login.defs attributes from Perl # - # @see CFA::LoginDefs # @see CFA::ShadowConfig class ShadowConfigClass < Module include Logger diff --git a/library/general/test/cfa/login_defs_test.rb b/library/general/test/cfa/login_defs_test.rb index 0646f610a..913923e52 100644 --- a/library/general/test/cfa/login_defs_test.rb +++ b/library/general/test/cfa/login_defs_test.rb @@ -90,4 +90,22 @@ end end end + + describe "#present_attributes" do + it "returns the list of present attributes" do + expect(login_defs.present_attributes).to include(*ATTRS_VALUES.keys) + end + end + + describe "#conflicts" do + subject(:other) { described_class.new(file_path: file_path, file_handler: file_handler) } + + before do + other.encrypt_method = "SHA256" + end + + it "returns the list of attributes with different values" do + expect(login_defs.conflicts(other)).to eq([:encrypt_method]) + end + end end diff --git a/library/general/test/login_defs_config_test.rb b/library/general/test/shadow_config_test.rb similarity index 100% rename from library/general/test/login_defs_config_test.rb rename to library/general/test/shadow_config_test.rb diff --git a/package/yast2.changes b/package/yast2.changes index b6eaac5be..a9080a799 100644 --- a/package/yast2.changes +++ b/package/yast2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 12 15:12:41 UTC 2021 - Imobach Gonzalez Sosa + +- Add a default value for file_path argument in ::new and ::load + methods of CFA::LoginDefs class. + ------------------------------------------------------------------- Mon Mar 29 09:46:31 UTC 2021 - Imobach Gonzalez Sosa