Project

General

Profile

Actions

action #117028

closed

[qe-core] Possible improvements for transactional installations

Added by pcervinka about 2 years ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Refactor/Code Improvements
Start date:
2022-09-22
Due date:
% Done:

100%

Estimated time:
Difficulty:
Sprint:
QE-Core: April Sprint 24 (Apr 10 - May 08)

Description

I have found few places for improvements during test development for alp.
We should discuss following points and if they are valid, try to fix/improve them.

1. Universal function for package installation

I noticed that existing code base, becoming messy with if-else for zypper and transactional-update installations.

One of the examples:

    if (is_transactional) {
        trup_call("pkg install qemu-linux-user");
        check_reboot_changes;
    } else {
        zypper_call("in qemu-linux-user");
    }

This can grow up in numbers with more tests adapted to alp/slem.

Maybe could we use similar approach like for liberty?
https://gitlab.suse.de/suse-liberty-linux/openqa-tests-sll/-/tree/master/lib/Utils/PackageManager

Example in test code:

$testapi::distri->get_package_manager()->install_package("ltp")

As you can see, test code just contained universal installation command, which was distro independent.

2. Existing trup_call function needs root-console

It means that code with $self->select_serial_terminal doesn't work, console change needs to be done.

You can find this pattern in the code:

select_console 'root-console';
trup_call("--continue pkg $cmd", timeout => 2000);

Is there a way to fix that? trup_call should be console independent.

3. Support for transactional command in script_run

We can run commands on the transaction system in the snapshot via transactional-update -c -d --quiet run.
For example, we install something, want to just check something , but we can't use normal script_run, because it will run on booted snapshot.

Would be worth to have something like script_run("COMMAND", transactional => [is_transactional| any other condition | 1]) which would wrap command in case we want transactional approach?


Related issues 3 (1 open2 closed)

Related to openQA Tests (public) - action #115196: [qe-core] Prepare for ALP - Schedule Databases testsuite for ALPRejecteddvenkatachala2023-05-252023-05-25

Actions
Related to openQA Tests (public) - action #153865: [qe-core] install_package with trup_reboot will fail if package is installedRejected2024-01-18

Actions
Related to openQA Tests (public) - action #164024: [qe-core] test fails in perl_bootloader - process_reboot and wait_boot seem to be doing the same thing Workable2024-07-16

Actions
Actions

Also available in: Atom PDF