-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7913 from OleksandrOrlov/42731_disk_as_md_member
Add test scenario to verify AY installation while using disk as MD member
- Loading branch information
Showing
7 changed files
with
274 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?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"> | ||
<suse_register> | ||
<do_registration config:type="boolean">true</do_registration> | ||
<email/> | ||
<reg_code>{{SCC_REGCODE}}</reg_code> | ||
<install_updates config:type="boolean">true</install_updates> | ||
<reg_server>{{SCC_URL}}</reg_server> | ||
<addons config:type="list"> | ||
<addon> | ||
<name>sle-module-server-applications</name> | ||
<version>{{VERSION}}</version> | ||
<arch>{{ARCH}}</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> | ||
<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">false</encrypted> | ||
<user_password>nots3cr3t</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> | ||
<partitioning config:type="list"> | ||
<drive> | ||
<type config:type="symbol">CT_DISK</type> | ||
<device>/dev/sda</device> | ||
<disklabel>gpt</disklabel> | ||
<use>all</use> | ||
<partitions config:type="list"> | ||
<partition> | ||
<create config:type="boolean">true</create> | ||
<partition_id config:type="integer">263</partition_id> | ||
<size>8MiB</size> | ||
</partition> | ||
<partition> | ||
<create config:type="boolean">true</create> | ||
<mount>/boot</mount> | ||
<size>400MiB</size> | ||
</partition> | ||
<partition> | ||
<raid_name>/dev/md/0</raid_name> | ||
<size>10GiB</size> | ||
</partition> | ||
</partitions> | ||
</drive> | ||
<drive> | ||
<type config:type="symbol">CT_DISK</type> | ||
<device>/dev/sdb</device> | ||
<disklabel>none</disklabel> | ||
<use>all</use> | ||
<partitions config:type="list"> | ||
<partition> | ||
<raid_name>/dev/md/0</raid_name> | ||
</partition> | ||
</partitions> | ||
</drive> | ||
<drive> | ||
<type config:type="symbol">CT_MD</type> | ||
<device>/dev/md/0</device> | ||
<disklabel>gpt</disklabel> | ||
<use>all</use> | ||
<raid_options> | ||
<raid_type>raid1</raid_type> | ||
</raid_options> | ||
<partitions config:type="list"> | ||
<partition> | ||
<mount>/</mount> | ||
<size>5GiB</size> | ||
</partition> | ||
<partition> | ||
<mount>/data</mount> | ||
<filesystem config:type="symbol">ext4</filesystem> | ||
<size>max</size> | ||
</partition> | ||
</partitions> | ||
</drive> | ||
</partitioning> | ||
</profile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: autoyast_disk_as_md_member | ||
description: > | ||
Test autoyast installation, while using a disk as a MD RAID member | ||
vars: | ||
AUTOYAST: autoyast_sle15/autoyast_disk_as_md_member.xml | ||
AUTOYAST_CONFIRM: 1 | ||
schedule: | ||
- autoyast/prepare_profile | ||
- installation/isosize | ||
- installation/bootloader_start | ||
- autoyast/installation | ||
- autoyast/console | ||
- autoyast/login | ||
- autoyast/wicked | ||
- autoyast/repos | ||
- autoyast/clone | ||
- autoyast/logs | ||
- autoyast/autoyast_reboot | ||
- installation/grub_test | ||
- installation/first_boot | ||
- console/system_prepare | ||
- autoyast/verify_disk_as_md_member | ||
- autoyast/verify_disk_as_md_member_clone | ||
test_data: | ||
disk: '/dev/md0' | ||
partitions_count: 2 | ||
type_part: 'part' | ||
raid_level: 'raid1' | ||
mount_point: | ||
root: '/' | ||
data: '/data' | ||
xpath: | ||
mount: '//ns:partitioning/ns:drive[ns:device="/dev/md/0"]/ns:partitions/ns:partition/ns:mount' | ||
raid_type: '//ns:partitioning/ns:drive[ns:device="/dev/md/0"]/ns:raid_options/ns:raid_type' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2019 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: Validate partitioning for autoyast installation when using disks as | ||
# Multiple Device member. Uses two devices. | ||
# The test verifies that the following configuration of the installed | ||
# system match the parameters in autoyast profile: | ||
# 1. Number of partitions on MD RAID; | ||
# 2. RAID level; | ||
# 3. Mount points for MD partitions. | ||
# Maintainer: Oleksandr Orlov <oorlov@suse.de> | ||
|
||
use strict; | ||
use warnings; | ||
use testapi; | ||
use base 'basetest'; | ||
use scheduler 'get_test_data'; | ||
use Test::Assert ':all'; | ||
|
||
sub collect_disk_data { | ||
my ($disk) = @_; | ||
return script_output("lsblk $disk -l --noheading --output NAME,TYPE,MOUNTPOINT"); | ||
} | ||
|
||
sub run { | ||
my $test_data = get_test_data(); | ||
my $disk_data = collect_disk_data($test_data->{disk}); | ||
|
||
my @partitions = ($disk_data =~ /$test_data->{type_part}/g); | ||
|
||
record_info('Partitions count', 'Verify that MD RAID contains correct number of partitions.'); | ||
assert_equals($test_data->{partitions_count}, scalar @partitions, 'MD RAID contains wrong number of partitions.'); | ||
|
||
record_info('RAID level', 'Verify that RAID level on the installed system corresponds to the expected one.'); | ||
assert_true($disk_data =~ m/$test_data->{raid_level}/, 'Wrong raid level is shown for the MD.'); | ||
|
||
record_info('Mount points', 'Verify that MD contains all the expected mount points.'); | ||
assert_true($disk_data =~ m/$test_data->{mount_point}->{root}/, | ||
"\"$test_data->{mount_point}->{root}\" mount point is not found among MD RAID partitions."); | ||
assert_true($disk_data =~ m/$test_data->{mount_point}->{data}/, | ||
"\"$test_data->{mount_point}->{data}\" mount point is not found among MD RAID partitions."); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2019 SUSE LLC | ||
# | ||
# Copying and distribution of this file, with or without modification, | ||
# are permitted in any medium without royalty provided the copyright | ||
# notice and this notice are preserved. This file is offered as-is, | ||
# without any warranty. | ||
|
||
# Summary: Validate if generated autoyast profile corresponds to the expected one | ||
# when using disks as Multiple Device member. | ||
# Maintainer: Oleksandr Orlov <oorlov@suse.de> | ||
|
||
use strict; | ||
use warnings; | ||
use base 'basetest'; | ||
use testapi; | ||
use xml_utils; | ||
use scheduler 'get_test_data'; | ||
use Test::Assert ':all'; | ||
use autoyast 'init_autoyast_profile'; | ||
|
||
sub run { | ||
my $test_data = get_test_data(); # get test data from scheduling yaml file | ||
my $xpc = get_xpc(init_autoyast_profile()); # get XPathContext | ||
|
||
record_info('RAID level', 'Verify that raid level in the generated autoyast profile corresponds to the expected one.'); | ||
my @raid_level_nodes = find_nodes(xpc => $xpc, xpath => $test_data->{xpath}->{raid_type}); | ||
assert_equals($test_data->{raid_level}, $raid_level_nodes[0]->to_literal, 'Wrong raid level is specified for the MD.'); | ||
|
||
record_info('Mount points', 'Verify that generated autoyast profile contains the the expected number of mount points.'); | ||
my @mount_point_nodes = find_nodes(xpc => $xpc, xpath => $test_data->{xpath}->{mount}); | ||
assert_equals($test_data->{partitions_count}, scalar @mount_point_nodes, 'MD RAID contains wrong number of mount points.'); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters