Project

General

Profile

Actions

action #179011

open

coordination #169654: [epic] Create test scenarios for Agama

Add scenario to test Agama post-partitioning scripts

Added by JERiveraMoya about 1 month ago. Updated 4 days ago.

Status:
In Progress
Priority:
High
Assignee:
Target version:
-
Start date:
2025-03-17
Due date:
% Done:

0%

Estimated time:

Description

Motivation

According to documentation:

Post-partitioning scripts
The post-partitioning scripts are executed during the installation, after the storage is set up. A typical use case is to create configuration files that can modify the behavior of the RPM scripts.

In order to test this feature we could do something like, according to Olaf Hering

there are many files in /etc (while that number should be Zero), some are marked as %config . I did not look for all possible candidates, ...
Try mkdir -vp /etc/zypp;echo '#' > /etc/zypp/zypp.conf and look for /etc/zypp/zypp.conf.rpmnew after installation.

Therefore in theory adding this empty commented file with this kind of scripts, after installation we should be able to find that .rpmnew file after installation.
Rationale is that the json profile writes the config that should be there, vs. the one that comes from the rpm package.
Like in the ordinary case one wants to disable recommends and deltarpm and what not. Or write the required sssd.conf/ldap.conf right away. Or write /.buildenv to disable initrd creation and boot loader configuration while no bootloader configuration exists.
In general actions that you want after partitioning but before proceeding to install your system.

See slack conversation:
https://suse.slack.com/archives/C02TLF25571/p1741620530087709

Acceptance criteria

  • AC1: Test manually and report the differences between adding and not adding the script (perhaps is just that the file exists or not and that would be ok).
  • AC2: Add that simple one-line script to ensure continuity/testing coverage of the feature and validate in the installed system.

Additional information

In the same way that we would group some feature for UI in some test suite with name sles_extended, we should do the same for this one and make it part of some sles_extended_unattended test suite.
Docs: https://agama-project.github.io/docs/user/unattended/scripts#post-installation-scripts

Actions #1

Updated by JERiveraMoya 25 days ago

  • Tags changed from qe-yam-mar-sprint-fy25 to qe-yam-apr-sprint-fy25
Actions #2

Updated by rainerkoenig 13 days ago

  • Status changed from Workable to In Progress
  • Assignee set to rainerkoenig
Actions #3

Updated by rainerkoenig 12 days ago

Status Update

Tried a proof of concept on local VMs. Found out that the ticket description is wrong, because in the moment when the script is executed the target system is mounted under /mnt, so I used this as a script:

    postPartitioning: [
      {
        name: 'create zypp.conf',
        chroot: false,
        content: |||
          #!/usr/bin/env bash
          mkdir -vp /mnt/etc/zypp
          echo '# QE-Yam Test' > /mnt/etc/zypp/zypp.conf
        |||
      }
    ],

So after installation we indeed have a zypp.conf.rpmnew file under /etc/zypp/ with the new config file.

Actions #4

Updated by JERiveraMoya 6 days ago

This is a minor feature so it should be part of one of our test suite where we group several checks, extended_unattended would be a good candidate, so we could cover all the architectures.

Actions #5

Updated by rainerkoenig 4 days ago

PR: https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/21881
Problem is that the VR is failing because the generated_profile.json is empty. Need to look at this.

Actions

Also available in: Atom PDF