action #175096
closedcoordination #169654: [epic] Create test scenarios for Agama
Create test suite for AutoYaST compatibility focus on supported sections
0%
Description
Motivation¶
Read about the section of the profile called "legacyAutoyastStorage":
https://agama-project.github.io/docs/user/unattended/storage#unattended-installation-using-the-legacy-autoyast-mode
Acceptance criteria¶
- AC1: Implement a test suite multi-architecture where we will one by one an existing basic (to start) storage layout based in some validated AutoYaST profile that we use in SLE 15 SP7.
Additional information¶
Test suite name should be something like *_autoyast_compatibility
.
Feature related unsupported sections: https://jira.suse.com/browse/AGM-50
Files
Updated by JERiveraMoya 3 months ago
Related with https://jira.suse.com/browse/AGM-50
Updated by JERiveraMoya 3 months ago
this is interesting for your ticket: https://suse.slack.com/archives/C02TLF25571/p1736979782748399
Updated by lmanfredi 3 months ago · Edited
E.g of basic storage autoyast_ext4 with AutoYaST ext4.xml
<partitioning config:type="list">
<drive>
<device>/dev/vda</device>
<disklabel>msdos</disklabel>
<enable_snapshots config:type="boolean">true</enable_snapshots>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">swap</filesystem>
<format config:type="boolean">true</format>
<loop_fs config:type="boolean">false</loop_fs>
<mount>swap</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">130</partition_id>
<partition_nr config:type="integer">1</partition_nr>
<resize config:type="boolean">false</resize>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">ext4</filesystem>
<format config:type="boolean">true</format>
<fstopt>acl,user_xattr</fstopt>
<loop_fs config:type="boolean">false</loop_fs>
<mount>/</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">2</partition_nr>
<resize config:type="boolean">false</resize>
</partition>
</partitions>
<pesize/>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
</drive>
</partitioning>
Updated by lmanfredi 3 months ago
Proof of Concept using AUTOYAST="yam/autoyast/mini.xml"
as AGAMA_PROFILE
by cloning the test case sles_lvm
Used:
EXTRABOOTPARAMS="live.password=nots3cr3t console=ttyS0 console=tty kernel.softlockup_panic=1"
AUTOYAST="yam/autoyast/mini.xml"
AGAMA_PROFILE="${AUTOYAST}"
and added in schedule autoyast/prepare_profile
as first step
Updated by JERiveraMoya 3 months ago
you cannot use the lvm scenario which import configuration using new agama profile, you need to use a scenario that only use AutoYaST, no agama profiles in any way.
Updated by lmanfredi 3 months ago
As a first test in a local VM using agama-installer.x86_64-11.0.0-SLE-Build3.5.iso
I have seen that the import of autoyast-mini.xml works fine:
vm-agama-installer:~ # agama config show
{
"bootloader": {
"stopOnBootMenu": false
},
"user": {
"fullName": "",
"userName": "",
"password": "",
"hashedPassword": false,
"autologin": false
},
"root": {},
"software": {
"patterns": []
},
"product": {
"id": ""
},
"network": {
"connections": [
{
"id": "Wired connection 1",
"method4": "auto",
"method6": "auto",
"ignoreAutoDns": false,
"interface": "enp1s0",
"status": "up",
"autoconnect": true
}
]
},
"localization": {
"language": "en_US.UTF-8",
"keyboard": "us",
"timezone": "Europe/Berlin"
},
"scripts": {}
}
vm-agama-installer:~ # agama profile import https://openqa.suse.de/tests/16480282/file/autoyast-mini.xml
✓ The profile is valid.
[1/2] Analyze disks
[2/2] Configure software
vm-agama-installer:~ # agama config show
{
"bootloader": {
"stopOnBootMenu": false
},
"user": {
"fullName": "Bernhard M. Wiedemann",
"userName": "bernhard",
"password": "nots3cr3t",
"hashedPassword": false,
"autologin": false
},
"root": {},
"software": {
"patterns": [
"base"
]
},
"product": {
"id": "SLES",
"registrationCode": "........"
},
"storage": {
"guided": {
"target": {
"disk": "/dev/vda"
},
"boot": {
"configure": true
},
"space": {
"policy": "delete"
},
"volumes": [
{
"mount": {
"path": "/",
"options": [
]
},
"size": "auto",
"target": "default",
"filesystem": {
"btrfs": {
"snapshots": true
}
}
},
{
"mount": {
"path": "swap",
"options": [
]
},
"size": {
"min": 1073741824,
"max": 2147483648
},
"target": "default",
"filesystem": "swap"
}
]
}
},
"network": {
"connections": [
{
"id": "Wired connection 1",
"method4": "auto",
"method6": "auto",
"ignoreAutoDns": false,
"interface": "enp1s0",
"status": "up",
"autoconnect": true
}
]
},
"localization": {
"language": "en_US.UTF-8",
"keyboard": "us",
"timezone": "Europe/Berlin"
},
"scripts": {}
}
vm-agama-installer:~ #
Updated by lmanfredi 3 months ago
On the other hand, with autoyast-ext4.xml does not work:
vm-agama-installer:~ # agama config show
{
"bootloader": {
"stopOnBootMenu": false
},
"user": {
"fullName": "",
"userName": "",
"password": "",
"hashedPassword": false,
"autologin": false
},
"root": {},
"software": {
"patterns": []
},
"product": {
"id": ""
},
"network": {
"connections": [
{
"id": "Wired connection 1",
"method4": "auto",
"method6": "auto",
"ignoreAutoDns": false,
"interface": "enp1s0",
"status": "up",
"autoconnect": true
}
]
},
"localization": {
"language": "en_US.UTF-8",
"keyboard": "us",
"timezone": "Europe/Berlin"
},
"scripts": {}
}
vm-agama-installer:~ # agama profile import https://openqa.suse.de/tests/16509367/file/autoyast-ext4.xml
/usr/lib64/ruby/gems/3.2.0/gems/ruby-augeas-0.5.0/lib/augeas.rb:48: warning: undefining the allocator of T_DATA class Augeas
✗ The profile is not valid. Please, check the following errors:
* Additional properties are not allowed ('l10n' was unexpected). ValidationError { instance: Object {"l10n": Object {"keyboard": String("english-us"), "languages": Array [String("en_US.UTF-8")], "timezone": String("Europe/Berlin")}, "legacyAutoyastStorage": Array [Object {"device": String("/dev/vda"), "disklabel": String("msdos"), "enable_snapshots": Bool(true), "initialize": Bool(true), "partitions": Array [Object {"create": Bool(true), "crypt_fs": Bool(false), "filesystem": String("swap"), "format": Bool(true), "loop_fs": Bool(false), "mount": String("swap"), "mountby": String("uuid"), "partition_id": Number(130), "partition_nr": Number(1), "resize": Bool(false)}, Object {"create": Bool(true), "crypt_fs": Bool(false), "filesystem": String("ext4"), "format": Bool(true), "fstopt": String("acl,user_xattr"), "loop_fs": Bool(false), "mount": String("/"), "mountby": String("uuid"), "partition_id": Number(131), "partition_nr": Number(2), "resize": Bool(false)}], "pesize": String(""), "type": String("CT_DISK"), "use": String("all")}], "product": Object {"id": String("SLES"), "registrationCode": String("....")}, "root": Object {"password": String("nots3cr3t")}, "software": Object {"patterns": Array [String("apparmor"), String("base"), String("basesystem"), String("documentation"), String("enhanced_base"), String("gnome_basic"), String("gnome_basis"), String("minimal_base"), String("x11"), String("x11_enhanced")]}, "user": Object {"fullName": String("Bernhard M. Wiedemann"), "password": String("nots3cr3t"), "userName": String("bernhard")}}, kind: AdditionalProperties { unexpected: ["l10n"] }, instance_path: JSONPointer([]), schema_path: JSONPointer([Keyword("additionalProperties")]) }
[1/2] Analyze disks
[2/2] Configure software
Anyhow(Backend call failed with status 400 and text '{"error":"Agama service error: Failed to find these patterns: [\"gnome_basis\", \"x11\", \"apparmor\", \"gnome_basic\", \"enhanced_base\", \"documentation\", \"x11_enhanced\", \"basesystem\"]"}')
vm-agama-installer:~ #
Updated by lmanfredi 3 months ago
Using autoyast-mini.xml
reported issue :
-
stopOnBootMenu
: expectedtrue
, gotfalse
# agama config show
:
...
"bootloader": {
"stopOnBootMenu": false
},
...
Adding email
:
<suse_register>
<do_registration config:type="boolean">true</do_registration>
<email>info@suse.com</email>
...
works fine :
# agama config show
:
...
"product": {
"id": "SLES",
"registrationCode": "....",
"registrationEmail": "info@suse.com"
},
...
Adding minimal fs:
(copied from autoyast_home_encrypted)
...
<partitioning config:type="list">
<drive>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
<enable_snapshots config:type="boolean">true</enable_snapshots>
<partitions config:type="list">
<partition>
<mount>swap</mount>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">swap</filesystem>
<size>auto</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<format config:type="boolean">true</format>
<filesystem config:type="symbol">btrfs</filesystem>
<mount>/</mount>
<size>75%</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">xfs</filesystem>
<format config:type="boolean">true</format>
<mount>/home</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">3</partition_nr>
<resize config:type="boolean">false</resize>
<crypt_fs config:type="boolean">true</crypt_fs>
<crypt_key>nots3cr3t</crypt_key>
<size>20%</size>
</partition>
</partitions>
</drive>
</partitioning>
...
works fine:
# agama config show
:
...
"legacyAutoyastStorage": [
{
"enable_snapshots": true,
"partitions": [
{
"create": true,
"filesystem": "swap",
"mount": "swap",
"size": "auto"
},
{
"create": true,
"filesystem": "btrfs",
"format": true,
"mount": "/",
"size": "75%"
},
{
"create": true,
"crypt_fs": true,
"crypt_key": "nots3cr3t",
"filesystem": "xfs",
"format": true,
"mount": "/home",
"mountby": "uuid",
"partition_id": 131,
"partition_nr": 3,
"resize": false,
"size": "20%"
}
],
"type": "CT_DISK",
"use": "all"
}
],
...
Tested using this AutoYaST:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<!-- minimal autoyast profile -->
<suse_register>
<do_registration config:type="boolean">true</do_registration>
<email>info@suse.com</email>
<reg_code>...............</reg_code>
<install_updates config:type="boolean">true</install_updates>
<reg_server>.............</reg_server>
<addons config:type="list">
<addon>
<name>sle-module-basesystem</name>
<version>15.7</version>
<arch>x86_64</arch>
</addon>
</addons>
</suse_register>
<bootloader>
<global>
<timeout config:type="integer">-1</timeout>
</global>
</bootloader>
<networking>
<keep_install_network config:type="boolean">true</keep_install_network>
</networking>
<partitioning config:type="list">
<drive>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
<enable_snapshots config:type="boolean">true</enable_snapshots>
<partitions config:type="list">
<partition>
<mount>swap</mount>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">swap</filesystem>
<size>auto</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<format config:type="boolean">true</format>
<filesystem config:type="symbol">btrfs</filesystem>
<mount>/</mount>
<size>75%</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">xfs</filesystem>
<format config:type="boolean">true</format>
<mount>/home</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">3</partition_nr>
<resize config:type="boolean">false</resize>
<crypt_fs config:type="boolean">true</crypt_fs>
<crypt_key>nots3cr3t</crypt_key>
<size>20%</size>
</partition>
</partitions>
</drive>
</partitioning>
<software>
<products config:type="list">
<product>SLES</product>
</products>
</software>
<users config:type="list">
<user>
<fullname>Bernhard M. Wiedemann</fullname>
<encrypted config:type="boolean">false</encrypted>
<user_password>nots3cr3t</user_password>
<username>bernhard</username>
</user>
<user>
<encrypted config:type="boolean">true</encrypted>
<user_password>$6$vYbbuJ9WMriFxGHY$gQ7shLw9ZBsRcPgo6/8KmfDvQ/lCqxW8/WnMoLCoWGdHO6Touush1nhegYfdBbXRpsQuy/FTZZeg7gQL50IbA/</user_password>
<username>root</username>
</user>
</users>
<report>
<errors>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</errors>
<messages>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</messages>
<warnings>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</warnings>
<yesno_messages>
<log config:type="boolean">true</log>
<show config:type="boolean">true</show>
<timeout config:type="integer">0</timeout>
</yesno_messages>
</report>
</profile>
in local VM with command agama profile import file:///root/autoyast.xml
Updated by lmanfredi 3 months ago
- File agama-storage.png agama-storage.png added
anyway, at the moment the web UI shows this message when click on "Storage":
The system layout was set up using a advanced configuration that cannot be modified with the current version of this visual interface. This limitation will be removed in a future version of Agama.
Updated by JERiveraMoya 3 months ago
Related bug: https://bugzilla.suse.com/show_bug.cgi?id=1236347
Instead of documenting here so extensively, I would recommend to go directly with the approach to file bugs like in the example above.
Updated by lmanfredi 3 months ago
Proof of Concept using AUTOYAST="yam/autoyast/mini.xml"
as AGAMA_AUTO
by cloning the test case sles_default_unattended
Used:
EXTRABOOTPARAMS="live.password=nots3cr3t console=ttyS0 console=tty kernel.softlockup_panic=1"
AUTOYAST="yam/autoyast/mini.xml"
AGAMA_AUTO="${AUTOYAST}"
and added in schedule autoyast/prepare_profile
as first step
Updated by JERiveraMoya 3 months ago
- Tags changed from qe-yam-jan-sprint-fy25 to qe-yam-feb-sprint-fy25
Updated by lmanfredi 3 months ago
Proof of Concept using AGAMA_AUTO="yam/autoyast/mini.xml"
by cloning the test case sles_default_unattended
Used:
AGAMA_AUTO="yam/autoyast/mini.xml"
EXCLUDE_MODULES="validate_product"
PASSWORD="nots3cr3t"
after reboot the login as root is disabled by default , so I excluded the test module validate_product
because use root-console
In git branch used for this VR, I added the missing vars used inside xml profile:
sub expand_agama_variables {
my ($profile) = @_;
- my @vars = qw(SCC_REGCODE SCC_REGCODE_SLES4SAP AGAMA_PRODUCT_ID);
+ my @vars = qw(AGAMA_PRODUCT_ID ARCH PASSWORD SCC_REGCODE SCC_REGCODE_SLES4SAP SCC_URL VERSION);
for my $var (@vars) {
Updated by lmanfredi 3 months ago · Edited
By adding a <scripts>
section for allow root login, works fine:
<scripts>
<chroot-scripts config:type="list">
<script>
<file_name>post.sh</file_name>
<interpreter>shell</interpreter>
<chrooted config:type="boolean">true</chrooted>
<source><![CDATA[
#!/usr/bin/env bash
echo 'PermitRootLogin yes' > /etc/ssh/sshd_config.d/root.conf
]]></source>
</script>
</chroot-scripts>
</scripts>
agama config show
:
"scripts": {
"post": [
{
"name": "post.sh",
"body": "\n#!/usr/bin/env bash\necho 'PermitRootLogin yes' > /etc/ssh/sshd_config.d/root.conf\n",
"chroot": true
}
]
}
Updated by lmanfredi 3 months ago
Same result for <partitioning>
:
<partitioning config:type="list">
<drive>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
<enable_snapshots config:type="boolean">true</enable_snapshots>
<partitions config:type="list">
<partition>
<mount>swap</mount>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">swap</filesystem>
<size>auto</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<format config:type="boolean">true</format>
<filesystem config:type="symbol">btrfs</filesystem>
<mount>/</mount>
<size>75%</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<format config:type="boolean">true</format>
<filesystem config:type="symbol">xfs</filesystem>
<mount>/home</mount>
<size>20%</size>
</partition>
</partitions>
</drive>
</partitioning>
agama config show
:
"legacyAutoyastStorage": [
{
"type": "CT_DISK",
"use": "all",
"enable_snapshots": true,
"partitions": [
{
"mount": "swap",
"create": true,
"filesystem": "swap",
"size": "auto"
},
{
"create": true,
"format": true,
"filesystem": "btrfs",
"mount": "/",
"size": "75%"
},
{
"create": true,
"format": true,
"filesystem": "xfs",
"mount": "/home",
"size": "20%"
}
]
}
],
Updated by lmanfredi 3 months ago
Created ISOS POST tests in dev group 529 (Leo)
Updated by JERiveraMoya 3 months ago
- Subject changed from Create test suite for AutoYaST compatibility to Create test suite for AutoYaST compatibility focus on partitioning
Updated by JERiveraMoya 3 months ago · Edited
Seems that there is going to be a different way to work with this, or at least with the negative case.
https://github.com/agama-project/agama/pull/1976
what we are trying here is the positive case, so well, in principle should be fine too.
Anyway all the testing and understanding of both technologies is very needed in this ticket.
Updated by lmanfredi 3 months ago
Added the SCHEDULE
with test module console/verify_separate_home
in x86_64 VRs. It works fine.
SCHEDULE: yam/agama/boot_agama,yam/agama/agama_auto,installation/grub_test,installation/first_boot,yam/validate/validate_first_user,console/verify_separate_home
TODO: consider adding a new yaml schedule to fit this test case
Updated by JERiveraMoya 2 months ago
- Subject changed from Create test suite for AutoYaST compatibility focus on partitioning to Create test suite for AutoYaST compatibility focus on supported sections
Updated by lmanfredi 2 months ago
But Country settings doesn't work:
- keyboard
<keyboard>
<keymap>it</keymap>
</keyboard>
I got:
vm-agama-installer:~ # agama profile import file:///root/autoyast.xml
✗ The profile is not valid. Please, check the following errors:
* Additional properties are not allowed ('l10n' was unexpected). ValidationError { instance: Object {"l10n": Object {"keyboard": String("it")}, "legacyAutoyastStorage": Array ...
- language
<language>
<language>it_IT</language>
<languages>en_GB</languages>
</language>
I got:
vm-agama-installer:~ # agama profile import file:///root/autoyast.xml
✗ The profile is not valid. Please, check the following errors:
* Additional properties are not allowed ('l10n' was unexpected). ValidationError { instance: Object {"l10n": Object {"languages": Array [String("it_IT.UTF-8"), String("en_GB.UTF-8")]}, "legacyAutoyastStorage": Array ...
- timezone
<timezone>
<hwclock>UTC</hwclock>
<timezone>Europe/Rome</timezone>
</timezone>
I got:
vm-agama-installer:~ # agama profile import file:///root/autoyast.xml
✗ The profile is not valid. Please, check the following errors:
* Additional properties are not allowed ('l10n' was unexpected). ValidationError { instance: Object {"l10n": Object {"timezone": String("Europe/Rome")}, "legacyAutoyastStorage": Array ...
Updated by JERiveraMoya 2 months ago
They will be fixed, so please include them in the PR too.
Updated by lmanfredi about 2 months ago
Updated PR#21166 with encrypted PASSWORD in autoyast xml
and using the existing sub expand_variables
to expand vars
Updated by lmanfredi about 2 months ago
Created PR#21311 to add yaml schedule files
Updated by JERiveraMoya about 2 months ago
- Tags changed from qe-yam-feb-sprint-fy25 to qe-yam-mar-sprint-fy25
Updated by JERiveraMoya about 2 months ago
Please, setup the test suite in production (with corresponding description) and development, don't wast much time on trying to make it work as prod is broken and devel I'm not sure in which state is. After that we can resolve this ticket.
Updated by lmanfredi about 2 months ago
Created new PR#21334 to Remove Unsupported Sections in ay based on AutoYaST compatibility reference
Updated by lmanfredi about 2 months ago
Verified in production with Build 57.3: passed
Updated by JERiveraMoya about 2 months ago
- Status changed from In Progress to Resolved