-
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.
Generate DUD dynamically before installation
- Loading branch information
Showing
5 changed files
with
78 additions
and
1 deletion.
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,14 @@ | ||
<?xml version="1.0"?> | ||
<add_on_products xmlns="http://www.suse.com/1.0/yast2ns" | ||
xmlns:config="http://www.suse.com/1.0/configns"> | ||
<product_items config:type="list"> | ||
<product_item> | ||
<name>SUSE Linux Enterprise Development Tools Module</name> | ||
<url><![CDATA[ftp://openqa.suse.de/{{REPO_SLE_MODULE_DEVELOPMENT_TOOLS}}]]></url> | ||
<priority config:type="integer">50</priority> | ||
<ask_user config:type="boolean">true</ask_user> | ||
<selected config:type="boolean">true</selected> | ||
<check_name config:type="boolean">true</check_name> | ||
</product_item> | ||
</product_items> | ||
</add_on_products> |
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,10 @@ | ||
name: generate_dud | ||
description: > | ||
Generate DUD dynamically: | ||
- Boot an image where phub module is consolidated allowing to install mkdud | ||
(from a product not under development). | ||
- Create DUD expanding variables using values configured for the product. | ||
- Upload the DUD as an asset to be used by a chained job. | ||
schedule: | ||
- boot/boot_to_desktop | ||
- console/generate_dud |
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,49 @@ | ||
# SUSE's openQA tests | ||
# | ||
# Copyright © 2020 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: Generate DUD dynamically using mkdud and xml file where variables | ||
# are expanded for the corresponding product/build. | ||
# | ||
# Maintainer: QA SLE YaST team <qa-sle-yast@suse.de> | ||
|
||
use strict; | ||
use warnings; | ||
use base "opensusebasetest"; | ||
use testapi; | ||
use utils qw(zypper_call); | ||
use registration qw(add_suseconnect_product get_addon_fullname); | ||
|
||
sub expand_variables { | ||
my ($xml) = shift; | ||
|
||
my $file = "inst-sys/$xml"; | ||
my @vars = (script_output("cat $file") =~ /\{\{(\w+)\}\}/g); | ||
for my $var (@vars) { | ||
my $val = get_var($var); | ||
die "Test died: Could not retrieve required variable '$var'" unless $val; | ||
assert_script_run("sed -i 's/{{$var}}/$val/g' $file"); | ||
} | ||
} | ||
|
||
sub run { | ||
select_console 'root-console'; | ||
|
||
my $xml = 'add_on_products.xml'; | ||
my $dud = get_required_var('DUD'); | ||
|
||
add_suseconnect_product(get_addon_fullname('phub')); | ||
zypper_call('in mkdud'); | ||
assert_script_run('wget -P inst-sys ' . data_url($xml)); | ||
expand_variables($xml); | ||
assert_script_run("mkdud --create $dud --dist sle15 " . | ||
"--install instsys,repo --obs-keys --name 'Update' inst-sys"); | ||
upload_asset($dud); | ||
} | ||
|
||
1; |