agama/service/test
Imobach González Sosa 777852293d
feat: embed questions configuration in the profile (#2612)
## Problem

* Bug [bsc#1246997](https://bugzilla.suse.com/show_bug.cgi?id=1246997)

To answer questions in advance when using the unattended mode, it is
required to use a pre-script. If you just want Agama to use the default
values, it is kind of straight-forward:

```jsonnet
  scripts: {
    pre: [
      {
        name: 'disable-questions',
	content: |||
          #!/usr/bin/bash
          agama questions mode non-interactive
	|||
      }
    ]
  }
```

However, if you want to answer an specific question (e.g., providing a
password for an existing encrypted file system) it is kind of tricky.
You might need to create a file like this:

```json
  {
    "answers": [
      {
        "password": "my-password",
        "class": "storage.luks_activation"
      },
    ]
  }
```

And the load it using a pre-script:

```jsonnet
  scripts: {
    pre: [
      {
        name: 'disable-questions',
	content: |||
          #!/usr/bin/bash
          agama download http://my-server.lan/answers.json answers.json
          agama questions answers answers.json
	|||
      }
    ]
  }
```

## Solution

Allow embedding the answers in the profile.

```json
  "questions": {
    "policy": "auto",
    "answers": [
      { "class": "storage.luks_activation", "password": "nots3cr3t" }
    ]
```

* `policy`: ask the user (`user`) or choose the default option (`auto`).
* `answers`: list of answers to the given question.

## Testing

- *Added a new unit test*
- *Tested manually*
2025-07-31 15:10:17 +01:00
..
agama feat: embed questions configuration in the profile (#2612) 2025-07-31 15:10:17 +01:00
fixtures Use the DUD repository for installing packages (#2543) 2025-07-14 13:51:52 +02:00
integration agama config generate: handle AutoYaST profiles specified as paths 2025-06-09 11:43:07 +02:00
y2storage service: Test for using existing RAIDs as boot device 2025-05-23 09:18:52 +02:00
test_helper.rb replace allow_any_instance 2023-10-30 22:29:26 +01:00