Skip to content
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

Scripts to help batch-running automated install/upgrade/restore and post-install tests #261

Draft
wants to merge 58 commits into
base: master
Choose a base branch
from

Conversation

ydirson
Copy link
Contributor

@ydirson ydirson commented Oct 4, 2024

ydirson and others added 11 commits October 4, 2024 13:56
In 0a5ea64 the method was moved from
BaseVM to Pool, but an intermediate version had it moved to Host, and
the final version missed the conversion on one call site, breaking
tune_firstboot tests.

Signed-off-by: Yann Dirson <[email protected]>
This in INFO level makes user think the test is blocked on
xapi-wait-init-complete while the problem is with reaching pool members:

 Sep 06 12:50:28.791 INFO Wait for XAPI init to be complete on 172.16.210.12
 Sep 06 12:50:28.792 DEBUG [172.16.210.12] xapi-wait-init-complete 60
 Sep 06 12:50:29.221 DEBUG [172.16.210.12] xe host-list --minimal
 ...
 Sep 06 12:50:30.503 DEBUG [172.16.210.12] xe host-param-get uuid=0aea61f4-c9d1-4060-94e8-4eb2024d082c param-name=address
 Sep 06 12:50:30.926 DEBUG > 172.16.210.11
 Sep 06 12:50:30.929 DEBUG [172.16.210.11] cat /etc/xensource-inventory
 Sep 06 12:52:47.216 DEBUG > ssh: connect to host 172.16.210.11 port 22: Connection timed out

Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Samuel Verschelde <[email protected]>
This is not meant to be a fixture anyway.

Signed-off-by: Yann Dirson <[email protected]>
This suppresses hostkey checking, making the script more suitable
for non-interactive use, and makes it easier to understand when something
goes wrong.

FIXME locate "lib" more properly

Signed-off-by: Yann Dirson <[email protected]>
Tests for generation of the reference files, and for checking against them.

Signed-off-by: Yann Dirson <[email protected]>
byte-compiled version of /etc/xapi.d/plugins/vmss

Signed-off-by: Yann Dirson <[email protected]>
@ydirson ydirson requested review from stormi and gduperrey October 4, 2024 12:35
@ydirson ydirson force-pushed the install-runtests branch 8 times, most recently from 8791a80 to 19ef189 Compare October 9, 2024 16:21
Getting a vm_booted_with_installer starts with inserting a CD, will be
progressively enhanced.

ISOs are specified through an iso_version key, matched to a filename,
or to a download URL used through a local cache, in data.py.

The ISO is uploaded to the SR through the pool master's mountpoint,
which will lead to extra network traffic but avoids having to
(mis)record the server's location.

The iso_version value is temporarily specified using a pytest marker.

Signed-off-by: Yann Dirson <[email protected]>
This is a first step for answerfile handling, to be able to run a
first real installation.

Signed-off-by: Yann Dirson <[email protected]>
Currently relies on the installer fetching the answerfile from the PXE
server, to ensure the latter's ARP tables are populated with the
obtained DHCP address.

Monitoring the install progress is done by repeatedly polling with grep,
which is far from ideal performance-wise, but avoids adding too much
complexity.

Signed-off-by: Yann Dirson <[email protected]>
Detection of host IP till now relies on the fact we download the
answerfile from PXE server.  Once we take this file from the ISO this
network traffic won't happen so we need some other mechanism to fill the
server's ARP tables.

test-pingpxe.service is installed in install.img by iso-remaster.

Since it is difficult to wait until the IP has been assigned before
launching the service, make it ping continuously until we can reach
the PXE server.

One the installed host we will set a static IP instead.

Signed-off-by: Yann Dirson <[email protected]>
This is necessary to get rid of old ARP cache entries that would match
our IP to the MAC used by the VM clone in a previous test.

Signed-off-by: Yann Dirson <[email protected]>
This process has several steps:
- building of a data structure holding all of the answerfile data,
  from a customizable base in data.py and from tests-specific items
- serialization as XML to be read by host-installer
- necessary changes to the ISO for host-installer to use it

We now have to explicitly enable the network during access (was implied by
the use of a remote answerfile).  Similarly we now rely on the test-pingpxe
service, as nothing else would otherwise populate the server's ARP table.

This is needed so:
- different tests can use different parameters without the need for
  provisionning every answerfile to be used
- tests can dynamically add contents for their own needs, before the
  XML gets actualy written

Signed-off-by: Yann Dirson <[email protected]>
This is not ideal, as we would need to encapsulate machine boot in a
fixture - that will be fixed when we switch away from
pytest-dependency.

Signed-off-by: Yann Dirson <[email protected]>
ydirson and others added 29 commits October 10, 2024 14:29
Signed-off-by: Yann Dirson <[email protected]>
No direct upgrade to 8.3 for those versions.

Signed-off-by: Yann Dirson <[email protected]>
This is just base infra, different machines have not differences yet.

Signed-off-by: Yann Dirson <[email protected]>
Uses a helper VM to modify firstboot data in installed disk

Signed-off-by: Yann Dirson <[email protected]>
clone+start:// will be used to implement--hosts=cache://...

clone:// itself is not yet used directly, but as the "base" protocol upon
which clone+start build, it seems logical (and basically free) to implement.

Signed-off-by: Yann Dirson <[email protected]>
Will allow it to access host_list through closure.

Signed-off-by: Yann Dirson <[email protected]>
Special care taken for making sure a created VM is destroyed if
setup_host fails further down the line.

Signed-off-by: Yann Dirson <[email protected]>
Add a new parameter to allow booting using netinstall. If an ISO only
supports netinstall, it is specified it in the data.py by setting the
`net-only`option to True. This option is set to False by default.

Signed-off-by: Guillaume <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
Signed-off-by: Yann Dirson <[email protected]>
This gets back to DHCP, as static IPs are not needed for this part of
the job.
FIXME: config.py seems a bad idea after all

FIXME: duplicated logic should be factored out
FIXME: should be in job instead
When using --hosts=cache://... it is much too early for such a check, so
we have to give the info manually, and the script would not allow this.

And honor it not just for "collect".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants