Hello community,

here is the log from the commit of package yast2-auth-client for 
openSUSE:Factory checked in at 2014-08-06 11:42:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-auth-client (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-auth-client.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-auth-client"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-auth-client/yast2-auth-client.changes      
2014-06-25 10:49:13.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-auth-client.new/yast2-auth-client.changes 
2014-08-06 11:42:36.000000000 +0200
@@ -1,0 +2,7 @@
+Fri Aug  1 14:38:16 CEST 2014 - [email protected]
+
+- Fixed error while parsing autoyast settings with missing
+  'sssd_conf' entry. (bnc#889758)
+- 3.1.18
+
+-------------------------------------------------------------------

Old:
----
  yast2-auth-client-3.1.17.tar.bz2

New:
----
  yast2-auth-client-3.1.18.tar.bz2

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

Other differences:
------------------
++++++ yast2-auth-client.spec ++++++
--- /var/tmp/diff_new_pack.YAxtVh/_old  2014-08-06 11:42:38.000000000 +0200
+++ /var/tmp/diff_new_pack.YAxtVh/_new  2014-08-06 11:42:38.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-auth-client
-Version:        3.1.17
+Version:        3.1.18
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -25,6 +25,7 @@
 
 BuildRequires:  doxygen
 BuildRequires:  perl-XML-Writer
+BuildRequires:  rubygem-rspec
 BuildRequires:  update-desktop-files
 BuildRequires:  yast2
 BuildRequires:  yast2-devtools >= 3.0.6

++++++ yast2-auth-client-3.1.17.tar.bz2 -> yast2-auth-client-3.1.18.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-auth-client-3.1.17/SUBDIRS 
new/yast2-auth-client-3.1.18/SUBDIRS
--- old/yast2-auth-client-3.1.17/SUBDIRS        2014-06-24 14:30:50.000000000 
+0200
+++ new/yast2-auth-client-3.1.18/SUBDIRS        2014-08-06 08:57:43.000000000 
+0200
@@ -1 +1 @@
-src
+src test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-auth-client-3.1.17/package/yast2-auth-client.changes 
new/yast2-auth-client-3.1.18/package/yast2-auth-client.changes
--- old/yast2-auth-client-3.1.17/package/yast2-auth-client.changes      
2014-06-24 14:30:50.000000000 +0200
+++ new/yast2-auth-client-3.1.18/package/yast2-auth-client.changes      
2014-08-06 08:57:43.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri Aug  1 14:38:16 CEST 2014 - [email protected]
+
+- Fixed error while parsing autoyast settings with missing
+  'sssd_conf' entry. (bnc#889758)
+- 3.1.18
+
+-------------------------------------------------------------------
 Mon Jun 23 13:57:30 UTC 2014 - [email protected]
 
 - fix deletion of sssd domains
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-auth-client-3.1.17/package/yast2-auth-client.spec 
new/yast2-auth-client-3.1.18/package/yast2-auth-client.spec
--- old/yast2-auth-client-3.1.17/package/yast2-auth-client.spec 2014-06-24 
14:30:50.000000000 +0200
+++ new/yast2-auth-client-3.1.18/package/yast2-auth-client.spec 2014-08-06 
08:57:43.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-auth-client
-Version:        3.1.17
+Version:        3.1.18
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -27,6 +27,7 @@
 License:        GPL-2.0
 BuildRequires: doxygen perl-XML-Writer update-desktop-files yast2 yast2-pam 
yast2-testsuite yast2-network
 BuildRequires:  yast2-devtools >= 3.0.6
+BuildRequires:  rubygem-rspec
 
 PreReq:         %fillup_prereq
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-auth-client-3.1.17/src/modules/AuthClient.rb 
new/yast2-auth-client-3.1.18/src/modules/AuthClient.rb
--- old/yast2-auth-client-3.1.17/src/modules/AuthClient.rb      2014-06-24 
14:30:50.000000000 +0200
+++ new/yast2-auth-client-3.1.18/src/modules/AuthClient.rb      2014-08-06 
08:57:43.000000000 +0200
@@ -244,49 +244,51 @@
     def Import(settings)
       @auth = Hash.new(&@make_hash)
 
-      #Read the basic settings of auth client
+      # Read the basic settings of auth client
       settings.each_key { |s|
         next if s == "sssd_conf"
         @auth[s] = settings[s]
       }
 
-      #Evaluate if the settings are valid
-      if settings.has_key?('sssd')
-        if settings['sssd'] && !settings.has_key?('sssd_conf') 
+      # Evaluate if the settings are valid
+      if settings['sssd']
+        # using sssd
+        unless settings.has_key?('sssd_conf')
           Builtins.y2milestone("There are no sssd configuration provided but 
sssd is enabled.")
           return false
+        else
+          # Read sssd basic settings
+          settings['sssd_conf'].each_key { |key|
+            next if key == "auth_domains"
+            @auth['sssd_conf'][key] = settings['sssd_conf'][key]
+          }
+          unless settings['sssd_conf'].has_key?('auth_domains')
+            Builtins.y2milestone("There are no authentication domain defined")
+            return false
+          else
+            # Read authentication domains
+            settings['sssd_conf']['auth_domains'].each { |domain|
+              if !domain.has_key?('domain_name')
+                Builtins.y2warning("Domain has no domain_name: #{domain}")
+              end
+              name = 'domain/' + domain['domain_name']
+              domain.each_key { |key|
+                next if key == 'domain_name'
+                @auth['sssd_conf'][name][key] = domain[key]
+              }
+            }
+          end
         end
       else
+        # not using sssd
         if settings.has_key?('sssd_conf') 
           Builtins.y2milestone("There are sssd configuration provided but sssd 
is not enabled.")
           return false
         end
         Builtins.y2milestone("Authentication will not made via sssd.")
-         @auth['sssd'] = false
-        return true 
+        @auth['sssd'] = false
       end
 
-      #Read sssd basic settings
-      settings['sssd_conf'].each_key { |s|
-        next if s == "auth_domains"
-        @auth['sssd_conf'][s] = settings['sssd_conf'][s]
-      }
-      if !settings['sssd_conf'].has_key?('auth_domains')
-        Builtins.y2milestone("There are no authentication domain defined")
-        return false
-      end
-
-      #Read authentication domains
-      settings['sssd_conf']['auth_domains'].each { |d|
-        if !d.has_key?('domain_name')
-          Builtins.y2milestone("Domain has no domain_name: %1",d)
-        end
-        name = 'domain/' + d['domain_name'] 
-        d.each_key { |k|
-          next if k == 'domain_name'
-          @auth['sssd_conf'][name][k] = d[k]
-        }
-      }
       true
     end
     # end Import
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-auth-client-3.1.17/test/Makefile.am 
new/yast2-auth-client-3.1.18/test/Makefile.am
--- old/yast2-auth-client-3.1.17/test/Makefile.am       1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-auth-client-3.1.18/test/Makefile.am       2014-08-06 
08:57:43.000000000 +0200
@@ -0,0 +1,7 @@
+TESTS = \
+  auth_client_test.rb
+
+TEST_EXTENSIONS = .rb
+RB_LOG_COMPILER = rspec --format doc
+VERBOSE = 1
+EXTRA_DIST = $(TESTS)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-auth-client-3.1.17/test/auth_client_test.rb 
new/yast2-auth-client-3.1.18/test/auth_client_test.rb
--- old/yast2-auth-client-3.1.17/test/auth_client_test.rb       1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-auth-client-3.1.18/test/auth_client_test.rb       2014-08-06 
08:57:43.000000000 +0200
@@ -0,0 +1,59 @@
+#!/usr/bin/env rspec
+#
+ENV['Y2DIR'] = File.expand_path('../../src', __FILE__)
+
+require 'yast'
+
+Yast.import "AuthClient"
+
+describe Yast::AuthClient do
+  describe "importing autoyast values" do
+
+    it "importing correct value with no sssd" do
+      settings = {"nssldap"=>false, "oes"=>false, "sssd"=>false}
+      expect(Yast::AuthClient.Import(settings)).to eq(true)
+      expect(Yast::AuthClient.Export).to eq(settings)
+    end
+
+    it "importing correct value with sssd and sssd_conf" do
+      settings = {
+        "nssldap"=>false, 
+        "oes"=>false, "sssd"=>true,
+        "sssd_conf"=>{
+          "sssd"=>{"config_file_version"=>2, "services"=>"nss, pam"},
+          "auth_domains"=>[
+            {"domain_name"=>"default",
+             "ldap_uri"=>"ldap://ldap.suse.de";,
+             "ldap_search_base"=>"dc=suse,dc=de",
+             "ldap_schema"=>"rfc2307bis",
+             "id_provider"=>"ldap",
+             "ldap_id_use_start_tls"=>true,
+             "enumerate"=>false,
+             "cache_credentials"=>false,
+             "chpass_provider"=>"ldap",
+             "auth_provider"=>"ldap"
+            }]
+        }       
+      }
+      expect(Yast::AuthClient.Import(settings)).to eq(true)
+      expect(Yast::AuthClient.Export).to eq(settings)
+    end
+
+    it "importing wrong value (sssd but not defined sssd_conf)" do
+      settings = {"nssldap"=>false, "oes"=>false, "sssd"=>true}
+      expect(Yast::AuthClient.Import(settings)).to eq(false)
+    end
+
+    it "importing wrong value (sssd,sssd_conf but not defined auth_domains)" do
+      settings = {
+        "nssldap"=>false, 
+        "oes"=>false, "sssd"=>true,
+        "sssd_conf"=>{
+          "sssd"=>{"config_file_version"=>2, "services"=>"nss, pam"}
+        }       
+      }
+      expect(Yast::AuthClient.Import(settings)).to eq(false)
+    end
+
+  end
+end

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to