Project

General

Profile

Actions

action #132770

closed

coordination #121864: [epic] Split and enhance test modules in migrations

Improve recently created patch_and_reboot_system.pm

Added by JERiveraMoya 10 months ago. Updated 9 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
Start date:
2023-07-14
Due date:
% Done:

0%

Estimated time:

Description

Motivation

Improve recently created tests/migration/patch_and_reboot_system.pm

Some points:

  • my ($self) = @_; should be the first line to unpack parameters.
  • Extract from sub fully_patch_system the main part which is $ret = zypper_call("$zypp_opt patch --with-interactive -l", exitcode => [0, 4, 102, 103], timeout => 6000); with corresponding loop, comments and error handling in a new module, without including sle 11 sp4 or that invalid bug surrounded that code or not even the logic for hyperv.
  • last select_console seems not make sense, next module should be responsible for that if needed.

Acceptance criteria

AC1: patch_and_reboot_system.pm is easy to read and an user could reproduce easily just reading the module what it does

Additional information

Refactored test suite are currently in this job group with names ending on *_split_patch_sle.

Actions #1

Updated by JERiveraMoya 10 months ago

  • Description updated (diff)
Actions #2

Updated by JERiveraMoya 10 months ago

  • Description updated (diff)
Actions #3

Updated by tinawang123 10 months ago

  • Status changed from Workable to In Progress
  • Assignee set to tinawang123
Actions #4

Updated by tinawang123 10 months ago

One question:
Extract from sub fully_patch_system the main part which is $ret = zypper_call("$zypp_opt patch --with-interactive -l", exitcode => [0, 4, 102, 103], timeout => 6000); with corresponding loop, comments and error handling in a new module

At here, Do we need a new module for this? Or just a new function?

Actions #5

Updated by JERiveraMoya 10 months ago

tinawang123 wrote:

One question:
Extract from sub fully_patch_system the main part which is $ret = zypper_call("$zypp_opt patch --with-interactive -l", exitcode => [0, 4, 102, 103], timeout => 6000); with corresponding loop, comments and error handling in a new module

At here, Do we need a new module for this? Or just a new function?

the problem with libraries is that hide a lot the logic for testing, so it is better to expose in the module, as that module is fresh new, you can modify it and include this extraction there.

Actions #6

Updated by tinawang123 10 months ago

JERiveraMoya wrote:

tinawang123 wrote:

One question:
Extract from sub fully_patch_system the main part which is $ret = zypper_call("$zypp_opt patch --with-interactive -l", exitcode => [0, 4, 102, 103], timeout => 6000); with corresponding loop, comments and error handling in a new module

At here, Do we need a new module for this? Or just a new function?

the problem with libraries is that hide a lot the logic for testing, so it is better to expose in the module, as that module is fresh new, you can modify it and include this extraction there.

You mean 'sub fully_patch_system' use one new module eg: named 'fully_patch_system.pm', then the module 'patch_and_reboot_system.pm' only do reboot job. Is it your requirement?

Actions #7

Updated by JERiveraMoya 10 months ago

  • Description updated (diff)
Actions #9

Updated by tinawang123 9 months ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF