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

Automated RPU test #253

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

Automated RPU test #253

wants to merge 81 commits into from

Commits on Sep 10, 2024

  1. Add temporary post-install jobs

    Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
    stormi committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    6207269 View commit details
    Browse the repository at this point in the history
  2. get_vdi_sr_uuid: fix intermediate-style call

    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 <yann.dirson@vates.tech>
    ydirson committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    dedbd5b View commit details
    Browse the repository at this point in the history
  3. pool: add a log for better understanding of INFO level

    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 <yann.dirson@vates.tech>
    ydirson committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    48c8237 View commit details
    Browse the repository at this point in the history
  4. Host: on VM cache miss print a key pastable into IMAGE_*EQUIVS

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    66f0e58 View commit details
    Browse the repository at this point in the history
  5. Add temporary post-install jobs

    Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
    stormi committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    fe9aa87 View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2024

  1. install 1/n: fixture to create VMs from template

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    6a3fafd View commit details
    Browse the repository at this point in the history
  2. install 2/n: insert ISO in host VM

    Getting a vm_booted_with_installer starts with inserting a CD, will be
    progressively enhanced.
    
    ISOs are specified using a filename, or a download URL used through a
    local cache.
    
    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    0c11513 View commit details
    Browse the repository at this point in the history
  3. install 3/n: use iso-remaster to plug an hardcoded answerfile

    This is a first step for answerfile handling, to be able to run a
    first real installation.
    
    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    3de6fc1 View commit details
    Browse the repository at this point in the history
  4. install 4/n: boot and monitor installer

    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 <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    fd370ab View commit details
    Browse the repository at this point in the history
  5. install 5/n: make sure host running installer appears in PXE ARP tables

    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 <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    3b8dd9d View commit details
    Browse the repository at this point in the history
  6. install 6/n: install test-pingpxe service on host

    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 <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    d210996 View commit details
    Browse the repository at this point in the history
  7. install 7/n: answerfile generation

    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 <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    61d6016 View commit details
    Browse the repository at this point in the history
  8. install 8/n: use VM cache to chain tests

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    03f68ac View commit details
    Browse the repository at this point in the history
  9. install 9/n: add firstboot test

    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 <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    ff3f94f View commit details
    Browse the repository at this point in the history
  10. Image caching: include commit hash in caching key

    This protects against using results from incompatible test by mistake.
    
    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    5584d95 View commit details
    Browse the repository at this point in the history
  11. Image caching: allow to declare image equivalence

    The key used to locate a VM image in the VM cache depends on the test repo
    commit hash, to protect against using results from incompatible test by
    mistake.  But the commit hash can change for many reasons that do not
    influence the parent tests, so this provides a way to use known-equivalent
    test outputs.
    
    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    850601f View commit details
    Browse the repository at this point in the history
  12. install: use xcpng_chained/continuation_of to simplify dependency spec

    This will avoid duplication of logic for selecting parent test.
    
    Since dependencies are now generated by fixtures, they are not taken
    into account by pytest-order any more.  Looks like some heavy surgery
    would be necessary to get that back.
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    a462594 View commit details
    Browse the repository at this point in the history
  13. remastered_iso: support for unsigned ISOs

    Especially useful for images out of CI, which today are not signed yet.
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    386a00c View commit details
    Browse the repository at this point in the history
  14. install: add "version" test parameter and test-sequences

    Changing test parameters may require changes to hardcoded test sequences.
    
    Adding only a single test sequence here to server as example for quick
    testing, as further commits will make many changes to test names.
    
    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    a30b0a1 View commit details
    Browse the repository at this point in the history
  15. Add upgrade test

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    c6ab88b View commit details
    Browse the repository at this point in the history
  16. install: add a "firmware" parameter

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    ac5f7c5 View commit details
    Browse the repository at this point in the history
  17. install: add "restore" test using 8.3 ISO

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    9018ddf View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    c9679d6 View commit details
    Browse the repository at this point in the history
  19. install: add XS/CH support

    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    6dc7a46 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    c336236 View commit details
    Browse the repository at this point in the history
  21. WIP install: 7.5 and 7.6

    FIXME: those xcpng versions want the ed25519 key, while the alpine
    templace still only has the rsa one.  Single .ssh/config seems hard to
    configure given use of DHCP.
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    5568d9f View commit details
    Browse the repository at this point in the history
  22. WIP Add a first-boot service to make UUIDs unique

    The installer generates UUID for host and its dom0 in xensource-inventory,
    so the result of a costly install test could not be reused for multiple
    hosts in a same pool.
    
    This service will be run once and before xapi ever starts, to override
    those UUIDs with brand new random ones during firstboot.
    
    FIXME: should be moved to test_tune_firstboot instead
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    c8077ef View commit details
    Browse the repository at this point in the history
  23. install: produce several hosts from single install

    This is just base infra, different machines have not differences yet.
    
    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    f3a1c46 View commit details
    Browse the repository at this point in the history
  24. install: adjust host IP and name in firstboot data before booting

    Uses a helper VM to modify firstboot data in installed disk
    
    test-sequences update:
    
     git restore -s HEAD -WS --ignore-unmerged tests/install/test-sequences
     git clean tests/install/test-sequences -fdx
     sed -i '/test_firstboot_install/ i tests/install/test.py::TestNested::test_tune_firstboot[None-' tests/install/test-sequences/*lst
     # plus manual copypasta for rest of line in:
     git st --porcelain |grep ^.M| cut -c4- | xargs $EDITOR
    
    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    cd87643 View commit details
    Browse the repository at this point in the history
  25. Add local_sr parameter to test_install

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    efe6b39 View commit details
    Browse the repository at this point in the history
  26. WIP Rescan the SR

    When the ISO is copied to the SR it happens that it is not available
    right now. So rescan the SR to ensure that it is available.
    
    Signed-off-by: Guillaume <guillaume.thouvenin@vates.tech>
    
    FIXME: rescan after copying rather than on each use
    gthvn1 authored and ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    5d4806a View commit details
    Browse the repository at this point in the history
  27. import_vm: add clone:// and clone+start:// URIs

    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 <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    ebe9c25 View commit details
    Browse the repository at this point in the history
  28. Add support for --nest=... --hosts=cache://...

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    97e7676 View commit details
    Browse the repository at this point in the history
  29. WIP drop redundant version mapping from installer_iso marker

    FIXME:
    - installer_iso fixture could just use iso_version param
      ... except for gen_unique_uuid
      => turn into optional iso_remaster marker?
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    98f905d View commit details
    Browse the repository at this point in the history
  30. WIP Add support for netinstall

    Add a new parameter to allow booting using netinstall. If an ISO only
    supports netinstall you can specify it in the data.py by setting the
    option `net-only` to True. This option is set to False by default.
    
    Signed-off-by: Guillaume <guillaume.thouvenin@vates.tech>
    
    FIXME: net-url should not be required for every ISO
    gthvn1 authored and ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    5fefa60 View commit details
    Browse the repository at this point in the history
  31. WIP Support for listing fallback images for old versions installations

    FIXME: config.py seems a bad idea after all
    ydirson committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    03b3fcd View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    8c41333 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    c3b7785 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    568808c View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    d45aed2 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    fa34550 View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2024

  1. Configuration menu
    Copy the full SHA
    441b860 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    28469e3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    089f1d8 View commit details
    Browse the repository at this point in the history
  4. squash! WIP Support for listing fallback images for old versions inst…

    …allations
    
    FIXME: duplicated logic should be factored out
    ydirson committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    4f566a4 View commit details
    Browse the repository at this point in the history
  5. xcpng-fs-diff: remove no-op statement looking like a decorator

    This is not meant to be a fixture anyway.
    
    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    e36f8f1 View commit details
    Browse the repository at this point in the history
  6. WIP xcpng-fs-diff: use lib.commands.ssh and activate logging

    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 <yann.dirson@vates.tech>
    ydirson committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    821f861 View commit details
    Browse the repository at this point in the history
  7. xcpng-fs-diff: avoid non-standard "exit(-1)"

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    ee8bdb1 View commit details
    Browse the repository at this point in the history
  8. xcpng-fs-diff: change prints to logs

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    2f823e0 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5942ee0 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2b81997 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a7a7060 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    fedd539 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    118e562 View commit details
    Browse the repository at this point in the history
  14. install: new test to check against reference files

    Tests for generation of the reference files, and for checking against them.
    ydirson committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    7863b42 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    7597b94 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    9747973 View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2024

  1. Configuration menu
    Copy the full SHA
    2dd97bd View commit details
    Browse the repository at this point in the history
  2. xcpng-fs-diff: ignore /etc/xapi.d/plugins/vmssc

    byte-compiled version of /etc/xapi.d/plugins/vmss
    
    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 16, 2024
    Configuration menu
    Copy the full SHA
    01651f0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c91dd2b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b7013ca View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    742cda8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    17ebb3a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4cc99f9 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2024

  1. fixup: only one pool required for postinstall job

    Signed-off-by: Samuel Verschelde <stormi-xcp@ylix.fr>
    stormi committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    85cd765 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    402d345 View commit details
    Browse the repository at this point in the history
  3. jobs.py: don't ignore --host-version when --hosts is passed

    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".
    ydirson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    28412f7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a8a0f66 View commit details
    Browse the repository at this point in the history
  5. New test: pool_join

    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    15ebed9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    763ea63 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0a3e227 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    25b09e5 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    78c3e39 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    aecf5c6 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e0a724f View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    6203ad8 View commit details
    Browse the repository at this point in the history
  13. WIP New test: join 2 hosts into a pool

    FIXME: dependency on tests from another module don't seem to get properly
    located by pytest-dependency (--ignore-unknown-dependency required)
    ydirson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    4836461 View commit details
    Browse the repository at this point in the history
  14. WIP arp_clear

    FIXME: how useful?
    ydirson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    020c7ae View commit details
    Browse the repository at this point in the history
  15. WIP test RPU

    FIXME: had to keep a copy of perform_upgrade() after its functionality
    was moved to vm_booted_with_installer fixture, must find a proper solution
    for that
    ydirson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    a737cc5 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    df86df1 View commit details
    Browse the repository at this point in the history
  17. jobs.py: enable logging

    Useful to get the debug output from commands.ssh()
    
    Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
    ydirson committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    f573ee1 View commit details
    Browse the repository at this point in the history