Mailinglist Archive: yast-commit (1271 mails)

< Previous Next >
[yast-commit] [ci_new_pac] JFYI yast2-registration -> sle12
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-registration
-> sle12



## BNC# 894470 : "yast2-scc should filter SUSE Manager SLP announcements out"
(RESOLVED/FIXED)
## BNC# 893750 : "Build0732: AutoYaST does not install extensions / modules"
(RESOLVED/FIXED)

Changes:
--------
--- /work/SRC/SUSE:SLE-12:GA/yast2-registration/yast2-registration.changes
2014-08-29 14:26:44.000000000 +0200
+++ /mounts/work_src_done/SLE12/yast2-registration/yast2-registration.changes
2014-09-01 20:08:41.000000000 +0200
@@ -1,0 +2,14 @@
+Mon Sep 1 17:21:41 UTC 2014 - lslezak@xxxxxxx
+
+- ignore SUSE Manager services in SLP discovery (bnc#894470)
+- 3.1.114
+
+-------------------------------------------------------------------
+Mon Sep 1 09:42:45 UTC 2014 - lslezak@xxxxxxx
+
+- select extension/module products to install in Autoyast mode
+ (bnc#893750)
+- upgrade registration in Autoyast autoupgrade mode
+- 3.1.113
+
+-------------------------------------------------------------------

calling whatdependson for sle12-i586
Packages directly triggered for rebuild:
- yast2-registration
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/SUSE:SLE-12:GA/yast2-registration (Old)
and /mounts/work_src_done/SLE12/yast2-registration (BS:build ID:43343
MAIL:yast-commit@xxxxxxxxxxxx) (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-registration", Maintainer is "yast-commit@xxxxxxxxxxxx"


Old:
----
yast2-registration-3.1.112.tar.bz2

New:
----
yast2-registration-3.1.114.tar.bz2

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

Other differences:
------------------
++++++ yast2-registration.spec ++++++
--- /var/tmp/diff_new_pack.B3mdsE/_old 2014-09-02 15:57:51.000000000 +0200
+++ /var/tmp/diff_new_pack.B3mdsE/_new 2014-09-02 15:57:51.000000000 +0200
@@ -17,7 +17,7 @@


Name: yast2-registration
-Version: 3.1.112
+Version: 3.1.114
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build

++++++ yast2-registration-3.1.112.tar.bz2 -> yast2-registration-3.1.114.tar.bz2
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-3.1.112/package/yast2-registration.changes
new/yast2-registration-3.1.114/package/yast2-registration.changes
--- old/yast2-registration-3.1.112/package/yast2-registration.changes
2014-08-28 17:49:32.000000000 +0200
+++ new/yast2-registration-3.1.114/package/yast2-registration.changes
2014-09-01 20:04:20.000000000 +0200
@@ -1,4 +1,18 @@
-------------------------------------------------------------------
+Mon Sep 1 17:21:41 UTC 2014 - lslezak@xxxxxxx
+
+- ignore SUSE Manager services in SLP discovery (bnc#894470)
+- 3.1.114
+
+-------------------------------------------------------------------
+Mon Sep 1 09:42:45 UTC 2014 - lslezak@xxxxxxx
+
+- select extension/module products to install in Autoyast mode
+ (bnc#893750)
+- upgrade registration in Autoyast autoupgrade mode
+- 3.1.113
+
+-------------------------------------------------------------------
Thu Aug 28 14:06:14 UTC 2014 - lslezak@xxxxxxx

- read proxy credentials from .curlrc file (bnc#885957)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-3.1.112/package/yast2-registration.spec
new/yast2-registration-3.1.114/package/yast2-registration.spec
--- old/yast2-registration-3.1.112/package/yast2-registration.spec
2014-08-28 17:49:32.000000000 +0200
+++ new/yast2-registration-3.1.114/package/yast2-registration.spec
2014-09-01 20:04:20.000000000 +0200
@@ -17,7 +17,7 @@


Name: yast2-registration
-Version: 3.1.112
+Version: 3.1.114
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-registration-3.1.112/src/clients/inst_scc.rb
new/yast2-registration-3.1.114/src/clients/inst_scc.rb
--- old/yast2-registration-3.1.112/src/clients/inst_scc.rb 2014-08-28
17:49:32.000000000 +0200
+++ new/yast2-registration-3.1.114/src/clients/inst_scc.rb 2014-09-01
20:04:20.000000000 +0200
@@ -35,6 +35,7 @@
require "registration/storage"
require "registration/url_helpers"
require "registration/registration"
+require "registration/registration_ui"
require "registration/ui/addon_eula_dialog"
require "registration/ui/addon_selection_dialog"
require "registration/ui/addon_reg_codes_dialog"
@@ -136,42 +137,11 @@

next if init_registration == :cancel

- success = ::Registration::ConnectHelpers.catch_registration_errors do
- base_product = ::Registration::SwMgmt.find_base_product
- distro_target = base_product["register_target"]
-
- if !::Registration::Registration.is_registered?
- log.info "Registering system, distro_target: #{distro_target}"
-
- Popup.Feedback(_(CONTACTING_MESSAGE),
- _("Registering the System...")) do
-
- @registration.register(email, reg_code, distro_target)
- end
- end
-
- if !options.base_registered
- # then register the product(s)
- product_service = Popup.Feedback(_(CONTACTING_MESSAGE),
- _("Registering %s ...") %
::Registration::SwMgmt.base_product_label(base_product)
- ) do
-
- base_product_data =
::Registration::SwMgmt.base_product_to_register
- base_product_data["reg_code"] = reg_code
- registered_service =
@registration.register_product(base_product_data, email)
- options.base_registered = true
-
- registered_service
- end
-
- # select repositories to use in installation or update (e.g.
enable/disable Updates)
- select_repositories(product_service) if Mode.installation ||
Mode.update
- end
-
- return :next
- end
+ success = registration_ui.register_system_and_base_product(email,
reg_code,
+ register_base_product: !options.base_registered, disable_updates:
!install_updates?)

if success
+ options.base_registered = true
# save the config if running in installed system
# (in installation/upgrade it's written in _finish client)
::Registration::Helpers.write_config if Mode.normal
@@ -199,28 +169,7 @@
def refresh_base_product
return false if init_registration == :cancel

- upgraded =
::Registration::ConnectHelpers.catch_registration_errors(show_update_hint:
true) do
- # then register the product(s)
- base_product = ::Registration::SwMgmt.base_product_to_register
- product_services = Popup.Feedback(
- _(CONTACTING_MESSAGE),
- # updating base product registration, %s is a new base product name
- _("Updating to %s ...") % ::Registration::SwMgmt.base_product_label(
- ::Registration::SwMgmt.find_base_product)
- ) do
- @registration.upgrade_product(base_product)
- end
-
- # select repositories to use in installation (e.g. enable/disable
Updates)
- select_repositories(product_services)
- end
-
- if !upgraded
- log.info "Registration upgrade failed, removing the credentials to
register from scratch"
- ::Registration::Helpers.reset_registration_status
- end
-
- upgraded
+ registration_ui.update_base_product(enable_updates: install_updates?)
end

def refresh_addons
@@ -233,32 +182,10 @@
return :cancel
end

- # find addon updates
- addons_to_update = ::Registration::SwMgmt.find_addon_updates(addons)
+ failed_addons = registration_ui.update_addons(addons, enable_updates:
install_updates?)

- failed_addons = addons_to_update.reject do |addon_to_update|
- ::Registration::ConnectHelpers.catch_registration_errors do
- # then register the product(s)
- product_services = Popup.Feedback(
- _(CONTACTING_MESSAGE),
- # updating registered addon/extension, %s is an extension name
- _("Updating to %s ...") % addon_to_update.label
- ) do
- @registration.upgrade_product(addon_to_update)
- end
-
- # mark as registered
- addon_to_update.registered
-
- select_repositories(product_services)
- end
- end
-
- if !failed_addons.empty?
- log.warn "Failed addons: #{failed_addons}"
- # if update fails preselest the addon for full registration
- failed_addons.each(&:selected)
- end
+ # if update fails preselest the addon for full registration
+ failed_addons.each(&:selected)

:next
end
@@ -373,12 +300,11 @@
end
end

- def select_repositories(product_service)
- options = ::Registration::Storage::InstallationOptions.instance
+ def install_updates?
+ # ask only at installation/update
+ return true unless Mode.installation || Mode.update

- # added update repositories
- updates = ::Registration::SwMgmt.service_repos(product_service,
only_updates: true)
- log.info "Found update repositories: #{updates.size}"
+ options = ::Registration::Storage::InstallationOptions.instance

# not set yet?
if options.install_updates.nil?
@@ -388,7 +314,15 @@
"on-line updates during installation?"))
end

- ::Registration::SwMgmt.set_repos_state(updates, options.install_updates)
+ options.install_updates
+ end
+
+ def select_repositories(product_service)
+ # added update repositories
+ updates = ::Registration::SwMgmt.service_repos(product_service,
only_updates: true)
+ log.info "Found update repositories: #{updates.size}"
+
+ ::Registration::SwMgmt.set_repos_state(updates, install_updates?)
end

# run the addon selection dialog
@@ -411,15 +345,7 @@
# cache the available addons
return :cancel if init_registration == :cancel

- @available_addons = Popup.Feedback(
- _(CONTACTING_MESSAGE),
- _("Loading Available Extensions and Modules...")) do
-
- Registration::Addon.find_all(@registration)
- end
-
- ::Registration::Storage::Cache.instance.available_addons =
@available_addons
- @available_addons
+ registration_ui.get_available_addons
end

# register all selected addons
@@ -610,6 +536,10 @@
WFM.call("sw_single")
end

+ def registration_ui
+ ::Registration::RegistrationUI.new(@registration)
+ end
+
# UI workflow definition
def start_workflow
aliases = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-registration-3.1.112/src/clients/scc_auto.rb
new/yast2-registration-3.1.114/src/clients/scc_auto.rb
--- old/yast2-registration-3.1.112/src/clients/scc_auto.rb 2014-08-28
17:49:32.000000000 +0200
+++ new/yast2-registration-3.1.114/src/clients/scc_auto.rb 2014-09-01
20:04:20.000000000 +0200
@@ -57,6 +57,7 @@
Yast.import "Label"
Yast.import "Report"
Yast.import "Popup"
+ Yast.import "Installation"

log.info "scc_auto started"

@@ -135,6 +136,15 @@
# register the system, base product and optional addons
# return true on success
def write
+ # try updating the registratin in AutoUpgrade mode
+ if Mode.update
+ updated = update_registration
+ log.info "Registration updated: #{updated}"
+
+ # if update failed continue with the normal registration
+ return true if updated
+ end
+
# registration disabled, nothing to do
return true unless @config.do_registration

@@ -159,43 +169,7 @@
import_certificate(@config.reg_server_cert)
end

- base_product = ::Registration::SwMgmt.find_base_product
- distro_target = base_product["register_target"]
-
- if !::Registration::Registration.is_registered?
- log.info "Registering system, distro_target: #{distro_target}"
-
- Popup.Feedback(_(CONTACTING_MESSAGE),
- _("Registering the System...")) do
-
- @registration.register(@config.email, @config.reg_code,
distro_target)
- end
- end
-
- # register the base product
- product_service = Popup.Feedback(_(CONTACTING_MESSAGE),
- _("Registering %s ...") %
::Registration::SwMgmt.base_product_label(base_product)
- ) do
-
- base_product_data = ::Registration::SwMgmt.base_product_to_register
- base_product_data["reg_code"] = @config.reg_code
- @registration.register_product(base_product_data, @config.email)
- end
-
- disable_update_repos(product_service) if !@config.install_updates
-
- # register addons
- @config.addons.each do |addon|
- product_service = Popup.Feedback(
- _(CONTACTING_MESSAGE),
- # %s is name of given product
- _("Registering %s ...") % addon["name"]) do
-
- @registration.register_product(addon)
- end
-
- disable_update_repos(product_service) if !@config.install_updates
- end
+ register_base_product && register_addons
end

return false unless ret
@@ -220,13 +194,6 @@
ret
end

- # TODO: share this?
- def disable_update_repos(product_service)
- update_repos = ::Registration::SwMgmt.service_repos(product_service,
only_updates: true)
- log.info "Disabling #{update_repos.size} update repositories:
#{update_repos}"
- ::Registration::SwMgmt.set_repos_state(update_repos, false)
- end
-
# find registration server via SLP
# @retun [String,nil] URL of the server, nil on error
def find_slp_server
@@ -270,6 +237,70 @@
::Registration::UI::AutoyastConfigWorkflow.run(@config)
end

+ def update_registration
+ url = ::Registration::UrlHelpers.registration_url
+ log.info "Updating registration using URL: #{url}"
+ @registration = ::Registration::Registration.new(url)
+ @registration_ui = ::Registration::RegistrationUI.new(@registration)
+
+ # the old system was not registered
+ return false unless prepare_update
+
+ return false unless update_base_product
+ return false unless update_addons
+
+ # register additional addons (e.g. originally not present in SLE11)
+ register_addons
+ end
+
+ # TODO FIXME: share these methods with inst_scc.rb
+
+ def register_base_product
+ @registration_ui.register_system_and_base_product(@config.email,
@config.reg_code,
+ disable_updates: !@config.install_updates)
+ end
+
+ def register_addons
+ # register addons
+ @config.addons.each do |addon|
+ product_service = Popup.Feedback(
+ _(CONTACTING_MESSAGE),
+ # %s is name of given product
+ _("Registering %s ...") % addon["name"]) do
+
+ @registration.register_product(addon)
+ end
+
+ ::Registration::Storage::Cache.instance.addon_services <<
product_service
+
+ @registration_ui.disable_update_repos(product_service) if
!@config.install_updates
+ end
+
+ # install the new products
+ ::Registration::SwMgmt.select_addon_products
+ end
+
+ def prepare_update
+ ::Registration::SwMgmt.copy_old_credentials(Installation.destdir)
+
+ # update the registration using the old credentials
+ File.exists?(::Registration::Registration::SCC_CREDENTIALS)
+ end
+
+ # @return [Boolean] true on success
+ def update_base_product
+ @registration_ui.update_base_product(enable_updates:
@config.install_updates)
+ end
+
+ # @return [Boolean] true on success
+ # TODO FIXME share with inst_scc.rb
+ def update_addons
+ addons = @registration_ui.get_available_addons
+
+ failed_addons = @registration_ui.update_addons(addons, enable_updates:
@config.install_updates)
+ failed_addons.empty?
+ end
+
end unless defined?(SccAutoClient)
end

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-3.1.112/src/lib/registration/registration_ui.rb
new/yast2-registration-3.1.114/src/lib/registration/registration_ui.rb
--- old/yast2-registration-3.1.112/src/lib/registration/registration_ui.rb
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-registration-3.1.114/src/lib/registration/registration_ui.rb
2014-09-01 20:04:20.000000000 +0200
@@ -0,0 +1,171 @@
+# encoding: utf-8
+
+#
------------------------------------------------------------------------------
+# Copyright (c) 2014 SUSE LLC
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of version 2 of the GNU General Public License as published by the
+# Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, contact Novell, Inc.
+#
+# To contact Novell about this file by physical or electronic mail, you may
find
+# current contact information at www.novell.com.
+#
------------------------------------------------------------------------------
+#
+
+require "yast"
+
+require "registration/connect_helpers"
+require "registration/registration"
+require "registration/sw_mgmt"
+require "registration/storage"
+
+module Registration
+
+ # Registration functions with errror handling, progress messages, etc...
+ # This is a high level APi above Registration::Registration class
+ class RegistrationUI
+ include Yast::Logger
+ include Yast::I18n
+ extend Yast::I18n
+
+ # popup message
+ CONTACTING_MESSAGE = N_("Contacting the Registration Server")
+
+ def initialize(registration)
+ textdomain "registration"
+ @registration = registration
+
+ Yast.import "Popup"
+ end
+
+ # register the system and the base product
+ # @return [Boolean] true on success
+ # TODO FIXME: split to two separate parts
+ def register_system_and_base_product(email, reg_code,
+ register_base_product: true, disable_updates: false)
+
+ success = ConnectHelpers.catch_registration_errors do
+ base_product = SwMgmt.find_base_product
+
+ if !Registration.is_registered?
+ distro_target = base_product["register_target"]
+ log.info "Registering system, distro_target: #{distro_target}"
+
+ Yast::Popup.Feedback(_(CONTACTING_MESSAGE),
+ _("Registering the System...")) do
+
+ registration.register(email, reg_code, distro_target)
+ end
+ end
+
+ if register_base_product
+ # then register the product(s)
+ product_service = Yast::Popup.Feedback(_(CONTACTING_MESSAGE),
+ _("Registering %s ...") % SwMgmt.base_product_label(base_product)
+ ) do
+
+ base_product_data = SwMgmt.base_product_to_register
+ base_product_data["reg_code"] = reg_code
+ registration.register_product(base_product_data, email)
+ end
+
+ # select repositories to use in installation or update (e.g.
enable/disable Updates)
+ disable_update_repos(product_service) if disable_updates
+ end
+ end
+
+ log.info "Registration suceeded: #{success}"
+ success
+ end
+
+
+ # @parama [Boolean] enable_updates Enable or disable added update
repositories
+ # @return [Boolean] true on success
+ def update_base_product(enable_updates: true)
+ upgraded = ConnectHelpers.catch_registration_errors(show_update_hint:
true) do
+ # then register the product(s)
+ base_product = SwMgmt.base_product_to_register
+ product_service = Yast::Popup.Feedback(
+ _(CONTACTING_MESSAGE),
+ # updating base product registration, %s is a new base product name
+ _("Updating to %s ...") % SwMgmt.base_product_label(
+ SwMgmt.find_base_product)
+ ) do
+ registration.upgrade_product(base_product)
+ end
+
+ # select repositories to use in installation (e.g. enable/disable
Updates)
+ disable_update_repos(product_service) if !enable_updates
+ end
+
+ if !upgraded
+ log.info "Registration upgrade failed, removing the credentials to
register from scratch"
+ Helpers.reset_registration_status
+ end
+
+ upgraded
+ end
+
+ def update_addons(addons, enable_updates: true)
+ # find addon updates
+ addons_to_update = SwMgmt.find_addon_updates(addons)
+
+ failed_addons = addons_to_update.reject do |addon_to_update|
+ ConnectHelpers.catch_registration_errors do
+ # then register the product(s)
+ product_service = Yast::Popup.Feedback(
+ _(CONTACTING_MESSAGE),
+ # updating registered addon/extension, %s is an extension name
+ _("Updating to %s ...") % addon_to_update.label
+ ) do
+ registration.upgrade_product(addon_to_update)
+ end
+
+ Storage::Cache.instance.addon_services << product_service
+
+ # select repositories to use in installation (e.g. enable/disable
Updates)
+ disable_update_repos(product_service) if !enable_updates
+ end
+ end
+
+ # install the new upgraded products
+ SwMgmt.select_addon_products
+
+ log.error "Failed addons: #{failed_addons}" unless failed_addons.empty?
+
+ failed_addons
+ end
+
+
+ # load available addons from SCC server
+ # the result is cached to avoid reloading when going back and forth in the
+ # installation workflow
+ # @return [Array<Registration::Addon>] available addons
+ def get_available_addons
+ Yast::Popup.Feedback(
+ _(CONTACTING_MESSAGE),
+ _("Loading Available Extensions and Modules...")) do
+
+ Addon.find_all(registration)
+ end
+ end
+
+ def disable_update_repos(product_service)
+ update_repos = SwMgmt.service_repos(product_service, only_updates: true)
+ log.info "Disabling #{update_repos.size} update repositories:
#{update_repos}"
+ SwMgmt.set_repos_state(update_repos, false)
+ end
+
+ private
+
+ attr_accessor :registration
+
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-3.1.112/src/lib/registration/storage.rb
new/yast2-registration-3.1.114/src/lib/registration/storage.rb
--- old/yast2-registration-3.1.112/src/lib/registration/storage.rb
2014-08-28 17:49:32.000000000 +0200
+++ new/yast2-registration-3.1.114/src/lib/registration/storage.rb
2014-09-01 20:04:20.000000000 +0200
@@ -50,7 +50,7 @@
end
end

- class Cache < Struct.new(:available_addons, :first_run, :addon_services,
+ class Cache < Struct.new(:first_run, :addon_services,
:reg_url, :reg_url_cached)

include Singleton
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-3.1.112/src/lib/registration/url_helpers.rb
new/yast2-registration-3.1.114/src/lib/registration/url_helpers.rb
--- old/yast2-registration-3.1.112/src/lib/registration/url_helpers.rb
2014-08-28 17:49:32.000000000 +0200
+++ new/yast2-registration-3.1.114/src/lib/registration/url_helpers.rb
2014-09-01 20:04:20.000000000 +0200
@@ -191,14 +191,14 @@
end

def self.slp_discovery
- services = []
-
log.info "Searching for #{SLP_SERVICE} SLP services"
- services.concat(Yast::SlpService.all(SLP_SERVICE))
-
+ services = Yast::SlpService.all(SLP_SERVICE)
log.debug "Found services: #{services.inspect}"
- log.info "Found #{services.size} services:
#{services.map(&:slp_url).inspect}"

+ # ignore SUSE manager registration servers (bnc#894470)
+ services.reject!{ |service|
service.slp_url.start_with?("service:#{SLP_SERVICE}:manager:") }
+
+ log.info "Found #{services.size} services:
#{services.map(&:slp_url).inspect}"
services
end

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-3.1.112/test/discover_registration_services_test.rb
new/yast2-registration-3.1.114/test/discover_registration_services_test.rb
--- old/yast2-registration-3.1.112/test/discover_registration_services_test.rb
2014-08-28 17:49:32.000000000 +0200
+++ new/yast2-registration-3.1.114/test/discover_registration_services_test.rb
2014-09-01 20:04:20.000000000 +0200
@@ -38,7 +38,7 @@
slp_attributes = double
allow(slp_attributes).to receive(:to_h).and_return({:description =>
"Description"})
allow(slp_service).to receive(:attributes).and_return(slp_attributes)
- allow(slp_service).to
receive(:slp_url).and_return("service:registration.suse:manager:#{slp_url}")
+ allow(slp_service).to
receive(:slp_url).and_return("service:registration.suse:smt:#{slp_url}")
allow(slpservice).to receive(:all).and_return([slp_service])
end

diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-registration-3.1.112/test/registration_ui_test.rb
new/yast2-registration-3.1.114/test/registration_ui_test.rb
--- old/yast2-registration-3.1.112/test/registration_ui_test.rb 1970-01-01
01:00:00.000000000 +0100
+++ new/yast2-registration-3.1.114/test/registration_ui_test.rb 2014-09-01
20:04:20.000000000 +0200
@@ -0,0 +1,40 @@
+#! /usr/bin/env rspec
+
+require_relative "spec_helper"
+
+require "registration/registration"
+require "registration/registration_ui"
+
+describe "Registration::RegistrationUI" do
+ let(:registration) { Registration::Registration.new }
+ let(:registration_ui) { Registration::RegistrationUI.new(registration) }
+
+ describe "#register_system_and_base_product" do
+ it "registers the system using the provided registration code" do
+ email = "user@xxxxxxxxxxx"
+ reg_code = "reg_code"
+
+ target_distro = "sles-12-x86_64"
+ base_product = { "arch" => "x86_64", "name" => "SLES", "version" => "12",
+ "flavor" => "DVD", "register_target" => target_distro }
+ base_product_to_register = { "name"=>"SLES", "arch"=>"x86_64",
+ "version"=>"12", "release_type"=>"DVD", "reg_code"=>"reg_code" }
+
+ expect(Registration::Registration).to
receive(:is_registered?).and_return(false)
+ expect(Registration::SwMgmt).to
receive(:find_base_product).twice.and_return(base_product)
+ expect(registration).to receive(:register).with(email, reg_code,
target_distro)
+ expect(registration).to
receive(:register_product).with(base_product_to_register, email).and_return([])
+
+ expect(registration_ui.register_system_and_base_product(email,
reg_code)).to be_true
+ end
+ end
+
+ describe "#get_available_addons" do
+ it "returns available addons" do
+ expect(Registration::Addon).to
receive(:find_all).with(registration).and_return([])
+
+ expect(registration_ui.get_available_addons).to eql([])
+ end
+ end
+
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-registration-3.1.112/test/url_helpers_spec.rb
new/yast2-registration-3.1.114/test/url_helpers_spec.rb
--- old/yast2-registration-3.1.112/test/url_helpers_spec.rb 2014-08-28
17:49:32.000000000 +0200
+++ new/yast2-registration-3.1.114/test/url_helpers_spec.rb 2014-09-01
20:04:20.000000000 +0200
@@ -195,4 +195,43 @@
end
end

+ describe ".slp_discovery" do
+ let(:slpservice) { double("Yast::SlpService") }
+
+ before do
+ stub_const("Yast::SlpService", slpservice)
+ end
+
+ it "returns SLP services excluding SUSE Manager services" do
+ service1 = double(:slp_url =>
"service:registration.suse:smt:https://example.com/connect";)
+ service2 = double(:slp_url =>
"service:registration.suse:manager:https://example.com/connect";)
+ expect(slpservice).to receive(:all).and_return([service1, service2])
+
+ result = Registration::UrlHelpers.slp_discovery
+ expect(result).to include(service1)
+ # SUSE manager service (service2) is ignored
+ expect(result).to_not include(service2)
+ end
+ end
+
+ describe ".slp_discovery_feedback" do
+ let(:slpservice) { double("Yast::SlpService") }
+ let(:popup) { double("Yast::Popup") }
+
+ before do
+ stub_const("Yast::SlpService", slpservice)
+ stub_const("Yast::Popup", popup)
+ end
+
+ it "runs SLP discovery with progress message" do
+ services = [ double(:slp_url =>
"service:registration.suse:smt:https://example.com/connect";) ]
+ expect(slpservice).to receive(:all).and_return(services)
+
+ # stub Popup.Feedback call but yield the passed block
+ expect(popup).to receive(:Feedback).and_yield()
+
+ expect(Registration::UrlHelpers.slp_discovery_feedback).to eql(services)
+ end
+ end
+
end

continue with "q"...


Checked in at Tue Sep 2 15:57:59 CEST 2014 by ro

Remember to have fun...

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread