Skip to content

Commit 23bec32

Browse files
committed
Resize partitions and make home encryption
1 parent 7d47798 commit 23bec32

17 files changed

+226
-37
lines changed

data/yam/agama/auto/lib/storage.libsonnet

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@ local root_filesystem(filesystem) = {
1010
],
1111
};
1212

13+
local resize_vda() = {
14+
drives: [
15+
{
16+
search: '/dev/vda',
17+
partitions: [
18+
{
19+
search: '/dev/vda2',
20+
filesystem: { path: '/' },
21+
size: '12.5 GiB',
22+
},
23+
{
24+
search: '/dev/vda3',
25+
filesystem: { path: 'swap' },
26+
size: '1 GiB'
27+
},
28+
{
29+
filesystem: { path: '/home' },
30+
encryption: {
31+
luks2: { password: 'nots3cr3t' }
32+
}
33+
},
34+
],
35+
},
36+
],
37+
};
38+
1339
local lvm(encrypted=false, encryption='luks2') = {
1440
drives: [
1541
{
@@ -162,6 +188,7 @@ local raid(level='raid0', uefi=false) = {
162188
lvm_tpm_fde: lvm(true, 'tpmFde'),
163189
raid0: raid('raid0'),
164190
raid0_uefi: raid('raid0', true),
191+
resize_fixed_vda: resize_vda(),
165192
root_filesystem_ext4: root_filesystem('ext4'),
166193
root_filesystem_xfs: root_filesystem('xfs'),
167194
whole_disk_and_boot_unattended: whole_disk_and_boot_unattended(),

data/yam/agama/auto/template.libsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function(bootloader=false,
4848
[if storage == 'lvm_tpm_fde' then 'storage']: storage_lib['lvm_tpm_fde'],
4949
[if storage == 'root_filesystem_ext4' then 'storage']: storage_lib['root_filesystem_ext4'],
5050
[if storage == 'root_filesystem_xfs' then 'storage']: storage_lib['root_filesystem_xfs'],
51+
[if storage == 'resize_vda' then 'storage']: storage_lib['resize_fixed_vda'],
5152
[if storage == 'whole_disk_and_boot_unattended' then 'storage']: storage_lib['whole_disk_and_boot_unattended'],
5253
[if user == true then 'user']: base_lib['user'],
5354
}

lib/Distribution/Opensuse/AgamaDevel.pm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use Yam::Agama::Pom::RebootPage;
2121
use Yam::Agama::Pom::EnterPassphraseBasePage;
2222
use Yam::Agama::Pom::EnterPassphraseForRootPage;
2323
use Yam::Agama::Pom::EnterPassphraseForSwapPage;
24+
use Yam::Agama::Pom::EnterPassphraseForHomePage;
2425

2526
use Utils::Architectures;
2627

@@ -68,4 +69,10 @@ sub get_enter_passphrase_for_swap {
6869
});
6970
}
7071

72+
sub get_enter_passphrase_for_home {
73+
return Yam::Agama::Pom::EnterPassphraseForHomePage->new({
74+
enter_passphrase_base => Yam::Agama::Pom::EnterPassphraseBasePage->new()
75+
});
76+
}
77+
7178
1;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SUSE's openQA tests
2+
#
3+
# Copyright 2025 SUSE LLC
4+
# SPDX-License-Identifier: FSFAP
5+
6+
# Summary: Handles entering passphrase for home encryption after grub.
7+
# Maintainer: QE YaST and Migration (QE Yam) <qe-yam at suse de>
8+
9+
package Yam::Agama::Pom::EnterPassphraseForHomePage;
10+
use strict;
11+
use warnings;
12+
use testapi;
13+
14+
sub new {
15+
my ($class, $args) = @_;
16+
return bless {
17+
enter_passphrase_base => $args->{enter_passphrase_base},
18+
tag_enter_passphrase_for_home_partition => 'enter-passphrase-for-home-partition',
19+
}, $class;
20+
}
21+
22+
sub expect_is_shown {
23+
my ($self) = @_;
24+
assert_screen($self->{tag_enter_passphrase_for_home_partition}, 60);
25+
}
26+
27+
sub enter { shift->{enter_passphrase_base}->enter() }
28+
29+
1;

lib/filesystem_utils.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,12 @@ sub validate_lsblk {
476476
my $dev = $args{device};
477477
my $type = $args{type};
478478
my $has_mountpoints_col = $args{has_mountpoints_col};
479+
my $size = $args{size};
479480

480481
my $validation_test_data = create_lsblk_validation_test_data(
481482
device => $dev,
482-
has_mountpoints_col => $has_mountpoints_col);
483+
has_mountpoints_col => $has_mountpoints_col,
484+
size => $size);
483485

484486
my $blockdev = lsblk_command(
485487
output => join(',', (keys %{$validation_test_data}, 'type')),
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Agama unattended with encryption
3+
description: >
4+
Perform Agama unattended installation with encryption.
5+
schedule:
6+
- yam/agama/boot_agama
7+
- yam/agama/agama_auto
8+
- yam/agama/boot_encrypted_partitions
9+
- installation/first_boot
10+
- console/validate_encrypt
11+
- console/validate_partition_table
12+
- console/validate_blockdevices
13+
test_data:
14+
crypttab:
15+
num_devices_encrypted: 1
16+
<<: !include test_data/yast/encryption/default_enc_luks2.yaml
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Agama unattended with encryption
3+
description: >
4+
Perform Agama unattended installation with encryption on ppc64le.
5+
schedule:
6+
- yam/agama/boot_agama
7+
- yam/agama/patch_agama_tests
8+
- yam/agama/agama
9+
- boot/reconnect_mgmt_console
10+
- yam/agama/boot_encrypted_partitions
11+
- installation/first_boot
12+
- console/validate_encrypt
13+
test_data:
14+
crypttab:
15+
num_devices_encrypted: 1
16+
<<: !include test_data/yast/encryption/default_enc_luks2.yaml
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Agama unattended with encryption
3+
description: >
4+
Perform Agama unattended installation with encryption on s390x.
5+
schedule:
6+
- yam/agama/boot_agama
7+
- yam/agama/patch_agama_tests
8+
- yam/agama/agama
9+
- boot/reconnect_mgmt_console
10+
- yam/agama/boot_encrypted_partitions
11+
- installation/first_boot
12+
- console/validate_encrypt
13+
test_data:
14+
crypttab:
15+
num_devices_encrypted: 1
16+
<<: !include test_data/yast/encryption/default_enc_luks2.yaml

schedule/yam/agama_full_disk_encryption.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ schedule:
77
- yam/agama/import_agama_profile
88
- yam/agama/patch_agama_tests
99
- yam/agama/agama
10-
- yam/agama/boot_full_disk_encryption
10+
- yam/agama/boot_encrypted_partitions
1111
- installation/first_boot
1212
- console/validate_encrypt
1313
test_data:

schedule/yam/agama_full_disk_encryption_ppc64le.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schedule:
88
- yam/agama/patch_agama_tests
99
- yam/agama/agama
1010
- boot/reconnect_mgmt_console
11-
- yam/agama/boot_full_disk_encryption
11+
- yam/agama/boot_encrypted_partitions
1212
- installation/first_boot
1313
- console/validate_encrypt
1414
test_data:

0 commit comments

Comments
 (0)