Repository: os-autoinst/os-autoinst-distri-opensuse
Pull request #21322: Create unattended installation for lvm multipath encrypted
Author: login: okynos
Labels: name: qe-yam
Created: 2025-03-03T14:42:50Z | Merged: 2025-03-12T12:41:50Z

We have added the profile templates to perform lvm multipath encrypted tests

- Related ticket: https://progress.opensuse.org/issues/176460
- Needles: N/A
- Verification run: 
  - x86_64: https://openqa.suse.de/tests/16938239#
  - aarch64: https://openqa.suse.de/tests/16938237



Diff:
diff --git a/data/yam/agama/auto/lvm_multipath_encrypted.jsonnet b/data/yam/agama/auto/lvm_multipath_encrypted.jsonnet
new file mode 100644
index 000000000000..40dae5f504e4
--- /dev/null
+++ b/data/yam/agama/auto/lvm_multipath_encrypted.jsonnet
@@ -0,0 +1,62 @@
+{
+  product: {
+    id: '{{AGAMA_PRODUCT_ID}}',
+    registrationCode: '{{SCC_REGCODE}}',
+  },
+  bootloader: {
+    stopOnBootMenu: true,
+  },
+  user: {
+    fullName: 'Bernhard M. Wiedemann',
+    password: '$6$vYbbuJ9WMriFxGHY$gQ7shLw9ZBsRcPgo6/8KmfDvQ/lCqxW8/WnMoLCoWGdHO6Touush1nhegYfdBbXRpsQuy/FTZZeg7gQL50IbA/',
+    hashedPassword: true,
+    userName: 'bernhard',
+  },
+  root: {
+    password: '$6$vYbbuJ9WMriFxGHY$gQ7shLw9ZBsRcPgo6/8KmfDvQ/lCqxW8/WnMoLCoWGdHO6Touush1nhegYfdBbXRpsQuy/FTZZeg7gQL50IbA/',
+    hashedPassword: true,
+  },
+  storage: {
+    drives: [
+      {
+        alias: 'pvs-disk',
+        partitions: [
+          { search: '*', delete: true },
+        ],
+      },
+    ],
+    volumeGroups: [
+      {
+        name: 'system',
+        physicalVolumes: [
+          {
+            generate: {
+              targetDevices: ['pvs-disk'],
+              encryption: {
+                luks2: { password: 'nots3cr3t' },
+              },
+            },
+          },
+        ],
+        logicalVolumes: [
+          { generate: 'default' },
+        ],
+      },
+    ],
+  },
+  scripts: {
+    pre: [
+      {
+        name: 'activate multipath',
+        body: |||
+          #!/bin/bash
+          if ! systemctl status multpathd ; then
+            echo 'Activating multipath'
+            systemctl start multipathd.socket
+            systemctl start multipathd
+          fi
+        |||,
+      },
+    ]
+  },
+}
diff --git a/schedule/yam/agama_lvm_multipath_encrypted_unattended.yaml b/schedule/yam/agama_lvm_multipath_encrypted_unattended.yaml
new file mode 100644
index 000000000000..6d6bbec3928b
--- /dev/null
+++ b/schedule/yam/agama_lvm_multipath_encrypted_unattended.yaml
@@ -0,0 +1,12 @@
+---
+name: Agama unattended lvm with encryption
+description: >
+  Perform Agama unattended installation with encryption on LVM.
+schedule:
+  - yam/agama/boot_agama
+  - yam/agama/agama_auto
+  - installation/grub_test
+  - installation/first_boot
+  - console/validate_lvm
+  - console/validate_encrypt
+  - console/validate_multipath
diff --git a/test_data/yam/agama_lvm_multipath_encrypted.yaml b/test_data/yam/agama_lvm_multipath_encrypted.yaml
new file mode 100644
index 000000000000..2b8a7c4ce109
--- /dev/null
+++ b/test_data/yam/agama_lvm_multipath_encrypted.yaml
@@ -0,0 +1,5 @@
+---
+crypttab:
+  num_devices_encrypted: 1
+<<: !include test_data/yast/encryption/default_enc_luks2.yaml
+<<: !include test_data/yast/multipath.yaml


Reviews:
user: login: rakoenig
state: CHANGES_REQUESTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T15:40:57Z
user: login: jknphy
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T06:38:59Z
user: login: jknphy
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T06:39:33Z
user: login: jknphy
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T06:40:14Z

Review comments:
diff_hunk: @@ -0,0 +1,83 @@
+{
+  product: {
+    id: '{{AGAMA_PRODUCT_ID}}',
+    registrationCode: '{{SCC_REGCODE}}',
+  },
+  bootloader: {
+    stopOnBootMenu: true,
+  },
+  user: {
+    fullName: 'Bernhard M. Wiedemann',
+    password: '$6$vYbbuJ9WMriFxGHY$gQ7shLw9ZBsRcPgo6/8KmfDvQ/lCqxW8/WnMoLCoWGdHO6Touush1nhegYfdBbXRpsQuy/FTZZeg7gQL50IbA/',
+    hashedPassword: true,
+    userName: 'bernhard',
+  },
+  root: {
+    password: '$6$vYbbuJ9WMriFxGHY$gQ7shLw9ZBsRcPgo6/8KmfDvQ/lCqxW8/WnMoLCoWGdHO6Touush1nhegYfdBbXRpsQuy/FTZZeg7gQL50IbA/',
+    hashedPassword: true,
+  },
+  storage: {
+    drives: [
+      {
+        alias: 'pvs-disk',
+        partitions: [
+          { search: '*', delete: true },
+        ],
+      },
+    ],
+    volumeGroups: [
+      {
+        name: 'system',
+        physicalVolumes: [
+          {
+            generate: {
+              targetDevices: ['pvs-disk'],
+              encryption: {
+                luks2: { password: 'nots3cr3t' },
+              },
+            },
+          },
+        ],
+        logicalVolumes: [
+          { generate: 'default' },
+        ],
+      },
+    ],
+  },
+  scripts: {
+    pre: [
+      {
path: data/yam/agama/auto/lvm_multipath_encrypted.jsonnet
user: login: rakoenig
body: If the ticket is only for `aarch64` and `x86_64` we won't need the `wipefs` pre-script. 
created_at: 2025-03-05T15:39:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,82 @@
+{
+  product: {
+    id: '{{AGAMA_PRODUCT_ID}}',
+  },
+  bootloader: {
+    stopOnBootMenu: true,
+  },
+  user: {
+    fullName: 'Bernhard M. Wiedemann',
+    password: '$6$vYbbuJ9WMriFxGHY$gQ7shLw9ZBsRcPgo6/8KmfDvQ/lCqxW8/WnMoLCoWGdHO6Touush1nhegYfdBbXRpsQuy/FTZZeg7gQL50IbA/',
+    hashedPassword: true,
+    userName: 'bernhard',
+  },
+  root: {
+    password: '$6$vYbbuJ9WMriFxGHY$gQ7shLw9ZBsRcPgo6/8KmfDvQ/lCqxW8/WnMoLCoWGdHO6Touush1nhegYfdBbXRpsQuy/FTZZeg7gQL50IbA/',
+    hashedPassword: true,
+  },
+  storage: {
+    drives: [
+      {
+        alias: 'pvs-disk',
+        partitions: [
+          { search: '*', delete: true },
+        ],
+      },
+    ],
+    volumeGroups: [
+      {
+        name: 'system',
+        physicalVolumes: [
+          {
+            generate: {
+              targetDevices: ['pvs-disk'],
+              encryption: {
+                luks2: { password: 'nots3cr3t' },
+              },
+            },
+          },
+        ],
+        logicalVolumes: [
+          { generate: 'default' },
+        ],
+      },
+    ],
+  },
+  scripts: {
+    pre: [
+      {
path: data/yam/agama/auto/lvm_multipath_encrypted_no_reg.jsonnet
user: login: rakoenig
body: If the ticket is only for `aarch64 ` and `x86_64` we won't need the `wipefs` pre-script.
created_at: 2025-03-05T15:40:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,17 @@
+---
+name: Agama unattended lvm with encryption
+description: >
+  Perform Agama unattended installation with encryption on LVM.
+schedule:
+  - yam/agama/boot_agama
+  - yam/agama/agama_auto
+  - installation/grub_test
+  - installation/first_boot
+  - console/validate_lvm
+  - console/validate_encrypt
+  - console/validate_multipath
+test_data:
path: schedule/yam/agama_lvm_multipath_encrypted_unattended.yaml
user: login: jknphy
body: for future refactor, let's use a different file here for test data.
created_at: 2025-03-11T06:38:59Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,71 @@
+{
path: data/yam/agama/auto/lvm_multipath_encrypted_no_reg.jsonnet
user: login: jknphy
body: this file I guess it is not needed anymore, now proxy registration works.
created_at: 2025-03-11T06:39:33Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,72 @@
+{
+  product: {
+    id: '{{AGAMA_PRODUCT_ID}}',
+    registrationCode: '{{SCC_REGCODE}}',
+  },
+  bootloader: {
+    stopOnBootMenu: true,
+  },
+  user: {
+    fullName: 'Bernhard M. Wiedemann',
+    password: '$6$vYbbuJ9WMriFxGHY$gQ7shLw9ZBsRcPgo6/8KmfDvQ/lCqxW8/WnMoLCoWGdHO6Touush1nhegYfdBbXRpsQuy/FTZZeg7gQL50IbA/',
+    hashedPassword: true,
+    userName: 'bernhard',
+  },
+  root: {
+    password: '$6$vYbbuJ9WMriFxGHY$gQ7shLw9ZBsRcPgo6/8KmfDvQ/lCqxW8/WnMoLCoWGdHO6Touush1nhegYfdBbXRpsQuy/FTZZeg7gQL50IbA/',
+    hashedPassword: true,
+  },
+  storage: {
+    drives: [
+      {
+        alias: 'pvs-disk',
+        partitions: [
+          { search: '*', delete: true },
+        ],
+      },
+    ],
+    volumeGroups: [
+      {
+        name: 'system',
+        physicalVolumes: [
+          {
+            generate: {
+              targetDevices: ['pvs-disk'],
+              encryption: {
+                luks2: { password: 'nots3cr3t' },
+              },
+            },
+          },
+        ],
+        logicalVolumes: [
+          { generate: 'default' },
+        ],
+      },
+    ],
+  },
+  scripts: {
+    pre: [
+      {
+        name: 'activate multipath',
+        body: |||
+          #!/bin/bash
+          if ! systemctl status multpathd ; then
+            echo 'Activating multipath'
+            systemctl start multipathd.socket
+            systemctl start multipathd
+          fi
+        |||,
+      },
+    ],
+    post: [
path: data/yam/agama/auto/lvm_multipath_encrypted.jsonnet
user: login: jknphy
body: for qemu this would not be needed I guess.
created_at: 2025-03-11T06:40:14Z
author_association: CONTRIBUTOR

PR comments:
user: login: okynos
created_at: 2025-03-10T15:44:14Z
body: Removed wipefs, thank you!
author_association: CONTRIBUTOR
user: login: okynos
created_at: 2025-03-11T14:37:59Z
body: I applied all requested changes but It seems that Agama with new UI is complaining about LVM configuration and jobs cannot pass.
author_association: CONTRIBUTOR
user: login: jknphy
created_at: 2025-03-11T15:07:10Z
body: > I applied all requested changes but It seems that Agama with new UI is complaining about LVM configuration and jobs cannot pass.

Please, share the issue, UI doesn't allow LVM, but unattended should be fully functional.
author_association: CONTRIBUTOR
user: login: okynos
created_at: 2025-03-12T12:28:04Z
body: Solved, it was on my side
Latest VRs:
- x86_64: https://openqa.suse.de/tests/17026314
- aarch64: https://openqa.suse.de/tests/17026428 
author_association: CONTRIBUTOR
user: login: jknphy
created_at: 2025-03-12T12:41:47Z
body: Please, setup test suite in production and development and don't forget a proper description.
author_association: CONTRIBUTOR