New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Kiwi tests to build image locally #17178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the minor comments, it all looks ok... I would try to avoid hardcoding the version everywhere though
data/kiwi/appliance.kiwi
Outdated
<image schemaversion="6.1" name="SLES15-SP4-Minimal" displayname="SLES 15 SP4"> | ||
<description type="system"> | ||
<author>SUSE LLC</author> | ||
<contact>crc@suse.com</contact> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QE-Core? :)
data/kiwi/appliance.kiwi
Outdated
<profile name="RaspberryPi" description="Minimal for the Raspberry Pi" arch="aarch64"/> | ||
</profiles> | ||
<preferences profiles="kvm-and-xen"> | ||
<version>15.4.0</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think version here shouldn't be hardcoded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the Kiwi documentation, the mandatory image version should follow a three-part format: Major.Minor.Release. Therefore, I have modified the version to 1.1.0 in the Kiwi XML file. After the Kiwi build is completed,I rename the version in the generated qcow2 file to match the build setting value.This step enables me to further test the generated qcow2.
data/kiwi/appliance.kiwi
Outdated
</preferences> | ||
|
||
<preferences profiles="kvm"> | ||
<version>15.4.0</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
data/kiwi/appliance.kiwi
Outdated
<repository type="rpm-md" alias="sle"> | ||
<source path="http://updates.suse.de/SUSE/Products/SLE-Product-SLES/15-SP4/x86_64/product/"/> | ||
</repository> | ||
<repository type="rpm-md" alias="sle-dev"> | ||
<source path="http://updates.suse.de/SUSE/Products/SLE-Module-Development-Tools/15-SP4/x86_64/product/"/> | ||
</repository> | ||
<repository type="rpm-md" > | ||
<source path="http://updates.suse.de/SUSE/Products/SLE-Module-Server-Applications/15-SP4/x86_64/product/"/> | ||
</repository> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as a bove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have modified the code and XML files to maintain generic across different SLEs versions.
# Verify the built qcow2 image filename in the /tmp folder and rename the file with the proper build number, | ||
# considering that the Kiwi NG XML requires a mandatory image version in the format of Major.Minor.Releases, | ||
# while the SLE Build may have different requirements. | ||
validate_script_output("ls -l /tmp", sub { m/SLES15-SP4-Minimal.x86_64-15.4.0.qcow2/ }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the <version>foo</version>
only needed for this part? or if you set it to... say SLES-15-SP4
does it have any impact In the profile thing?
# Kiwi image locally | ||
assert_script_run("curl -v -o $testdir/appliance.kiwi " . data_url("kiwi/appliance.kiwi")); | ||
# Execute the Kiwi-ng command to build the KVM and Xen system image | ||
script_run("kiwi-ng --profile kvm-and-xen system build --description $testdir --target-dir /tmp/", timeout => 1200); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not assert script run?
use warnings; | ||
use testapi; | ||
use utils; | ||
use network_utils qw(iface setup_static_network); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not needed anymore?
6cb10ca
to
1b39772
Compare
my $args_gw = testapi::host_ip(); | ||
# login in to system | ||
enter_cmd("root"); | ||
sleep(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fear that the sleep will need to be changed in the future, can you add a comment to rework the test if it fails because of this? as 2 seconds might be too little if the host system is under heavy load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the sleep in the code by handling the login to the system via a function call, select_serial_terminal
(). Additionally, I modified the user accounts in the Kiwi XML file with the default passwords.
@@ -0,0 +1,9 @@ | |||
--- | |||
name: kiwi_test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: kiwi_test | |
name: kiwi_build_image |
Perform a Kiwi test to build a qcow2 image locally
Latest VRs:
Kiwi_build_image | boot_kiwi_image