Hello community,

here is the log from the commit of package yast2-users for openSUSE:Factory 
checked in at 2016-08-31 14:27:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-users (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-users.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-users"

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-users/yast2-users.changes  2016-08-18 
10:19:36.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-users.new/yast2-users.changes     
2016-08-31 14:27:28.000000000 +0200
@@ -1,0 +2,7 @@
+Tue Aug 30 10:37:18 CEST 2016 - sch...@suse.de
+
+- AutoYaST: Checking users entries for duplicate username/UIDs.
+  (bnc#995397)
+- 3.1.56
+
+-------------------------------------------------------------------

Old:
----
  yast2-users-3.1.55.tar.bz2

New:
----
  yast2-users-3.1.56.tar.bz2

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

Other differences:
------------------
++++++ yast2-users.spec ++++++
--- /var/tmp/diff_new_pack.kVJbrV/_old  2016-08-31 14:27:29.000000000 +0200
+++ /var/tmp/diff_new_pack.kVJbrV/_new  2016-08-31 14:27:29.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-users
-Version:        3.1.55
+Version:        3.1.56
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-users-3.1.55.tar.bz2 -> yast2-users-3.1.56.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-3.1.55/CONTRIBUTING.md 
new/yast2-users-3.1.56/CONTRIBUTING.md
--- old/yast2-users-3.1.55/CONTRIBUTING.md      2016-08-12 16:59:07.000000000 
+0200
+++ new/yast2-users-3.1.56/CONTRIBUTING.md      2016-08-30 11:12:17.000000000 
+0200
@@ -3,7 +3,7 @@
 
 YaST is an open source project and as such it welcomes all kinds of
 contributions. If you decide to contribute, please follow these guidelines to
-ensure the process is effective and pleasant both for you and YaST maintainers.
+ensure the process is effective and pleasant both for you and the YaST 
maintainers.
 
 There are two main forms of contribution: reporting bugs and performing code
 changes.
@@ -17,13 +17,11 @@
 
registration](https://secure-www.novell.com/selfreg/jsp/createSimpleAccount.jsp)
 if you don't have an account yet.)
 
-If you find a problem, please report it either using
-[Bugzilla](https://bugzilla.suse.com/) or GitHub issues. We can't guarantee
-that every bug will be fixed, but we'll try.
-
 When creating a bug report, please follow our [bug reporting
 guidelines](http://en.opensuse.org/openSUSE:Report_a_YaST_bug).
 
+We can't guarantee that every bug will be fixed, but we'll try.
+
 Code Changes
 ------------
 
@@ -44,15 +42,22 @@
      to the [Ruby style
      guide](https://github.com/SUSE/style-guides/blob/master/Ruby.md).
 
-  4. Make sure your change didn't break anything by building the RPM package
+  4. Update the package version (in `packages/*.spec`, usually by
+     `rake version:bump`) and add a new entry to the `package/*.changes` file
+     (by `osc vc package`).  
+     For bigger changes or changes which need longer discussion it is advised 
to
+     add this as a separate last commit so it can be easily updated when 
another
+     change is merged in the meantime.
+
+  5. Make sure your change didn't break anything by building the RPM package
      (`rake osc:build`). The build process includes running the full testsuite.
 
-  5. Publish the branch and create a pull request.
+  6. Publish the branch and create a pull request.
 
-  6. YaST developers will review your change and possibly point out issues.
+  7. YaST developers will review your change and possibly point out issues.
      Adapt the code under their guidance until they are all resolved.
 
-  7. Finally, the pull request will get merged or rejected.
+  8. Finally, the pull request will get merged or rejected.
 
 See also [GitHub's guide on
 contributing](https://help.github.com/articles/fork-a-repo).
@@ -60,9 +65,6 @@
 If you want to do multiple unrelated changes, use separate branches and pull
 requests.
 
-Do not change the `VERSION` and `*.changes` files as this could lead to
-conflicts.
-
 ### Commits
 
 Each commit in the pull request should do only one thing, which is clearly
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-3.1.55/package/yast2-users.changes 
new/yast2-users-3.1.56/package/yast2-users.changes
--- old/yast2-users-3.1.55/package/yast2-users.changes  2016-08-12 
16:59:07.000000000 +0200
+++ new/yast2-users-3.1.56/package/yast2-users.changes  2016-08-30 
11:12:17.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Tue Aug 30 10:37:18 CEST 2016 - sch...@suse.de
+
+- AutoYaST: Checking users entries for duplicate username/UIDs.
+  (bnc#995397)
+- 3.1.56
+
+-------------------------------------------------------------------
 Fri Aug 12 14:37:40 UTC 2016 - an...@suse.com
 
 - The YaST client using the user creation dialog can now know
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-3.1.55/package/yast2-users.spec 
new/yast2-users-3.1.56/package/yast2-users.spec
--- old/yast2-users-3.1.55/package/yast2-users.spec     2016-08-12 
16:59:07.000000000 +0200
+++ new/yast2-users-3.1.56/package/yast2-users.spec     2016-08-30 
11:12:17.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-users
-Version:        3.1.55
+Version:        3.1.56
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-3.1.55/src/clients/users_auto.rb 
new/yast2-users-3.1.56/src/clients/users_auto.rb
--- old/yast2-users-3.1.55/src/clients/users_auto.rb    2016-08-12 
16:59:07.000000000 +0200
+++ new/yast2-users-3.1.56/src/clients/users_auto.rb    2016-08-30 
11:12:17.000000000 +0200
@@ -36,8 +36,12 @@
 # This is a client for autoinstallation. It takes its arguments,
 # goes through the configuration and return the setting.
 # Does not do any changes to the configuration.
+
+Yast.import "Report"
+
 module Yast
   class UsersAutoClient < Client
+
     def main
       Yast.import "UI"
       textdomain "users"
@@ -89,6 +93,7 @@
       #    param = $["users": users];
 
       if @func == "Import"
+        check_users(@param["users"] || [])
         @ret = Users.Import(@param)
       # create a  summary
       elsif @func == "Summary"
@@ -156,6 +161,21 @@
 
       deep_copy(@ret)
     end
+
+  private
+
+    # Checking double user entries
+    # (double username or UID)
+    # @param [Array] users to check
+    def check_users(users)
+      if users.size > users.uniq { |u| u["username"]}.size
+        Report.Error(_("Found users in profile with equal <username>."))
+      end
+      if users.size > users.uniq { |u| u["uid"]}.size
+        Report.Error(_("Found users in profile with equal <uid>."))
+      end
+    end
+
   end
 end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-3.1.55/test/fixtures/users_error.yml 
new/yast2-users-3.1.56/test/fixtures/users_error.yml
--- old/yast2-users-3.1.55/test/fixtures/users_error.yml        1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-users-3.1.56/test/fixtures/users_error.yml        2016-08-30 
11:12:17.000000000 +0200
@@ -0,0 +1,23 @@
+users:
+  - username: root
+    user_password: yast.password
+    fullname: Superuser
+    encrypted: true
+  - username: yast
+    user_password: suse
+    fullname: YaST team user
+    gid: 100
+    uid: 1000
+    shell: /usr/bin/zsh
+    encrypted: true
+  - username: saprouter
+    user_password: suse
+    fullname: SAP User
+    gid: 100
+    uid: 1000
+    shell: /usr/bin/zsh
+    encrypted: true
+  - username: root
+    user_password: yast.password
+    fullname: Superuser
+    encrypted: true
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-3.1.55/test/test_helper.rb 
new/yast2-users-3.1.56/test/test_helper.rb
--- old/yast2-users-3.1.55/test/test_helper.rb  2016-08-12 16:59:08.000000000 
+0200
+++ new/yast2-users-3.1.56/test/test_helper.rb  2016-08-30 11:12:17.000000000 
+0200
@@ -48,6 +48,9 @@
   config.mock_with :rspec do |c|
     # 
https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/verifying-doubles/partial-doubles
     c.verify_partial_doubles = true
+
+    config.extend Yast::I18n  # available in context/describe
+    config.include Yast::I18n # available in it/let/before/...
   end
 end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-users-3.1.55/test/users_auto_test.rb 
new/yast2-users-3.1.56/test/users_auto_test.rb
--- old/yast2-users-3.1.55/test/users_auto_test.rb      1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-users-3.1.56/test/users_auto_test.rb      2016-08-30 
11:12:17.000000000 +0200
@@ -0,0 +1,41 @@
+#!/usr/bin/env rspec
+
+require_relative "test_helper"
+require "yaml"
+require_relative "../src/clients/users_auto"
+
+describe Yast::UsersAutoClient do
+  Yast.import "WFM"
+  Yast.import "Users"
+  Yast.import "Users"
+  Yast.import "Report"
+
+  let(:mode) { "autoinstallation" }
+
+  before do
+    allow(Yast::Mode).to receive(:mode).and_return(mode)
+  end
+
+  describe "#AutoYaST" do
+
+    context "Import" do
+      let(:func) { "Import" }
+
+      context "when double users have been given in the profile" do
+        let(:users) { YAML.load_file(FIXTURES_PATH.join("users_error.yml")) }
+
+        before do
+          allow(Yast::WFM).to 
receive(:Args).with(no_args).and_return([func,users])
+          allow(Yast::WFM).to receive(:Args).with(0).and_return(func)
+          allow(Yast::WFM).to receive(:Args).with(1).and_return(users)
+        end
+
+        it "report error" do
+          expect(Yast::Report).to receive(:Error).with(_("Found users in 
profile with equal <username>."))
+          expect(Yast::Report).to receive(:Error).with(_("Found users in 
profile with equal <uid>."))
+          expect(subject.main).to eq(true)
+        end
+      end
+    end
+  end
+end


Reply via email to