diff --git a/src/modules/PackageSlideShow.rb b/src/modules/PackageSlideShow.rb index 883638f66..387b0ea23 100644 --- a/src/modules/PackageSlideShow.rb +++ b/src/modules/PackageSlideShow.rb @@ -16,66 +16,56 @@ def main Yast.import "SlideShow" Yast.import "String" Yast.import "Mode" + Yast.import "Packages" - @inst_src_names = [] # a list of strings identifying each repository - @total_size_installed = 0 - @total_size_to_install = 0 + init_member_vars + end + def init_member_vars @init_pkg_data_complete = false - # package summary - # package counters - @installed_packages = 0 - @updated_packages = 0 - @removed_packages = 0 + @total_installed_size = 0 + @total_size_to_install = 0 # also used in one click installer + @expected_total_download_size = 0 + @finished_total_download_size = 0 - @total_downloaded = 0 - @total_installed = 0 - @total_pkgs_to_install = 0 + @active_downloads = 0 + @detected_parallel_download = false - # package list (only used in installed system) - @installed_packages_list = [] - @updated_packages_list = [] - @removed_packages_list = [] + # Those @current_pkg_... variables keep track of the most recent current + # download. Avoid using them if parallel downloads are in effect. - @updating = false - end - - def ResetPackageSummary - @installed_packages = 0 - @updated_packages = 0 - @removed_packages = 0 - @total_downloaded = 0 - @total_installed = 0 + @current_download_pkg_size = 0 # RPM size, not installed size + @current_download_pkg_percent = 0 + @current_download_pkg_name = "" - @installed_packages_list = [] - @updated_packages_list = [] - @removed_packages_list = [] + @installed_pkg_list = [] + @updated_pkg_list = [] + @removed_pkg_list = [] - # temporary values @updating = false + nil + end + def ResetPackageSummary + init_member_vars nil end def GetPackageSummary { - "installed" => @installed_packages, - "updated" => @updated_packages, - "removed" => @removed_packages, - "installed_list" => @installed_packages_list, - "updated_list" => @updated_packages_list, - "removed_list" => @removed_packages_list, - "downloaded_bytes" => @total_downloaded, - "installed_bytes" => @total_installed + "installed" => @installed_pkg_list.size, + "updated" => @updated_pkg_list.size, + "removed" => @removed_pkg_list.size, + "installed_list" => @installed_pkg_list, + "updated_list" => @updated_pkg_list, + "removed_list" => @removed_pkg_list, + "downloaded_bytes" => @finished_total_download_size, + "installed_bytes" => @total_installed_size } end - # *************************************************************************** - # ************** Formatting functions and helpers ************************** - # *************************************************************************** - - # Sum up all list items. It flattens list and also skip all negative values. + # Sum up all list items. It flattens the list and also skips all negative values. # # @param sizes [Array] Sizes to sum # @return [Fixnum] Sizes sum @@ -83,16 +73,22 @@ def ListSum(sizes) sizes.flatten.select(&:positive?).reduce(0, :+) end + # The total size in bytes to install. + def TotalSizeToInstall + @total_size_to_install + end + + # The current size in bytes that is already installed. def TotalInstalledSize - @total_size_installed + @total_installed_size end # Format number of remaining bytes to be installed as string. # @param [Fixnum] remaining bytes remaining, -1 for 'done' - # @return [String] human readable remaining time or byte / kB/ MB size + # @return [String] human readable remaining time or byte / kB/ MB size # def FormatRemainingSize(remaining) - if Ops.less_than(remaining, 0) + if remaining < 0 # Nothing more to install from this CD (very concise - little space!!) return _("Done.") end @@ -103,10 +99,10 @@ def FormatRemainingSize(remaining) # Format number of remaining packages to be installed as string. # @param [Fixnum] remaining bytes remaining, -1 for 'done' - # @return [String] human readable remaining time or byte / kB/ MB size + # @return [String] human readable remaining time or byte / kB/ MB size # def FormatRemainingCount(remaining) - if Ops.less_than(remaining, 0) + if remaining < 0 # Nothing more to install from this CD (very concise - little space!!) return _("Done.") end @@ -125,62 +121,95 @@ def InitPkgData(force) return if @init_pkg_data_complete && !force ResetPackageSummary() - # Reinititalize some globals (in case this is a second run) - @total_size_installed = 0 - @updated_packages = 0 - @installed_packages = 0 total_sizes_per_cd_per_src = Pkg.PkgMediaSizes total_pkg_count_per_cd_per_src = Pkg.PkgMediaCount @total_size_to_install = ListSum(total_sizes_per_cd_per_src) - log.info "total_size_to_install: #{@total_size_to_install}" @total_pkgs_to_install = ListSum(total_pkg_count_per_cd_per_src) + @expected_total_download_size = Packages.CountSizeToBeDownloaded @init_pkg_data_complete = true - end - # Recalculate remaining times per CD based on package sizes remaining - # and data rate so far. Recalculation is only done each 'recalc_interval' - # seconds unless 'force_recalc' is set to 'true'. - # - # @param [Boolean] _force_recalc force recalculation even if timeout not reached yet - # @return true if recalculated, false if not - # - # @see SlideShow.next_recalc_time - # @see Yast2::SystemTime.uptime - def RecalcRemainingTimes(_force_recalc) - true + log.info "Total size to install: #{@total_size_to_install}" + log.info "Expected total download size: #{@expected_total_download_size}" + log.info "Parallel download (initial): #{parallel_download?}" + nil end - # Switch unit to seconds if necessary and recalc everything accordingly. - # @return true if just switched from sizes to seconds, false otherwise - # - def SwitchToSecondsIfNecessary - false - end + # Check if package are downloaded in parallel to being installed. + def parallel_download? + # Did the callbacks here clearly detect parallel operation? + return true if @detected_parallel_download - # *************************************************************************** - # ***************** Callbacks and progress bars **************************** - # *************************************************************************** + # Use heuristics based on installation modes + # + # 15.4: Not in the installed system, only during system installation + # (and upgrade / autoinstallation (?)). + !Mode.normal + end - # Update progress widgets for the current CD: Label and ProgressBar. - # Use global statistics variables for that. - # @param [Boolean] silent_check don't complain in log file + # Update the overall progress value of the progress bar. + # + # If libzypp is downloading and installing in parallel, keep this simple + # and only use the installed package size for the total vs. the current + # progress, disregarding the download size since the downloads are not + # causing additional delays. + # + # Otherwise, take the download into account so the progress bar doesn't + # appear to be stuck at zero while libzypp downloads a whole lot of + # packages and waits for that to finish before starting installing any of + # them. + # + # In that case, use the download size plus the installed (unpacked) package + # size for the total vs. the current progress. + # + # Caveat 1: Of course the time to download a package cannot really be + # compared to the time it takes to install it after it is downloaded; it + # depends on the network (Internet or LAN) speed. Normally, the download + # takes longer than the installation. But that only means that the progress + # will speed up once the download phase is over. If that surprises the + # user, it will be a pleasant surprise, not an annoyance (which it would be + # if it would slow down). + # + # This progress reporting is not meant to be a prediction of remaining time + # (much less an accurate one); that would only be wild guessing whenever + # network operations are involved. + # + # Caveat 2: Only real downloads are considered, not using packages that are + # directly available from a local repo (installation media or local + # directories) since that causes no noticeable delay, so it's irrelevant + # for progress reporting. # - def UpdateCurrentCdProgress(silent_check); end - - # update the overall progress value (download + installation) def UpdateTotalProgressValue - total_progress = if @total_size_to_install.zero? - 100 # nothing to install. Should not happen + total_size = @total_size_to_install + total_size += @expected_total_download_size unless parallel_download? + + if total_size.zero? # Prevent division by zero + total_progress = 100 # Nothing to install. Should not happen. else - TotalInstalledSize() * 100 / @total_size_to_install + current = TotalInstalledSize() + current += CurrentDownloadSize() unless parallel_download? + log.debug "Current: #{current} of #{total_size}" + total_progress = (100.0 * current / total_size).round end - log.debug "Total package installation progress: #{total_progress}%" + log.info "Total progress: #{total_progress}%" SlideShow.StageProgress(total_progress, nil) end + # Calculate the size of the current downloads from finished downloads and + # the percentage of the current download. + # + # A partial download of the current package is relevant if there are only + # very few packages to download, or if the current one is very large in + # comparison to the total expected download; which is a common scenario in + # the installed system (e.g. kernel updates). + # + def CurrentDownloadSize + current_pkg = @current_download_pkg_size * @current_download_pkg_percent / 100 + @finished_total_download_size + current_pkg + end + # Update progress widgets # def UpdateTotalProgress(_silent_check) @@ -188,150 +217,173 @@ def UpdateTotalProgress(_silent_check) UpdateTotalProgressValue() end - # Progress display update - # This is called via the packager's progress callbacks. - # - # @param [Fixnum] pkg_percent package percentage - # - def UpdateCurrentPackageProgress(pkg_percent); end - - # update the download rate - def UpdateCurrentPackageRateProgress(_pkg_percent, _bps_avg, _bps_current) - nil + # For backwards compatibility: + # Update the total progress text. + def DisplayGlobalProgress + UpdateTotalProgressText() end - def DisplayGlobalProgress - rem_string = FormatRemainingSize(@total_size_to_install - @total_size_installed) + # Update the total progress text (not the value!). + # + def UpdateTotalProgressText + action = + if @active_downloads > 0 && !parallel_download? + _("Downloading...") + else + SlideShow.CurrentStageDescription + end - rem_string += ", " unless rem_string.empty? + installed_pkg = @installed_pkg_list.size + updated_pkg = @updated_pkg_list.size + remaining_string = FormatRemainingSize(@total_size_to_install - @total_installed_size) + remaining_string += ", " unless remaining_string.empty? SlideShow.SetGlobalProgressLabel( - Ops.add( - SlideShow.CurrentStageDescription, - Builtins.sformat( - _(" (Remaining: %1%2 packages)"), - rem_string, - @total_pkgs_to_install - @installed_packages - @updated_packages - ) + action + + Builtins.sformat( + _(" (Remaining: %1%2 packages)"), + remaining_string, + @total_pkgs_to_install - installed_pkg - updated_pkg ) ) nil end - # Callback when file is downloaded ( but not yet installed ) - # @param error[Integer] error code - def DoneProvide(error, _reason, _name) - return if error.nonzero? + # Notification when download of a package starts + def DownloadStart(pkg_name, download_size) + @active_downloads += 1 + log.info "DownloadStart #{pkg_name} size: #{download_size}" + log.info "active downloads: #{@active_downloads}" if @active_downloads > 1 + @current_download_pkg_name = pkg_name + @current_download_pkg_size = download_size + @current_download_pkg_percent = 0 + return if parallel_download? + + # Update the progress text since it may change from "Installing..." to + # "Downloading...". + UpdateTotalProgressText() + UpdateTotalProgressValue() + nil + end + + # Update the download progress for the current package + def DownloadProgress(pkg_percent) + log.info "#{@current_download_pkg_name}: #{pkg_percent}%" + @current_download_pkg_percent = pkg_percent + return if parallel_download? - # move the progress also for downloaded files UpdateTotalProgressValue() nil end - # Update progress widgets for all CDs. - # Uses global statistics variables. - # Redraw whole table, time consuming, but called only when all times recalculated. - # - def UpdateAllCdProgress(_silent_check) + # Notification when download of a package is finished + def DownloadEnd(pkg_name) + log.info "Downloading #{pkg_name} finished" + return if parallel_download? + + CurrentDownloadFinished() + UpdateTotalProgressValue() nil end - # Return a CD's progress bar ID - # @param [Fixnum] src_no number of the repository (from 0 on) - # @param [Fixnum] cd_no number of the CD within that repository (from 0 on) + # Notification about a download error # - def CdProgressId(src_no, cd_no) - Builtins.sformat("Src %1 CD %2", src_no, cd_no) + # @param [Integer] error Numeric error code + # @param [String] reason + # @param [String] pkg_name + def DownloadError(error, reason, pkg_name) + log.error "Download error #{error} for #{pkg_name}: #{reason}" + return if parallel_download? + + CurrentDownloadFinished() + UpdateTotalProgressValue() + nil + end + + # Finalize the sums for the current download + def CurrentDownloadFinished + @active_downloads -= 1 if @active_downloads > 0 + @finished_total_download_size += @current_download_pkg_size + @current_download_pkg_size = 0 + @current_download_pkg_percent = 0 + @current_download_pkg_name = "" end - # package start display update - # - this is called at the end of a new package + # Notification that a package starts being installed, updated or removed. + # Not to be confused with DownloadStart. # - # @param [String] pkg_name package name - # @param [String] pkg_size package size in bytes - # @param [Boolean] deleting Flag: deleting (true) or installing (false) package + # @param [String] pkg_name package name + # @param [String] _pkg_location full path to a package + # @param [String] _pkg_summary package summary (short description) + # @param [Integer] _pkg_size installed package size in bytes + # @param [Boolean] deleting Flag: deleting (true) or installing (false) package? # - def SlideDisplayDone(pkg_name, pkg_size, deleting) - if deleting - @removed_packages += 1 - - @removed_packages_list << pkg_name if Mode.normal - else - @total_size_installed += pkg_size - - UpdateTotalProgress(false) - - # Update global progress bar - DisplayGlobalProgress() - - if @updating - @updated_packages = Ops.add(@updated_packages, 1) - - if Mode.normal - @updated_packages_list = Builtins.add( - @updated_packages_list, - pkg_name - ) - end - else - @installed_packages = Ops.add(@installed_packages, 1) + def PkgInstallStart(pkg_name, _pkg_location, _pkg_summary, _pkg_size, deleting) + if @active_downloads > 0 && !@detected_parallel_download + @detected_parallel_download = true + log.info "Detected parallel download and installation" + end - if Mode.normal - @installed_packages_list = Builtins.add( - @installed_packages_list, - pkg_name - ) - end - end + @updating = Pkg.PkgInstalled(pkg_name) unless deleting + UpdateTotalProgressText() - @total_installed = Ops.add(@total_installed, pkg_size) - end + # Don't update the progress value since it cannot have changed right now: + # Only fully installed packages are taken into account, and this one has + # just begun. nil end - # package start display update - # - this is called at the beginning of a new package + # Progress notification while a package is finished being installed, updated or removed. # - # @param [String] pkg_name package name - # @param [String] _pkg_location full path to a package - # @param [String] _pkg_summary package summary (short description) - # @param [Integer] _pkg_size package size in bytes - # @param [Boolean] deleting Flag: deleting (true) or installing (false) package? + # @param [Integer] _pkg_percent percent of progress of this package # - def SlideDisplayStart(pkg_name, _pkg_location, _pkg_summary, _pkg_size, deleting) - @updating = Pkg.PkgInstalled(pkg_name) if !deleting - # Update global progress bar - DisplayGlobalProgress() - + def PkgInstallProgress(_pkg_percent) + # Not doing anything here since we only take the fully installed packages + # into account for progress reporting. nil end - def SlideGenericProvideStart(pkg_name, size, pattern, remote); end - - def SlideDeltaApplyStart(_pkg_name) - nil - end + # Notification that a package is finished being installed, updated or removed. + # + # @param [String] pkg_name package name + # @param [String] pkg_size package size in bytes + # @param [Boolean] deleting Flag: deleting (true) or installing (false) package + # + def PkgInstallDone(pkg_name, pkg_size, deleting) + if deleting + @removed_pkg_list << pkg_name if Mode.normal + else # installing or updating + @total_installed_size += pkg_size + + UpdateTotalProgressValue() + UpdateTotalProgressText() + + if Mode.normal + if @updating + @updated_pkg_list << pkg_name + else + @installed_pkg_list << pkg_name + end + end + end - # Package providal start - def SlideProvideStart(_pkg_name, _size, _remote) nil end - publish variable: :total_size_to_install, type: "integer" # Used in installation client + publish variable: :total_size_to_install, type: "integer" # Used in one click installer client + publish function: :TotalSizeToInstall, type: "integer ()" # Better substitute for the above publish function: :GetPackageSummary, type: "map ()" publish function: :InitPkgData, type: "void (boolean)" - publish function: :UpdateCurrentPackageProgress, type: "void (integer)" - publish function: :UpdateCurrentPackageRateProgress, type: "void (integer, integer, integer)" publish function: :DisplayGlobalProgress, type: "void ()" - publish function: :DoneProvide, type: "void (integer, string, string)" - publish function: :UpdateAllCdProgress, type: "void (boolean)" - publish function: :SlideDisplayDone, type: "void (string, integer, boolean)" - publish function: :SlideDisplayStart, type: "void (string, string, string, integer, boolean)" - publish function: :SlideGenericProvideStart, type: "void (string, integer, string, boolean)" - publish function: :SlideDeltaApplyStart, type: "void (string)" - publish function: :SlideProvideStart, type: "void (string, integer, boolean)" + publish function: :DownloadStart, type: "void (string, integer)" + publish function: :DownloadProgress, type: "void (integer)" + publish function: :DownloadEnd, type: "void (string)" + publish function: :DownloadError, type: "void (integer, string, string)" + publish function: :PkgInstallStart, type: "void (string, integer, string, boolean)" + publish function: :PkgInstallProgress, type: "void (integer)" + publish function: :PkgInstallDone, type: "void (string, integer, boolean)" end PackageSlideShow = PackageSlideShowClass.new diff --git a/src/modules/SlideShowCallbacks.rb b/src/modules/SlideShowCallbacks.rb index 64d28167e..b7d35f03b 100644 --- a/src/modules/SlideShowCallbacks.rb +++ b/src/modules/SlideShowCallbacks.rb @@ -25,7 +25,7 @@ def main Yast.import "Directory" Yast.import "URL" - @_remote_provide = false + @remote_provide = false @pkg_inprogress = "" @@ -69,40 +69,55 @@ def HandleInput nil end - # at start of file providal + # Start of file providal. + # + # This can be a download (if the package is provided by a remote + # repository) or simply accessing a local repo, e.g. on the currently + # mounted installation media. + # def StartProvide(name, archivesize, remote) @pkg_inprogress = name - @_remote_provide = remote - - PackageSlideShow.SlideProvideStart(name, archivesize, remote) + @remote_provide = remote + PackageSlideShow.DownloadStart(name, archivesize) if @remote_provide nil end - # during file providal + # Update progress during file providal. + # + # This is meant to update a progress bar for the download percent. + # def ProgressProvide(percent) - PackageSlideShow.UpdateCurrentPackageProgress(percent) if @_remote_provide + PackageSlideShow.DownloadProgress(percent) if @remote_provide HandleInput() !SlideShow.GetUserAbort end - def ProgressDownload(percent, bps_avg, bps_current) - PackageSlideShow.UpdateCurrentPackageRateProgress( - percent, - bps_avg, - bps_current - ) - + # Update during package download: Percent, average and current bytes per second. + # + # Notice that there is also ProgressProvide for only the percentage value; + # this callback is meant to update a display of the current data rate and + # possibly predictions about the remaining time based on the data rate. + # + def ProgressDownload(_percent, _bps_avg, _bps_current) HandleInput() !SlideShow.GetUserAbort end - # during file providal + # End of file providal; used both for success (error == 0) and error (error + # != 0). + # + # If this was a download from a remote repo, this means that the download + # is now finished. + # def DoneProvide(error, reason, name) - if @_remote_provide - PackageSlideShow.UpdateCurrentPackageProgress(100) - PackageSlideShow.DoneProvide(error, reason, name) - @_remote_provide = false + if @remote_provide + if error.zero? + PackageSlideShow.DownloadEnd(name) + else + PackageSlideShow.DownloadError(error, reason, name) + end + @remote_provide = false end return "C" if SlideShow.GetUserAbort return PackageCallbacks.DoneProvide(error, reason, name) if error.nonzero? @@ -110,6 +125,8 @@ def DoneProvide(error, reason, name) "" end + # A pre- or post-install/uninstall script is started. + # def ScriptStart(patch_name, patch_version, patch_arch, script_path) patch_full_name = PackageCallbacks.FormatPatchName( patch_name, @@ -136,6 +153,12 @@ def ScriptStart(patch_name, patch_version, patch_arch, script_path) nil end + # Progress during a pre- or post-install/uninstall script. + # + # Since there is no way to find out how far the execution of this script + # has progressed, this is only a "ping" notification, not reporting + # percents. + # def ScriptProgress(ping, output) Builtins.y2milestone("ScriptProgress: ping:%1, output: %2", ping, output) @@ -159,11 +182,15 @@ def ScriptProgress(ping, output) ![:abort, :close].include?(input) end + # Error reporting during execution of a pre- or post-install/uninstall script. + # def ScriptProblem(description) # display Abort/Retry/Ignore popup PackageCallbacks.ScriptProblem(description) end + # A pre- or post-install/uninstall script has finished. + # def ScriptFinish Builtins.y2milestone("ScriptFinish") @@ -260,7 +287,7 @@ def YesNoAgainWarning(message) # and pass the "deleting" flag as appropriate. # def DisplayStartInstall(pkg_name, pkg_location, pkg_description, pkg_size, deleting) - PackageSlideShow.SlideDisplayStart( + PackageSlideShow.PkgInstallStart( pkg_name, pkg_location, pkg_description, @@ -383,7 +410,7 @@ def DisplayStartInstall(pkg_name, pkg_location, pkg_description, pkg_size, delet nil end - # at start of package install + # Notification that a package starts being installed, updated or removed. def StartPackage(name, location, summary, install_size, is_delete) PackageCallbacks._package_name = name PackageCallbacks._package_size = install_size @@ -394,9 +421,9 @@ def StartPackage(name, location, summary, install_size, is_delete) nil end - # ProgressPackage percent - # + # Progress while a package is being installed, updated or removed. def ProgressPackage(pkg_percent) + PackageSlideShow.PkgInstallProgress(pkg_percent) HandleInput() Builtins.y2milestone("Aborted at %1%%", pkg_percent) if SlideShow.GetUserAbort @@ -404,7 +431,8 @@ def ProgressPackage(pkg_percent) !SlideShow.GetUserAbort end - # at end of install + # Notification that a package is finished being installed, updated or removed. + # # just to override the PackageCallbacks default (which does a 'CloseDialog' :-}) def DonePackage(error, reason) return "I" if SlideShow.GetUserAbort @@ -420,7 +448,7 @@ def DonePackage(error, reason) if Builtins.size(ret).zero? || Builtins.tolower(Builtins.substring(ret, 0, 1)) != "r" - PackageSlideShow.SlideDisplayDone( + PackageSlideShow.PkgInstallDone( PackageCallbacks._package_name, PackageCallbacks._package_size, PackageCallbacks._deleting_package @@ -430,21 +458,12 @@ def DonePackage(error, reason) end # at start of file providal - def StartDeltaProvide(name, archivesize) - PackageSlideShow.SlideGenericProvideStart( - name, # remote - archivesize, - _("Downloading delta RPM %1 (download size %2)"), - true - ) - + def StartDeltaProvide(_name, _archivesize) nil end # at start of file providal - def StartDeltaApply(name) - PackageSlideShow.SlideDeltaApplyStart(name) - + def StartDeltaApply(_name) nil end diff --git a/test/package_slide_show_test.rb b/test/package_slide_show_test.rb index 1495f11a7..c6548a6e6 100755 --- a/test/package_slide_show_test.rb +++ b/test/package_slide_show_test.rb @@ -17,11 +17,11 @@ end end - describe ".SlideDisplayDone" do + describe ".PkgInstallDone" do context "when deleting package" do it "increases removed counter in summary" do package_slide_show.main # to reset counter - expect { package_slide_show.SlideDisplayDone("test", 1, true) }.to( + expect { package_slide_show.PkgInstallDone("test", 1, true) }.to( change { package_slide_show.GetPackageSummary["removed"] }.from(0).to(1) ) end @@ -29,7 +29,7 @@ it "adds name to removed_list in summary in normal mode" do allow(Yast::Mode).to receive(:normal).and_return(true) package_slide_show.main # to reset counter - expect { package_slide_show.SlideDisplayDone("test", 1, true) }.to( + expect { package_slide_show.PkgInstallDone("test", 1, true) }.to( change { package_slide_show.GetPackageSummary["removed_list"] } .from([]) .to(["test"]) @@ -43,7 +43,7 @@ # TODO: updating non trivial amount of table it "increases installed counter in summary" do package_slide_show.main # to reset counter - expect { package_slide_show.SlideDisplayDone("test", 1, false) }.to( + expect { package_slide_show.PkgInstallDone("test", 1, false) }.to( change { package_slide_show.GetPackageSummary["installed"] }.from(0).to(1) ) end @@ -51,7 +51,7 @@ it "adds name to installed_list in summary in normal mode" do allow(Yast::Mode).to receive(:normal).and_return(true) package_slide_show.main # to reset counter - expect { package_slide_show.SlideDisplayDone("test", 1, false) }.to( + expect { package_slide_show.PkgInstallDone("test", 1, false) }.to( change { package_slide_show.GetPackageSummary["installed_list"] } .from([]) .to(["test"]) @@ -60,7 +60,7 @@ it "adds its size to installed_bytes in summary" do package_slide_show.main # to reset counter - expect { package_slide_show.SlideDisplayDone("test", 502, false) }.to( + expect { package_slide_show.PkgInstallDone("test", 502, false) }.to( change { package_slide_show.GetPackageSummary["installed_bytes"] }.from(0).to(502) ) end @@ -68,13 +68,13 @@ it "sets global progress label in slide show" do expect(Yast::SlideShow).to receive(:SetGlobalProgressLabel) - package_slide_show.SlideDisplayDone("test", 502, false) + package_slide_show.PkgInstallDone("test", 502, false) end it "updates stage progress" do expect(Yast::SlideShow).to receive(:StageProgress) - package_slide_show.SlideDisplayDone("test", 502, false) + package_slide_show.PkgInstallDone("test", 502, false) end end end diff --git a/test/slide_show_callabacks_test.rb b/test/slide_show_callbacks_test.rb similarity index 97% rename from test/slide_show_callabacks_test.rb rename to test/slide_show_callbacks_test.rb index c1a9598da..727f8a0f4 100755 --- a/test/slide_show_callabacks_test.rb +++ b/test/slide_show_callbacks_test.rb @@ -15,7 +15,7 @@ let(:deleting) { false } before do - allow(Yast::PackageSlideShow).to receive(:SlideDisplayStart) + allow(Yast::PackageSlideShow).to receive(:PkgInstallStart) allow(subject).to receive(:HandleInput) allow(Yast::Installation).to receive(:destdir).and_return("/") allow(File).to receive(:exist?).and_return(true)