canonical / oem-qa-tools

Repository for tools developed within OEM QA team
GNU General Public License v3.0
1 stars 12 forks source link

testflinger-yaml-generator: add provision parameters for oem_autoinstall connector #76

Closed Artur-at-work closed 1 month ago

Artur-at-work commented 1 month ago

Expand tf-yaml-generator to support oem_autoinstall device connector in 24.04. It adds 3 more parameters + attachments in the provision stage of job.yaml. These parameters are optional, so if args not added, then no changes to original behavior and templates.

Sample provisioning data for 24.04:

job_queue: artur-oemscript-2404
provision_data:
  url: http://10.131.60.220:8080/job/somerville-noble-oem-24.04a/lastSuccessfulBuild/artifact/out/somerville-noble-oem-24.04a-20240806-59.iso
  token_file: "jenkins-token.txt"
  user_data: "ubuntu-oem-image-builder/alloem-init/cloud-configs/redeploy/user-data"
  authorized_keys: "ubuntu-oem-image-builder/injections/alloem-init/chroot/minimal.standard.live.hotfix.squashfs/etc/ssh/authorized_keys"
  attachments:
    - local: "ubuntu-oem-image-builder/alloem-init/cloud-configs/redeploy/user-data"
    - local: "ubuntu-oem-image-builder/injections/alloem-init/chroot/minimal.standard.live.hotfix.squashfs/etc/ssh/authorized_keys"
    - local: "jenkins-token.txt"

Test: generate with original args: ./testflinger_yaml_generator.py -c 202405-33980 -o prov.yaml --LpID artur-at-work --provisionImage http://10.131.60.220:8080/job/somerville-noble-oem-24.04a/lastSuccessfulBuild/artifact/out/somerville-noble-oem-24.04a-20240820-71.iso

./testflinger_yaml_generator.py -c 202405-33980 -o prov-url.yaml --LpID artur-at-work --provisionType url --provisionImage http://10.131.60.220:8080/job/somerville-noble-oem-24.04a/lastSuccessfulBuild/artifact/out/somerville-noble-oem-24.04a-20240820-71.iso

generate with new args: ./testflinger_yaml_generator.py -c 202405-33980 -o prov-new.yaml --LpID artur-at-work --provisionType url --provisionImage http://10.131.60.220:8080/job/somerville-noble-oem-24.04a/lastSuccessfulBuild/artifact/out/somerville-noble-oem-24.04a-20240820-71.iso --provisionToken ~/testflinger/test-yaml/jenkins-token.txt --provisionAuthKeys ~/testflinger/test-yaml/authorized_keys --provisionUserData ~/testflinger/test-yaml/user-data

Sample prov-new.yaml

Closes: https://warthogs.atlassian.net/browse/OEX86-412

Artur-at-work commented 1 month ago

hi @seankingyang , could you help to review please? It seems I can't request the reviewers directly..

Artur-at-work commented 1 month ago

@seankingyang Thank you for the feedback. I've updated as requested. Also, Testflinger documentation will have the user-data example for reference.