Script 'mail_helper' called by ro
Hello packager,
This is just FYI. Your package was checked in in distribution "sle12"
by autobuild-member: ro.
Here comes the log...
---------------------------%<------------------------------
Hi,
here is the log from ci_new_pac /mounts/work_src_done/SLE12/yast2 -> sle12
## BNC# 853300 : "yast2 iscsi-client can not automatically login" (ASSIGNED/)
Changes:
--------
--- /work/SRC/SUSE:SLE-12:GA/yast2/yast2.changes 2014-02-11 18:19:59.000000000 +0100
+++ /mounts/work_src_done/SLE12/yast2/yast2.changes 2014-02-27 11:12:01.000000000 +0100
@@ -1,0 +2,6 @@
+Thu Feb 27 09:56:16 UTC 2014 - vmoravec(a)suse.com
+
+- Add systemd socket support (bnc#853300)
+- 3.1.20
+
+-------------------------------------------------------------------
calling whatdependson for sle12-i586
Packages directly triggered for rebuild:
- yast2
- at least 73 other packages
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/SUSE:SLE-12:GA/yast2 (Old)
and /mounts/work_src_done/SLE12/yast2 (BS:build ID:33512 MAIL:yast-commit@opensuse.org) (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2", Maintainer is "yast-commit(a)opensuse.org"
Old:
----
yast2-3.1.19.tar.bz2
New:
----
yast2-3.1.20.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.P9wpP8/_old 2014-02-27 16:11:02.000000000 +0100
+++ /var/tmp/diff_new_pack.P9wpP8/_new 2014-02-27 16:11:02.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2
-Version: 3.1.19
+Version: 3.1.20
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-3.1.19.tar.bz2 -> yast2-3.1.20.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/Makefile.am new/yast2-3.1.20/library/Makefile.am
--- old/yast2-3.1.19/library/Makefile.am 2014-02-10 16:05:28.000000000 +0100
+++ new/yast2-3.1.20/library/Makefile.am 2014-02-27 11:05:00.000000000 +0100
@@ -1,3 +1,3 @@
# Makefile.am for yast2/library
-SUBDIRS = types runlevel sequencer xml commandline desktop wizard control cwm log system packages cron network gpg general
+SUBDIRS = types runlevel sequencer xml commandline desktop wizard control cwm log system packages cron network gpg general systemd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/general/src/modules/AsciiFile.rb new/yast2-3.1.20/library/general/src/modules/AsciiFile.rb
--- old/yast2-3.1.19/library/general/src/modules/AsciiFile.rb 2014-02-10 16:05:28.000000000 +0100
+++ new/yast2-3.1.20/library/general/src/modules/AsciiFile.rb 2014-02-27 11:05:00.000000000 +0100
@@ -31,6 +31,36 @@
require "yast"
module Yast
+
+ # Assume this /etc/fstab file
+ #
+ # # main filesystem
+ # UUID=001c0d61-e99f-4ab7-ba4b-bda6f54a052d / btrfs defaults 0 0
+ #
+ # then with this set-up
+ #
+ # file = {}
+ # file_ref = arg_ref(file) # an artefact of YCP API
+ # AsciiFile.SetComment(file_ref, "^[ \t]*#")
+ # AsciiFile.SetDelimiter(file_ref, " \t")
+ # AsciiFile.SetListWidth(file_ref, [20, 20, 10, 21, 1, 1])
+ #
+ # this main call
+ #
+ # AsciiFile.ReadFile(file_ref, "/etc/fstab")
+ # # note that the result is `file["l"]`
+ # # as the rest of `file` are the parsing parameters
+ # result = file["l"]
+ #
+ # will produce
+ #
+ # result.size # => 2
+ # # an integer keyed hash starting at ONE!
+ # result.keys # => [1, 2]
+ # result[1]["comment"] # => true
+ # result[1]["line"] # => "# main filesystem"
+ # result[2]["fields"].size # => 6
+ # result[2]["fields"][1] # => "/"
class AsciiFileClass < Module
def main
@@ -51,8 +81,8 @@
# Sets the widths of records on one line
#
- # @param [map &] file content
- # @param list of widths
+ # @param [ArgRef<Hash>] file content
+ # @param [Array] widths list of widths
def SetListWidth(file, widths)
widths = deep_copy(widths)
Ops.set(file.value, "widths", widths)
@@ -62,8 +92,8 @@
# Sets the delimiter between the records on one line
#
- # @param [map &] file content
- # @param string delimiter
+ # @param [ArgRef<Hash>] file content
+ # @param [String] delim delimiter
def SetDelimiter(file, delim)
Ops.set(file.value, "delim", delim)
@@ -112,8 +142,8 @@
# Reads the file from the disk
#
- # @param [map &] file content
- # @param [map &] file name
+ # @param [ArgRef<Hash>] file content
+ # @param [String] pathname file name
def ReadFile(file, pathname)
Builtins.y2milestone("path=%1", pathname)
lines = []
@@ -182,8 +212,8 @@
# Returns the list of rows where matches searched string in the defined column
#
# @param [Hash] file content
- # @param integer column (counted from 0 to n)
- # @param string searched string
+ # @param [Integer] field column (counted from 0 to n)
+ # @param [String] content searched string
# @return [Array<Fixnum>] matching rows
def FindLineField(file, field, content)
file = deep_copy(file)
@@ -200,9 +230,9 @@
# Returns map of wanted lines
#
- # @param [map &] file content
- # @param list<integer> rows (counted from 1 to n)
- # @return [Hash{Fixnum => map}] with wanted lines
+ # @param [ArgRef<Hash>] file content
+ # @param [Array<Integer>] lines rows (counted from 1 to n)
+ # @return [Hash<Fixnum, Hash>] hash with wanted lines
def GetLines(file, lines)
lines = deep_copy(lines)
ret = {}
@@ -220,8 +250,8 @@
# Returns map of wanted line
#
- # @param [map &] file content
- # @param integer row number (counted from 1 to n)
+ # @param [ArgRef<Hash>] file content
+ # @param [Integer] line row number (counted from 1 to n)
# @return [Hash] of wanted line
def GetLine(file, line)
ret = {}
@@ -248,9 +278,9 @@
# Changes the record in the file defined by row and column
#
- # @param [map &] file content
- # @param integer row number (counted from 1 to n)
- # @param integer column number (counted from 0 to n)
+ # @param [ArgRef<Hash>] file content
+ # @param [Integer] line row number (counted from 1 to n)
+ # @param [Integer] field column number (counted from 0 to n)
def ChangeLineField(file, line, field, entry)
Builtins.y2debug("line %1 field %2 entry %3", line, field, entry)
changed = false
@@ -288,9 +318,9 @@
# Changes a complete line
#
- # @param [map &] file content
- # @param integer row number (counted from 1 to n)
- # @param list of new entries on the line
+ # @param [ArgRef<Hash>] file content
+ # @param [Integer] line row number (counted from 1 to n)
+ # @param [Array] entry array of new fields on the line
def ReplaceLine(file, line, entry)
entry = deep_copy(entry)
Builtins.y2debug("line %1 entry %2", line, entry)
@@ -307,8 +337,8 @@
# Appends a new line at the bottom
#
- # @param [map &] file content
- # @param list of new entries on one line
+ # @param [ArgRef<Hash>] file content
+ # @param [Array] entry array of new fields on the line
def AppendLine(file, entry)
entry = deep_copy(entry)
line = Ops.add(Builtins.size(Ops.get_map(file.value, "l", {})), 1)
@@ -323,7 +353,7 @@
# Removes lines
#
- # @param [map &] file content
+ # @param [ArgRef<Hash>] file content
# @param [Array<Fixnum>] lines to remove (counted from 1 to n)
def RemoveLines(file, lines)
lines = deep_copy(lines)
@@ -343,8 +373,8 @@
# Writes a content into the file
#
- # @param [map &] file content
- # @param [map &] file name
+ # @param [ArgRef<Hash>] file content
+ # @param [String] fpath file name
def RewriteFile(file, fpath)
Builtins.y2milestone("path %1", fpath)
Builtins.y2debug("out: %1", file.value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/general/test/Makefile.am new/yast2-3.1.20/library/general/test/Makefile.am
--- old/yast2-3.1.19/library/general/test/Makefile.am 2014-02-10 16:05:29.000000000 +0100
+++ new/yast2-3.1.20/library/general/test/Makefile.am 2014-02-27 11:05:00.000000000 +0100
@@ -1,6 +1,7 @@
TESTS = \
+ asciifile_test.rb \
linuxrc_test.rb \
- hooks_test.rb
+ hooks_test.rb
TEST_EXTENSIONS = .rb
RB_LOG_COMPILER = rspec
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/general/test/asciifile_test.rb new/yast2-3.1.20/library/general/test/asciifile_test.rb
--- old/yast2-3.1.19/library/general/test/asciifile_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/general/test/asciifile_test.rb 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,90 @@
+#! /usr/bin/env rspec
+
+ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
+
+require "yast"
+include Yast
+
+Yast.import "AsciiFile"
+
+def stub_file_reading(filename, contents)
+ SCR.stub(:Read)
+ .with(path(".target.size"), filename)
+ .and_return contents.length
+
+ SCR.stub(:Read)
+ .with(path(".target.string"), filename)
+ .and_return contents
+end
+
+describe "AsciiFile" do
+ context "when working with a fstab file" do
+ FSTAB_FILENAME = "/etc/fstab"
+ FSTAB_CONTENTS = <<EOS
+UUID=001c0d61-e99f-4ab7-ba4b-bda6f54a052d / btrfs defaults 0 0
+# NFS
+192.168.1.1:/ /mnt nfs4 rw 0 0
+# trailing comment
+EOS
+ let(:fstab_ref) do
+ stub_file_reading(FSTAB_FILENAME, FSTAB_CONTENTS)
+ fstab = {}
+ fstab_ref = arg_ref(fstab)
+ AsciiFile.SetComment(fstab_ref, "^[ \t]*#")
+ AsciiFile.SetDelimiter(fstab_ref, " \t")
+ AsciiFile.SetListWidth(fstab_ref, [20, 20, 10, 21, 1, 1])
+ fstab_ref
+ end
+
+ describe "#ReadFile" do
+ before(:each) do
+ AsciiFile.ReadFile(fstab_ref, FSTAB_FILENAME)
+ end
+
+ # note that the result is `fstab["l"]`
+ # as the rest of `fstab` are the parsing parameters
+ it "produces the result under the 'l' key" do
+ expect(fstab_ref.value).to have_key "l"
+ end
+
+ describe "the result" do
+ subject(:result) { fstab_ref.value["l"] }
+
+ it "is a hash indexed by line numbers, starting at ONE" do
+ expect(result.keys).to eq [1, 2, 3, 4]
+ end
+
+ describe "comment lines" do
+ subject (:comment) { result[2] }
+
+ it "have a true 'comment' key" do
+ expect(comment["comment"]).to be_true
+ end
+
+ it "have a copy in 'line' key, including the comment start" do
+ expect(comment["line"]).to eq "# NFS"
+ end
+ end
+
+ describe "regular non-comment lines" do
+ subject (:regular) { result[1] }
+
+ it "have a falsy 'comment' key" do
+ expect(regular["comment"]).to be_false
+ end
+
+ it "have a copy in 'line' key" do
+ expect(regular["line"]).to eq "UUID=001c0d61-e99f-4ab7-ba4b-bda6f54a052d / btrfs defaults 0 0"
+ end
+
+ describe "its 'fields' key" do
+ it "is an array of delimiter separated fields, starting at zero as usual" do
+ expect(regular["fields"].size).to eq 6
+ expect(regular["fields"][1]).to eq "/"
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/Makefile.am new/yast2-3.1.20/library/systemd/Makefile.am
--- old/yast2-3.1.19/library/systemd/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/Makefile.am 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1 @@
+SUBDIRS = src test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/src/Makefile.am new/yast2-3.1.20/library/systemd/src/Makefile.am
--- old/yast2-3.1.19/library/systemd/src/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/src/Makefile.am 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,11 @@
+module_DATA = \
+ modules/systemd_socket.rb
+
+ylibdir = @ylibdir@/yast2
+ylib_DATA = \
+ lib/yast2/systemctl.rb \
+ lib/yast2/systemd_unit.rb
+
+EXTRA_DIST = $(module_DATA) $(ylib_DATA)
+
+include $(top_srcdir)/Makefile.am.common
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/src/lib/yast2/systemctl.rb new/yast2-3.1.20/library/systemd/src/lib/yast2/systemctl.rb
--- old/yast2-3.1.19/library/systemd/src/lib/yast2/systemctl.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/src/lib/yast2/systemctl.rb 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,44 @@
+require "ostruct"
+
+module Yast
+ module Systemctl
+ CONTROL = "systemctl"
+ COMMAND_OPTIONS = " --no-legend --no-pager --no-ask-password "
+ ENV_VARS = " LANG=C TERM=dumb COLUMNS=1024 "
+ SYSTEMCTL = ENV_VARS + CONTROL + COMMAND_OPTIONS
+
+ class << self
+
+ def execute command
+ OpenStruct.new(SCR.Execute(Path.new(".target.bash_output"), SYSTEMCTL + command))
+ end
+
+ def socket_units
+ sockets_from_files = list_unit_files(:type=>:socket).lines.map do |line|
+ line[/\S+/]
+ end
+
+ sockets_from_units = list_units(:type=>:socket).lines.map do |line|
+ line[/\S+/]
+ end
+
+ ( sockets_from_files | sockets_from_units ).compact
+ end
+
+ private
+
+ def list_unit_files type: nil
+ command = " list-unit-files "
+ command << " --type=#{type} " if type
+ execute(command).stdout
+ end
+
+ def list_units type: nil, all: true
+ command = " list-units "
+ command << " --all " if all
+ command << " --type=#{type} " if type
+ execute(command).stdout
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/src/lib/yast2/systemd_unit.rb new/yast2-3.1.20/library/systemd/src/lib/yast2/systemd_unit.rb
--- old/yast2-3.1.19/library/systemd/src/lib/yast2/systemd_unit.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/src/lib/yast2/systemd_unit.rb 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,140 @@
+require 'yast2/systemctl'
+
+require 'ostruct'
+require 'forwardable'
+
+module Yast
+
+ ###
+ # Use this class always as a parent class for implementing various systemd units.
+ # Do not use it directly for add-hoc implemenation of systemd units.
+ #
+ # @example Create a systemd service unit
+ #
+ # class Service < Yast::SystemdUnit
+ # SUFFIX = ".service"
+ # PROPERTIES = {
+ # :before => "Before"
+ # }
+ #
+ # def initialize service_name, properties={}
+ # service_name += SUFFIX unless service_name.end_with?(SUFFIX)
+ # super(service_name, PROPERTIES.merge(properties))
+ # end
+ #
+ # def before
+ # properties.before.split
+ # end
+ # end
+ #
+ # service = Service.new('sshd')
+ #
+ # service.before # ['shutdown.target', 'multi-user.target']
+ #
+ ###
+
+ class SystemdUnit
+
+ SUPPORTED_TYPES = %w( service socket target )
+ SUPPORTED_STATES = %w( enabled disabled )
+
+ DEFAULT_PROPERTIES = {
+ id: "Id",
+ pid: "MainPID",
+ description: "Description",
+ load_state: "LoadState",
+ active_state: "ActiveState",
+ sub_state: "SubState",
+ unit_file_state: "UnitFileState",
+ path: "FragmentPath"
+ }
+
+ extend Forwardable
+
+ def_delegators :@properties, :id, :path,
+ :active?, :enabled?, :running?, :loaded?
+
+ attr_reader :unit_name, :unit_type, :input_properties, :errors, :properties
+
+ def initialize full_unit_name, properties={}
+ @unit_name, @unit_type = full_unit_name.split(".")
+ raise "Missing unit type suffix" unless unit_type
+ raise "Unsupported unit type '#{unit_type}'" unless SUPPORTED_TYPES.member?(unit_type)
+
+ @errors = ""
+ @input_properties = properties.merge!(DEFAULT_PROPERTIES)
+ @properties = show
+ end
+
+ def show
+ Properties.new(self)
+ end
+
+ def status
+ command("status", :options => "2>&1").stdout
+ end
+
+ def start
+ run_command! { command("start") }
+ end
+
+ def stop
+ run_command! { command("stop") }
+ end
+
+ def enable
+ run_command! { command("enable") }
+ end
+
+ def disable
+ run_command! { command("disable") }
+ end
+
+ def command command_name, options={}
+ Systemctl.execute("#{command_name} #{unit_name}.#{unit_type} #{options[:options]}")
+ end
+
+ private
+
+ def run_command!
+ errors.clear
+ command_result = yield
+ errors << command_result.stderr
+ @properties = show
+ command_result.exit.zero?
+ end
+
+ class Properties < OpenStruct
+
+ def initialize systemd_unit
+ super()
+ self[:systemd_unit] = systemd_unit
+ raw_properties = load_systemd_properties
+ self[:raw] = raw_properties.stdout
+ self[:errors] = raw_properties.stderr
+ extract_properties
+ self[:active?] = active_state == "active"
+ self[:running?] = sub_state == "running"
+ self[:loaded?] = load_state == "loaded"
+ self[:not_found?] = load_state == "not-found"
+ self[:enabled?] = unit_file_state == "enabled"
+ self[:supported?] = SUPPORTED_STATES.member?(unit_file_state)
+ end
+
+ private
+
+ def extract_properties
+ systemd_unit.input_properties.each do |name, property|
+ self[name] = raw[/#{property}=(.+)/, 1]
+ end
+ end
+
+ def load_systemd_properties
+ properties = systemd_unit.input_properties.map do |_, property_name|
+ " --property=#{property_name} "
+ end
+ systemd_unit.command("show", :options => properties.join)
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/src/modules/systemd_socket.rb new/yast2-3.1.20/library/systemd/src/modules/systemd_socket.rb
--- old/yast2-3.1.19/library/systemd/src/modules/systemd_socket.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/src/modules/systemd_socket.rb 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,79 @@
+require 'yast2/systemd_unit'
+
+module Yast
+ ###
+ # Systemd.socket unit control API
+ #
+ # @example How to use it in other yast libraries
+ #
+ # require 'yast'
+ #
+ # Yast.import 'SystemdSocket'
+ #
+ # ## Get a socket unit by its name
+ #
+ # socket = Yast::SystemdSocket.find('iscsid')
+ #
+ # ## Get basic unit properties
+ #
+ # socket.unit_name # 'iscsid'
+ # socket.unit_type # 'socket'
+ # socket.id # 'iscsid.socket'
+ # socket.path # '/usr/lib/systemd/system/iscsid.socket' => unit file path
+ # socket.loaded? # true if it's loaded, false otherwise
+ # socket.listening? # true if it's listening, false otherwise
+ # socket.enabled? # true if enabled, false otherwise
+ # socket.disabled? # true if disabled, false otherwise
+ # socket.status # the same string output you get with `systemctl status iscsid.socket`
+ # socket.show # equivalent of calling `systemctl show iscsid.socket`
+ #
+ # ## Socket unit file commands
+ #
+ # # Unit file commands do modifications on the socket unit. Calling them triggers
+ # # socket properties reloading. In case a command fails, the error messages are available
+ # # through the method #errors as a string.
+ #
+ # socket.start # true if unit has been activated successfully
+ # socket.stop # true if unit has been deactivated successfully
+ # socket.enable # true if unit has been enabled successfully
+ # socket.disable # true if unit has been disabled successfully
+ # socket.errors # error string available if some of the actions above fails
+ #
+ # ## Extended socket properties
+ #
+ # # In case you need more details about the socket unit than the default ones,
+ # # you can extend the paramters when getting the socket. Those properties are
+ # # then available under the #properties instance method. To get an overview of
+ # # available socket properties, try e.g., `systemctl show iscsid.socket`
+ #
+ # socket = Yast::SystemdSocket.find('iscsid', :can_start=>'CanStart', :triggers=>'Triggers')
+ # socket.properties.can_start # 'yes'
+ # socket.properties.triggers # 'iscsid.service'
+ #
+ ##
+
+ class SystemdSocketClass < Module
+ UNIT_SUFFIX = ".socket"
+
+ def find socket_name, properties={}
+ socket_name += UNIT_SUFFIX unless socket_name.end_with?(UNIT_SUFFIX)
+ socket = Socket.new(socket_name, properties)
+ return nil if socket.properties.not_found?
+ socket
+ end
+
+ def all properties={}
+ sockets = Systemctl.socket_units.map do |socket_unit|
+ Socket.new(socket_unit, properties)
+ end
+ sockets.select {|s| s.properties.supported?}
+ end
+
+ class Socket < SystemdUnit
+ def listening?
+ properties.sub_state == "listening"
+ end
+ end
+ end
+ SystemdSocket = SystemdSocketClass.new
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/Makefile.am new/yast2-3.1.20/library/systemd/test/Makefile.am
--- old/yast2-3.1.19/library/systemd/test/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/Makefile.am 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,12 @@
+TESTS = \
+ test_helper.rb \
+ systemctl_test.rb \
+ systemd_unit_test.rb \
+ systemd_socket_test.rb
+
+TEST_EXTENSIONS = .rb
+RB_LOG_COMPILER = rspec
+VERBOSE = 1
+
+EXTRA_DIST = $(TESTS)
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/data/iscsid_socket_properties new/yast2-3.1.20/library/systemd/test/data/iscsid_socket_properties
--- old/yast2-3.1.19/library/systemd/test/data/iscsid_socket_properties 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/data/iscsid_socket_properties 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,119 @@
+Id=iscsid.socket
+Names=iscsid.socket
+Requires=sysinit.target
+Wants=system.slice
+Conflicts=shutdown.target
+Before=iscsid.service sockets.target shutdown.target
+After=sysinit.target system.slice
+Triggers=iscsid.service
+Documentation=man:iscsid(8) man:iscsiadm(8)
+Description=Open-iSCSI iscsid Socket
+LoadState=loaded
+ActiveState=active
+SubState=listening
+FragmentPath=/usr/lib/systemd/system/iscsid.socket
+UnitFileState=disabled
+InactiveExitTimestamp=Tue 2014-02-18 11:24:48 CET
+InactiveExitTimestampMonotonic=504143880115
+ActiveEnterTimestamp=Tue 2014-02-18 11:24:48 CET
+ActiveEnterTimestampMonotonic=504143880115
+ActiveExitTimestampMonotonic=0
+InactiveEnterTimestampMonotonic=0
+CanStart=yes
+CanStop=yes
+CanReload=no
+CanIsolate=no
+StopWhenUnneeded=no
+RefuseManualStart=no
+RefuseManualStop=no
+AllowIsolate=no
+DefaultDependencies=yes
+OnFailureIsolate=no
+IgnoreOnIsolate=no
+IgnoreOnSnapshot=no
+NeedDaemonReload=no
+JobTimeoutUSec=0
+ConditionTimestamp=Tue 2014-02-18 11:24:48 CET
+ConditionTimestampMonotonic=504143880077
+ConditionResult=yes
+Transient=no
+Slice=system.slice
+ControlGroup=/system.slice/iscsid.socket
+BindIPv6Only=default
+Backlog=128
+TimeoutUSec=1min 30s
+ControlPID=0
+DirectoryMode=0755
+SocketMode=0666
+Accept=no
+KeepAlive=no
+Priority=-1
+ReceiveBuffer=0
+SendBuffer=0
+IPTOS=-1
+IPTTL=-1
+PipeSize=0
+FreeBind=no
+Transparent=no
+Broadcast=no
+PassCredentials=no
+PassSecurity=no
+ListenStream=@ISCSIADM_ABSTRACT_NAMESPACE
+Mark=-1
+MaxConnections=64
+NConnections=0
+NAccepted=0
+Result=success
+ReusePort=no
+UMask=0022
+LimitCPU=18446744073709551615
+LimitFSIZE=18446744073709551615
+LimitDATA=18446744073709551615
+LimitSTACK=18446744073709551615
+LimitCORE=18446744073709551615
+LimitRSS=18446744073709551615
+LimitNOFILE=4096
+LimitAS=18446744073709551615
+LimitNPROC=7770
+LimitMEMLOCK=65536
+LimitLOCKS=18446744073709551615
+LimitSIGPENDING=7770
+LimitMSGQUEUE=819200
+LimitNICE=0
+LimitRTPRIO=0
+LimitRTTIME=18446744073709551615
+OOMScoreAdjust=0
+Nice=0
+IOScheduling=0
+CPUSchedulingPolicy=0
+CPUSchedulingPriority=0
+TimerSlackNSec=50000
+CPUSchedulingResetOnFork=no
+NonBlocking=no
+StandardInput=null
+StandardOutput=journal
+StandardError=inherit
+TTYReset=no
+TTYVHangup=no
+TTYVTDisallocate=no
+SyslogPriority=30
+SyslogLevelPrefix=yes
+SecureBits=0
+CapabilityBoundingSet=18446744073709551615
+MountFlags=0
+PrivateTmp=no
+PrivateNetwork=no
+SameProcessGroup=no
+IgnoreSIGPIPE=yes
+NoNewPrivileges=no
+KillMode=control-group
+KillSignal=15
+SendSIGKILL=yes
+SendSIGHUP=no
+CPUAccounting=no
+CPUShares=1024
+BlockIOAccounting=no
+BlockIOWeight=1000
+MemoryAccounting=no
+MemoryLimit=18446744073709551615
+DevicePolicy=auto
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/systemctl_test.rb new/yast2-3.1.20/library/systemd/test/systemctl_test.rb
--- old/yast2-3.1.19/library/systemd/test/systemctl_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/systemctl_test.rb 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,23 @@
+#!/usr/bin/env rspec
+
+require_relative 'test_helper'
+require 'yast2/systemctl'
+
+module Yast
+ describe Systemctl do
+ include SystemctlStubs
+
+ before do
+ stub_systemctl
+ end
+
+ describe ".socket_units" do
+ it "returns a list of socket unit ids registered with systemd" do
+ socket_units = Systemctl.socket_units
+ expect(socket_units).to be_a(Array)
+ expect(socket_units).not_to be_empty
+ socket_units.each {|u| expect(u).to match(/.socket$/) }
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/systemd_socket_test.rb new/yast2-3.1.20/library/systemd/test/systemd_socket_test.rb
--- old/yast2-3.1.19/library/systemd/test/systemd_socket_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/systemd_socket_test.rb 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,46 @@
+#!/usr/bin/env rspec
+
+require_relative "test_helper"
+
+module Yast
+ import 'SystemdSocket'
+
+ describe SystemdSocket do
+ include SystemdSocketStubs
+
+ before do
+ stub_sockets
+ end
+
+ describe ".find" do
+ it "returns the unit object specified in parameter" do
+ socket = SystemdSocket.find "iscsid"
+ expect(socket).to be_a(SystemdUnit)
+ expect(socket.unit_type).to eq("socket")
+ expect(socket.unit_name).to eq("iscsid")
+ end
+ end
+
+ describe ".all" do
+ it "returns all supported sockets found" do
+ sockets = SystemdSocket.all
+ expect(sockets).to be_a(Array)
+ expect(sockets).not_to be_empty
+ sockets.each {|s| expect(s.unit_type).to eq('socket')}
+ end
+ end
+
+ describe "#listening?" do
+ it "returns true if the socket is accepting connections" do
+ socket = SystemdSocket.find "iscsid"
+ expect(socket.listening?).to be_true
+ end
+
+ it "returns false if the socket is dead" do
+ socket = SystemdSocket.find "iscsid"
+ socket.properties.sub_state = "dead"
+ expect(socket.listening?).to be_false
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/systemd_unit_test.rb new/yast2-3.1.20/library/systemd/test/systemd_unit_test.rb
--- old/yast2-3.1.19/library/systemd/test/systemd_unit_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/systemd_unit_test.rb 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,195 @@
+#!/usr/bin/env rspec
+
+require_relative 'test_helper'
+require 'yast2/systemd_unit'
+
+module Yast
+ describe SystemdUnit do
+ include SystemdSocketStubs
+
+ def trigger_reloading_properties command
+ unit = SystemdUnit.new("new.socket")
+ properties = unit.properties
+ unit.send(command)
+ expect(unit.properties).not_to equal(properties)
+ end
+
+ before do
+ stub_sockets
+ end
+
+ describe "#properties" do
+ it "always returns struct including default properties" do
+ unit = SystemdUnit.new("iscsi.socket")
+ expect(unit.properties.to_h.keys).to include(*SystemdUnit::DEFAULT_PROPERTIES.keys)
+ end
+
+ it "provides status properties methods" do
+ unit = SystemdUnit.new("iscsid.socket")
+ expect(unit.properties[:enabled?]).not_to be_nil
+ expect(unit.properties[:active?]).not_to be_nil
+ expect(unit.properties[:running?]).not_to be_nil
+ expect(unit.properties[:loaded?]).not_to be_nil
+ expect(unit.properties[:supported?]).not_to be_nil
+ expect(unit.properties[:not_found?]).not_to be_nil
+ expect(unit.properties[:path]).not_to be_nil
+ expect(unit.properties[:errors]).not_to be_nil
+ expect(unit.properties[:raw]).not_to be_nil
+ end
+
+ it "delegates the status properties onto the unit object" do
+ unit = SystemdUnit.new("iscsid.socket")
+ expect(unit).to respond_to(:enabled?)
+ expect(unit).to respond_to(:active?)
+ expect(unit).to respond_to(:running?)
+ expect(unit).to respond_to(:loaded?)
+ expect(unit).to respond_to(:path)
+ end
+ end
+
+ describe ".new" do
+ it "creates a new SystemdUnit instance with unit name and type parsed from first parameter" do
+ instance = SystemdUnit.new("random.socket")
+ expect { SystemdUnit.new("random.socket") }.not_to raise_error
+ expect(instance.unit_name).to eq("random")
+ expect(instance.unit_type).to eq("socket")
+ end
+
+ it "raises an exception if an incomplete unit name is passed" do
+ expect { SystemdUnit.new("sshd") }.to raise_error
+ end
+
+ it "allows to create supported units" do
+ expect { SystemdUnit.new("my.socket") }.not_to raise_error
+ expect { SystemdUnit.new("default.target") }.not_to raise_error
+ expect { SystemdUnit.new("sshd.service") }.not_to raise_error
+ end
+
+ it "raises an exception if unsupported unit name is passed" do
+ expect { SystemdUnit.new("random.unit") }.to raise_error
+ end
+
+ it "accepts parameters to extend the default properties" do
+ unit = SystemdUnit.new("iscsid.socket", :requires => "Requires", :wants => "Wants")
+ expect(unit.properties.wants).not_to be_nil
+ expect(unit.properties.requires).not_to be_nil
+ end
+ end
+
+ describe "#stop" do
+ it "returns true if unit has been stopped" do
+ stub_unit_command
+ unit = SystemdUnit.new("my.socket")
+ expect(unit.stop).to be_true
+ end
+
+ it "returns false if failed" do
+ stub_unit_command(:success=>false)
+ unit = SystemdUnit.new("my.socket")
+ expect(unit.stop).to be_false
+ expect(unit.errors).not_to be_empty
+ end
+
+ it "triggers reloading of unit properties" do
+ trigger_reloading_properties(:stop)
+ end
+ end
+
+ describe "#start" do
+ it "returns true if starts (activates) the unit" do
+ stub_unit_command(:success=>true)
+ unit = SystemdUnit.new("my.socket")
+ expect(unit.start).to be_true
+ end
+
+ it "returns false if failed to start the unit" do
+ stub_unit_command(:success=>false)
+ unit = SystemdUnit.new("my.socket")
+ expect(unit.start).to be_false
+ expect(unit.errors).not_to be_empty
+ end
+
+ it "triggers reloading of unit properties" do
+ trigger_reloading_properties(:start)
+ end
+ end
+
+ describe "#enable" do
+ it "returns true if the unit has been enabled successfully" do
+ stub_unit_command(:success=>true)
+ unit = SystemdUnit.new("your.socket")
+ expect(unit.enable).to be_true
+ end
+
+ it "returns false if unit fails" do
+ stub_unit_command(:success=>false)
+ unit = SystemdUnit.new("your.socket")
+ expect(unit.enable).to be_false
+ end
+
+ it "triggers reloading of unit properties" do
+ trigger_reloading_properties(:enable)
+ end
+ end
+
+ describe "#disable" do
+ it "returns true if the unit has been disabled successfully" do
+ stub_unit_command(:success=>true)
+ unit = SystemdUnit.new("your.socket")
+ expect(unit.disable).to be_true
+ end
+
+ it "returns false if unit disabling fails" do
+ stub_unit_command(:success=>false)
+ unit = SystemdUnit.new("your.socket")
+ expect(unit.disable).to be_false
+ end
+
+ it "triggers reloading of unit properties" do
+ trigger_reloading_properties(:disable)
+ end
+ end
+
+ describe "#show" do
+ it "always returns new unit properties object" do
+ unit = SystemdUnit.new("startrek.socket")
+ expect(unit.show).not_to equal(unit.show)
+ end
+ end
+
+ describe "#errors" do
+ it "returns empty string if the unit commands succeed" do
+ stub_unit_command(:success=>true)
+ unit = SystemdUnit.new("your.socket")
+ unit.start
+ expect(unit.errors).to be_empty
+
+ unit.stop
+ expect(unit.errors).to be_empty
+
+ unit.enable
+ expect(unit.errors).to be_empty
+
+ unit.disable
+ expect(unit.errors).to be_empty
+ end
+
+ it "returns error string if the unit commands fail" do
+ stub_unit_command(:success=>false)
+ unit = SystemdUnit.new("your.socket")
+ unit.start
+ expect(unit.errors).not_to be_empty
+
+ unit.stop
+ expect(unit.errors).not_to be_empty
+
+ unit.enable
+ expect(unit.errors).not_to be_empty
+
+ unit.disable
+ expect(unit.errors).not_to be_empty
+ end
+ end
+
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/test_helper.rb new/yast2-3.1.20/library/systemd/test/test_helper.rb
--- old/yast2-3.1.19/library/systemd/test/test_helper.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/test_helper.rb 2014-02-27 11:05:00.000000000 +0100
@@ -0,0 +1,91 @@
+require 'rspec'
+
+ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
+
+require "yast"
+
+module SystemctlStubs
+
+ def stub_systemctl
+ stub_socket_unit_files
+ stub_socket_units
+ stub_execute
+ end
+
+
+ def stub_execute success: true
+ Yast::Systemctl.stub(:execute).and_return(
+ OpenStruct.new \
+ :stdout => 'success',
+ :stderr => ( success ? '' : 'failure'),
+ :exit => ( success ? 0 : 1 )
+ )
+ end
+
+ def stub_socket_unit_files
+ Yast::Systemctl.stub(:list_unit_files).and_return(<<LIST
+iscsid.socket disabled
+avahi-daemon.socket enabled
+cups.socket enabled
+dbus.socket static
+dm-event.socket disabled
+LIST
+ )
+ end
+
+ def stub_socket_units
+ Yast::Systemctl.stub(:list_units).and_return(<<LIST
+iscsid.socket loaded active listening Open-iSCSI iscsid Socket
+avahi-daemon.socket loaded active running Avahi mDNS/DNS-SD Stack Activation Socket
+cups.socket loaded inactive dead CUPS Printing Service Sockets
+dbus.socket loaded active running D-Bus System Message Bus Socket
+dm-event.socket loaded inactive dead Device-mapper event daemon FIFOs
+lvm2-lvmetad.socket loaded inactive dead LVM2 metadata daemon socket
+pcscd.socket loaded active listening PC/SC Smart Card Daemon Activation Socket
+LIST
+ )
+ end
+
+end
+
+module SystemdUnitStubs
+ def stub_unit_command success: true
+ Yast::SystemdUnit
+ .any_instance
+ .stub(:command)
+ .and_return(
+ OpenStruct.new \
+ :stdout => 'success',
+ :stderr => ( success ? '' : 'failure'),
+ :exit => ( success ? 0 : 1 )
+ )
+ end
+end
+
+module SystemdSocketStubs
+ include SystemctlStubs
+ include SystemdUnitStubs
+
+ def socket_properties
+ @properties ||= OpenStruct.new(
+ :stdout => File.read(File.join(__dir__, 'data', 'iscsid_socket_properties')),
+ :stderr => '',
+ :exit => 0
+ )
+ end
+
+ def stub_sockets
+ stub_unit_command
+ stub_systemctl
+ stub_socket_properties
+ end
+
+ def stub_socket_properties
+ Yast::SystemdUnit::Properties
+ .any_instance
+ .stub(:load_systemd_properties)
+ .and_return(socket_properties)
+ end
+
+end
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/package/yast2.changes new/yast2-3.1.20/package/yast2.changes
--- old/yast2-3.1.19/package/yast2.changes 2014-02-10 16:05:29.000000000 +0100
+++ new/yast2-3.1.20/package/yast2.changes 2014-02-27 11:05:00.000000000 +0100
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Feb 27 09:56:16 UTC 2014 - vmoravec(a)suse.com
+
+- Add systemd socket support (bnc#853300)
+- 3.1.20
+
+-------------------------------------------------------------------
Mon Feb 10 13:18:52 UTC 2014 - lslezak(a)suse.cz
- added memory detection code (gh#yast/yast-packager#33)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/package/yast2.spec new/yast2-3.1.20/package/yast2.spec
--- old/yast2-3.1.19/package/yast2.spec 2014-02-10 16:05:29.000000000 +0100
+++ new/yast2-3.1.20/package/yast2.spec 2014-02-27 11:05:00.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2
-Version: 3.1.19
+Version: 3.1.20
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
continue with "q"...
Checked in at Thu Feb 27 16:11:45 CET 2014 by ro
Remember to have fun...
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org