migrate_to_testing_wiki #8

Merged
alangm merged 61 commits from tcooper/testing-wiki:migrate_to_testing_wiki into main 2024-04-26 01:34:01 +00:00
5 changed files with 946 additions and 0 deletions
Showing only changes of commit ffca960027 - Show all commits

View File

@ -2,3 +2,7 @@
nav: nav:
- Development Box Setup: wiki_development_boxes.md - Development Box Setup: wiki_development_boxes.md
- Git Commit Signing: commit_signing.md - Git Commit Signing: commit_signing.md
- openQA - Access: openqa_access.md
- openQA - openqa-cli POST Examples: openqa_cli_post_examples.md
- openQA - openqa-clone-job Examples: openqa_clone_job_examples.md
- openQA - openqa-clone-custom-git-refspect Examples: openqa_clone_custom_git_refspec_examples.md

124
dev_guides/openqa_access.md Normal file
View File

@ -0,0 +1,124 @@
---
title: openQA - Access
author: Trevor Cooper
revision_date: 2023-04-22
rc:
prod: Rocky Linux
level: Final
---
## System Requirements
To complete any of the examples below you will need access to a system providing the openQA client. Typically that will be a Fedora based system/container with the `openqa-client` package and it's (~239) dependencies installed.
## Access Requirement
### API `GET` access
The {{ rc.prod }} openQA system allows unrestricted public access via it's web interface or using the `openqa-client` for `GET` operations against the API.
### API `POST` access
In order to use the openQA client to interact with the {{ rc.prod }} openQA system for `POST` operations the following are required:
- an account in good standing in the [{{ rc.prod }} Account Services](https://accounts.rockylinux.org) system,
- authorization for API `POST` access from the {{ rc.prod }} Testing Team, and
- an [openQA API key](http://open.qa/docs/#_authentication) generated on the {{ rc.prod }} openQA system.
## Configuring your openqa client
Per the openqa client command help you can configure your client to use your API key in a number of ways.
The following example shows how to configure your client by the most common method used. It's possible to configure
multiple openqa client API keys in this way.
```
$ mkdir -p ~/.config/openqa
$ vim ~/.config/openqa/client.conf
$ cat ~/.config/openqa/client.conf
[localhost]
key = your_localhost_api_key
secret = your_localhost_api_secret
[openqa.rockylinux.org]
key = your_api_key
secret = your_api_secret
```
## Testing your openqa client installation
```
$ openqa-cli api --host http://openqa.rockylinux.org --pretty jobs/1
{
"job" : {
"assets" : {
"iso" : [
"Rocky-8.6-x86_64-boot.iso"
]
},
"assigned_worker_id" : 2,
"blocked_by_id" : null,
"children" : {
"Chained" : [],
"Directly chained" : [],
"Parallel" : []
},
"clone_id" : null,
"group" : "Rocky",
"group_id" : 2,
"has_parents" : 0,
"id" : 1,
"name" : "rocky-8.6-boot-iso-x86_64-Build-8.6-boot-iso--20221110.223812.0-install_default@64bit",
"parents" : {
"Chained" : [],
"Directly chained" : [],
"Parallel" : []
},
"parents_ok" : 1,
"priority" : 10,
"result" : "failed",
"settings" : {
"ARCH" : "x86_64",
"ARCH_BASE_MACHINE" : "64bit",
"BACKEND" : "qemu",
"BUILD" : "-8.6-boot-iso--20221110.223812.0",
"DESKTOP" : "gnome",
"DISTRI" : "rocky",
"FLAVOR" : "boot-iso",
"GRUB" : "ip=dhcp",
"HDDSIZEGB" : "15",
"ISO" : "Rocky-8.6-x86_64-boot.iso",
"MACHINE" : "64bit",
"NAME" : "00000001-rocky-8.6-boot-iso-x86_64-Build-8.6-boot-iso--20221110.223812.0-install_default@64bit",
"PACKAGE_SET" : "default",
"PART_TABLE_TYPE" : "mbr",
"POSTINSTALL" : "_collect_data",
"QEMUCPU" : "Nehalem",
"QEMUCPUS" : "2",
"QEMURAM" : "3072",
"QEMUVGA" : "virtio",
"QEMU_VIRTIO_RNG" : "1",
"TEST" : "install_default",
"TEST_SUITE_NAME" : "install_default",
"TEST_TARGET" : "ISO",
"VERSION" : "8.6",
"WORKER_CLASS" : "qemu_x86_64"
},
"state" : "done",
"t_finished" : "2022-11-10T22:44:19",
"t_started" : "2022-11-10T22:38:12",
"test" : "install_default"
}
}
```
## References
[openQA Documentation](http://open.qa/documentation/)
{% include 'content_bottom.md' %}

View File

@ -0,0 +1,95 @@
---
title: openQA - openqa-cli POST Examples
author: Trevor Cooper
revision_date: 2023-04-23
rc:
prod: Rocky Linux
level: Final
---
# openqa-cli POST Examples
This page will provide a brief overview of some basic `openqa-cli` `POST` examples.
## System / Access Requirements
To complete any of the examples please complete the API `POST` Access steps outlined in the [openQA - Access](openqa_access.md) document.
## Basic POST
A basic `POST` can be used for any of the default test suites for the various {{ rc.prod }} media that are made available. The following examples show some of these standard `POST`s that are commonly used by our team and will be used to demonstrate how some minor variations
### FLAVOR=boot-iso
This first `POST` is the most basic, simply providing the minimal set of variables required to trigger the standard test suite for the {{ rc.prod }} 9.1 boot ISO on openqa workers for the `x86_64` architecture. All tests of the test suite are predetermined and configure on the openQA server. Since the boot ISO doesn't contain any packages this test suite is effectively a network install from standard {{ rc.prod }} repository servers and/or mirrors.
```bash
$ openqa-cli api -X POST isos ISO=Rocky-9.1-x86_64-boot.iso ARCH=x86_64 \
DISTRI=rocky FLAVOR=boot-iso VERSION=9.1 CURRREL=9 BUILD=20230409-Rocky-9.1-x86_64.0
```
### FLAVOR=minimal-iso
This `POST` demonstrates how a different media type, in this case the minimal ISO, for an alternate {{ rc.prod }} version, in this case {{ rc.prod }} 8.7, can be triggered. As can be seen by this and the previous `POST` the `BUILD` variable will typically be designate the date, version and architecture of the test suite. Since the minimal ISO contains all packages required to conduct a ***minimal*** install of {{ rc.prod }} that is the behavior of this test suite.
```bash
$ openqa-cli api -X POST isos ISO=Rocky-8.7-x86_64-minimal.iso ARCH=x86_64 \
DISTRI=rocky FLAVOR=minimal-iso VERSION=8.7 CURRREL=8 BUILD=20230409-Rocky-8.7-x86_64.0
```
### FLAVOR=package-set
This `POST` demonstrates specification of the final normal media type, the dvd ISO, along with what is called a `FLAVOR`, in this case `package-set` for the `x86_64` architecture and {{ rc.prod }} 9.1. Since the dvd ISO contains all of the packages available at release of a specific version or {{ rc.prod }} the `package-set` test suite will test installation of all primary installation types of {{ rc.prod }} not included in the `minimal-iso` test suite above.
```bash
$ openqa-cli api -X POST isos ISO=Rocky-9.1-20221214.1-x86_64-dvd.iso ARCH=x86_64 \
DISTRI=rocky FLAVOR=package-set VERSION=9.1 CURRREL=9 BUILD=20230409-Rocky-9.1-x86_64.0
```
These three test suites provide for the minimal testing of all ISOs produced for a given release of {{ rc.prod }}.
## Advanced POST
In addition to the [Basic POSTs](#basic-post) described above there are additional default test suites that use the dvd ISO media and include substantially more test cases. Those include:
- installing in graphical, text and serial console
- installation for standard BIOS and UEFI
- validation of the Anaconda help system
- disk layout variations including LVM, RAID, partition shrink and/or grow, iSCSI and LUKS
- PXE installation from various network sources
- installation in various languages
Standard `POST`s for these test suites is very similar to the basic POSTs above and are shown below...
### FLAVOR=dvd-iso
```bash
$ openqa-cli api -X POST isos ISO=Rocky-9.1-20221214.1-x86_64-dvd.iso ARCH=x86_64 \
DISTRI=rocky FLAVOR=dvd-iso VERSION=9.1 CURRREL=9 BUILD=20230409-Rocky-9.1-x86_64.0
```
### FLAVOR=universal
```bash
$ openqa-cli api -X POST isos ISO=Rocky-9.1-20221214.1-x86_64-dvd.iso ARCH=x86_64 \
DISTRI=rocky FLAVOR=universal VERSION=9.1 CURRREL=9 BUILD=20230409-Rocky-9.1-x86_64.0
```
## Collection of test suites by BUILD
A feature of openQA is that for a given job group test suites which use the same `BUILD` identifier are collected into a single view in the web UI.
![openQA Home View...](/assets/images/openqa_home_view.png){ loading=lazy }
Thus, the examples show above which all use `BUILD=20230409-Rocky-9.1-x86_64.0` are all shown in a single view. Additionally, that view is accessible via a predictable URI, for example [`https://openqa.rockylinux.org/tests/overview?build=20230409-Rocky-9.1-x86_64.0`](https://openqa.rockylinux.org/tests/overview?build=20230409-Rocky-9.1-x86_64.0) as shown below...
![openQA Build View...](/assets/images/openqa_build_view.png){ loading=lazy }
## References
[openQA Documentation](http://open.qa/documentation/)
{% include 'content_bottom.md' %}

View File

@ -0,0 +1,474 @@
---
title: openQA - openqa-clone-custom-refspec Examples
author: Trevor Cooper
revision_date: 2023-04-23
rc:
prod: Rocky Linux
level: Final
---
# openqa-clone-custom-git-refspec Examples
This page will provide a brief overview of basic and advanced job cloning using the `openqa-clone-custom-git-refspec` command.
At a high level `openqa-clone-custom-git-refspec` can be viewed as a mechanism to test PRs for openQA tests directly in a {{ rc.prod }} openQA instance with making changes to the default configuration. As such, it can support testing of PRs that change test code and needles as long as changes to `templates.fif.json` are not also required. A combination of `openqa-clone-custom-git-refspec` and `openqa-clone-job` (which is actually used by `openqa-clone-custom-git-refspec` under the hood) can be used for some cases where `POST` variables are pre-defined in `templates.fif.json`.
## System / Access Requirements
To complete any of the examples please complete the API `POST` Access steps outlined in the [openQA - Access](openqa_access.md) document.
## Basic `openqa-clone-custom-git-refspec`
The following example demonstrates the testing of an open Github pull request in the {{ rc.prod }} openQA production system. The PR only changes test code and does not supply updated needles for the test.
### Github PR information
***NOTE: The Github CLI tool (`gh`) is used to display PR information statically in this guide.***
```
➜ os-autoinst-distri-rocky git:(develop) gh pr view 168
Serial console install #168
Merged • AlanMarshall wants to merge 1 commit into develop from serial_console • about 27 days ago
+5 -2 • No checks
Reviewers: akatch (Approved), tcooper (Approved), lumarel (Requested)
Labels: priority: medium, type: bug, test suite
Network is enabled by default at v9 so requires conditional code to handle multiple versions.
Tested for 9.1, 8.7 & 8.8:
openqa-cli api -X POST isos ISO=Rocky-9.1-20221214.1-x86_64-dvd.iso ARCH=x86_64 DISTRI=rocky FLAVOR=universal
VERSION=9.1 BUILD=-"$(date +%Y%m%d.%H%M%S).0"-9.1-20221214.1-universal TEST=install_serial_console
openqa-cli api -X POST isos ISO=Rocky-8.7-x86_64-dvd1.iso ARCH=x86_64 DISTRI=rocky FLAVOR=universal VERSION=8.7 BUILD=-
"$(date +%Y%m%d.%H%M%S).0"-8.7-20221110-universal TEST=install_serial_console
openqa-cli api -X POST isos ISO=Rocky-8.8-x86_64-dvd1.iso ARCH=x86_64 DISTRI=rocky FLAVOR=universal VERSION=8.8 BUILD=-
"$(date +%Y%m%d.%H%M%S).0"-8.8-lookahead-universal TEST=install_serial_console
Result: Tests pass.
Also confirm that all main hub check boxes are checked and user test created prior to start of installation.
Fixes Issue #102
View this pull request on GitHub: https://github.com/rocky-linux/os-autoinst-distri-rocky/pull/168
```
Above is the information provided in the original PR and it includes tests performed in Alan's openQA development system. We can rerun failing tests in the {{ rc.prod }} openQA system after identifying an appropriate job ID for each Rocky Linux version we are testing. For this example the openQA WebUI was used to find appropriate test IDs to clone.
### Run `openqa-clone-custom-git-refspec` in `--verbose --dry-run` mode
In practice it is useful to run `openqa-clone-custom-git-refspec` in `--verbose` and `--dry-run` mode to observe it's behavior even for the Basic cases...
```
$ openqa-clone-custom-git-refspec --verbose --dry-run \
https://github.com/rocky-linux/os-autoinst-distri-rocky/pull/168 \
https://openqa.rockylinux.org/tests/16080 2>&1 | tee pr-168
```
***NOTE: The full output of `openqa-clone-custom-git-refspece` will not be shown here.***
```
+ shift
+ true
+ case "$1" in
+ dry_run=true
+ shift
+ true
+ case "$1" in
+ shift
+ break
+ job_list=https://openqa.rockylinux.org/tests/16080
+ [[ -z '' ]]
+ first_arg=https://github.com/rocky-linux/os-autoinst-distri-rocky/pull/168
+ [[ https://github.com/rocky-linux/os-autoinst-distri-rocky/pull/168 == *\p\u\l\l* ]]
+ pr_url=https://github.com/rocky-linux/os-autoinst-distri-rocky/pull/168
+ target_repo_part=https://github.com/rocky-linux/os-autoinst-distri-rocky
+ pr=168
+ pr=168
+ [[ -z '' ]]
+ pr_url=https://api.github.com/repos/rocky-linux/os-autoinst-distri-rocky/pulls/168
++ eval 'curl -s https://api.github.com/repos/rocky-linux/os-autoinst-distri-rocky/pulls/168'
+++ curl -s https://api.github.com/repos/rocky-linux/os-autoinst-distri-rocky/pulls/168
...<snip>...
++ jq -r '.NEEDLES_DIR | select (.!=null)'
+ old_needledir=
+ local needles_dir=
+ needles_dir=rocky/needles
+ local repo_branch=AlanMarshall/os-autoinst-distri-rocky#serial_console
+ local test_suffix=@AlanMarshall/os-autoinst-distri-rocky#serial_console
+ local build=AlanMarshall/os-autoinst-distri-rocky#168
+ local casedir=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#serial_console
+ local GROUP=0
+ local dry_run=true
+ local scriptdir
++ dirname /usr/bin/openqa-clone-custom-git-refspec
+ scriptdir=/usr/bin
+ local 'cmd=true /usr/bin/openqa-clone-job --skip-chained-deps --parental-inheritance --within-instance "https://openqa.rockylinux.org" "15973" _GROUP="0" TEST+="@AlanMarshall/os-autoinst-distri-rocky#serial_console" BUILD="AlanMarshall/os-autoinst-distri-rocky#168" CASEDIR="https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#serial_console" PRODUCTDIR="os-autoinst-distri-rocky" NEEDLES_DIR="rocky/needles"'
+ [[ 0 -ne 0 ]]
+ [[ -n '' ]]
+ eval 'true /usr/bin/openqa-clone-job --skip-chained-deps --parental-inheritance --within-instance "https://openqa.rockylinux.org" "15973" _GROUP="0" TEST+="@AlanMarshall/os-autoinst-distri-rocky#serial_console" BUILD="AlanMarshall/os-autoinst-distri-rocky#168" CASEDIR="https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#serial_console" PRODUCTDIR="os-autoinst-distri-rocky" NEEDLES_DIR="rocky/needles"'
++ true /usr/bin/openqa-clone-job --skip-chained-deps --parental-inheritance --within-instance https://openqa.rockylinux.org 15973 _GROUP=0 TEST+=@AlanMarshall/os-autoinst-distri-rocky#serial_console BUILD=AlanMarshall/os-autoinst-distri-rocky#168 CASEDIR=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#serial_console PRODUCTDIR=os-autoinst-distri-rocky NEEDLES_DIR=rocky/needles
```
What can be seen from the complete `--dry-run` output for `openqa-clone-custom-git-refspec` is that both the job to be cloned and the PR to be used are inspected and a `openqa-clone-job` command is generated to be submitted to the openQA system the job is being cloned on.
Without using `--dry-run` the final `openqa-clone-job` command shown above will be run causing the job of interest to be cloned with additional `POST` variables that will cause the repository/branch referenced in the PR to be cloned into the test directory with important files referenced in the cloned job.
### Run `openqa-clone-custom-git-refspec` without `--verbose --dry-run` mode...
```
$ openqa-clone-custom-git-refspec \
https://github.com/rocky-linux/os-autoinst-distri-rocky/pull/168 \
https://openqa.rockylinux.org/tests/16080
Created job #16119: rocky-9.1-universal-x86_64-Build20230329-Rocky-9.1-x86_64.0-install_serial_console@64bit -> https://openqa.rockylinux.org/t16119
```
### Cloned job information...
```
$ openqa-cli api jobs/16119 --pretty
{
"job" : {
"assets" : {
"iso" : [
"Rocky-9.1-20221214.1-x86_64-dvd.iso"
]
},
"assigned_worker_id" : 5,
"blocked_by_id" : null,
"children" : {
"Chained" : [],
"Directly chained" : [],
"Parallel" : []
},
"clone_id" : 16121,
"group_id" : null,
"has_parents" : 0,
"id" : 16119,
"name" : "rocky-9.1-universal-x86_64-BuildAlanMarshall_os-autoinst-distri-rocky_168-install_serial_console@AlanMarshall_os-autoinst-distri-rocky_serial_console@64bit",
"parents" : {
"Chained" : [],
"Directly chained" : [],
"Parallel" : []
},
"parents_ok" : 1,
"priority" : 10,
"reason" : "isotovideo abort: isotovideo received signal TERM",
"result" : "user_restarted",
"settings" : {
"ANACONDA_TEXT" : "1",
"ARCH" : "x86_64",
"ARCH_BASE_MACHINE" : "64bit",
"BACKEND" : "qemu",
"BUILD" : "AlanMarshall\/os-autoinst-distri-rocky#168",
"CASEDIR" : "https:\/\/github.com\/AlanMarshall\/os-autoinst-distri-rocky.git#serial_console",
"CLONED_FROM" : "https:\/\/openqa.rockylinux.org\/tests\/15973",
"CURRREL" : "9",
"DISTRI" : "rocky",
"FLAVOR" : "universal",
"HDDSIZEGB" : "15",
"ISO" : "Rocky-9.1-20221214.1-x86_64-dvd.iso",
"LOCATION" : "https:\/\/download.rockylinux.org\/pub\/rocky\/9.1\/BaseOS",
"MACHINE" : "64bit",
"NAME" : "00016119-rocky-9.1-universal-x86_64-BuildAlanMarshall_os-autoinst-distri-rocky_168-install_serial_console@AlanMarshall_os-autoinst-distri-rocky_serial_console@64bit",
"NEEDLES_DIR" : "rocky\/needles",
"NICTYPE_USER_OPTIONS" : "net=172.16.2.0\/24",
"NO_UEFI_POST" : "1",
"PART_TABLE_TYPE" : "mbr",
"PRODUCTDIR" : "os-autoinst-distri-rocky",
"QEMUCPU" : "Nehalem",
"QEMUCPUS" : "2",
"QEMURAM" : "2048",
"QEMU_HOST_IP" : "172.16.2.2",
"QEMU_VIDEO_DEVICE" : "virtio-vga",
"QEMU_VIRTIO_RNG" : "1",
"SERIAL_CONSOLE" : "1",
"TEST" : "install_serial_console@AlanMarshall\/os-autoinst-distri-rocky#serial_console",
"TEST_SUITE_NAME" : "install_serial_console",
"TEST_TARGET" : "ISO",
"VERSION" : "9.1",
"VIRTIO_CONSOLE_NUM" : "2",
"WORKER_CLASS" : "qemu_x86_64",
"XRES" : "1024",
"YRES" : "768"
},
"state" : "done",
"t_finished" : "2023-03-29T06:19:37",
"t_started" : "2023-03-29T06:12:26",
"test" : "install_serial_console@AlanMarshall\/os-autoinst-distri-rocky#serial_console"
}
}
```
## Advanced `openqa-clone-custom-git-refspec`
The following example demonstrates the testing of an open Github pull request in the {{ rc.prod }} openQA production system. The PR changes test code and supplies updated needles for the test.
### Github PR information
```
➜ os-autoinst-distri-rocky git:(nazunalika/develop) gh pr view 162
Anaconda text install #162
Open • AlanMarshall wants to merge 2 commits into develop from anaconda-txt • about 1 day ago
+30 -5 • No checks
Reviewers: akatch (Approved), lumarel (Requested), tcooper (Requested)
Labels: priority: medium, type: bug, test suite
Added new needle for text install.
Deleted redundant code.
Tested for 9.1, 8.7 & 8.8:
openqa-cli api -X POST isos ISO=Rocky-9.1-20221214.1-x86_64-dvd.iso ARCH=x86_64 DISTRI=rocky FLAVOR=universal
VERSION=9.1 BUILD=-"$(date +%Y%m%d.%H%M%S).0"-9.1-20221214.1-universal TEST=install_anaconda_text
openqa-cli api -X POST isos ISO=Rocky-8.7-x86_64-dvd1.iso ARCH=x86_64 DISTRI=rocky FLAVOR=universal VERSION=8.7 BUILD=-
"$(date +%Y%m%d.%H%M%S).0"-8.7-20221110-universal TEST=install_anaconda_text
openqa-cli api -X POST isos ISO=Rocky-8.8-x86_64-dvd1.iso ARCH=x86_64 DISTRI=rocky FLAVOR=universal VERSION=8.8 BUILD=-
"$(date +%Y%m%d.%H%M%S).0"-8.8-lookahead-universal TEST=install_anaconda_text
Result: Pass
Fixes Issue #145
akatch approved (Member) • 18h • Newest comment
All indicated tests pass.
View this pull request on GitHub: https://github.com/rocky-linux/os-autoinst-distri-rocky/pull/162
```
### Run `openqa-clone-custom-git-refspec` in `--verbose --dry-run` mode
```
$ openqa-clone-custom-git-refspec --verbose --dry-run https://github.com/rocky-linux/os-autoinst-d
istri-rocky/pull/162 https://openqa.rockylinux.org/tests/13371
+ shift
+ true
+ case "$1" in
+ dry_run=true
+ shift
+ true
+ case "$1" in
+ shift
+ break
+ job_list=https://openqa.rockylinux.org/tests/13371
+ [[ -z '' ]]
+ first_arg=https://github.com/rocky-linux/os-autoinst-distri-rocky/pull/162
+ [[ https://github.com/rocky-linux/os-autoinst-distri-rocky/pull/162 == *\p\u\l\l* ]]
+ pr_url=https://github.com/rocky-linux/os-autoinst-distri-rocky/pull/162
+ target_repo_part=https://github.com/rocky-linux/os-autoinst-distri-rocky
...<snip>...
++ jq -r '.NEEDLES_DIR | select (.!=null)'
+ old_needledir=
+ local needles_dir=
+ needles_dir=rocky/needles
+ local repo_branch=AlanMarshall/os-autoinst-distri-rocky#anaconda-txt
+ local test_suffix=@AlanMarshall/os-autoinst-distri-rocky#anaconda-txt
+ local build=AlanMarshall/os-autoinst-distri-rocky#162
+ local casedir=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#anaconda-txt
+ local GROUP=0
+ local dry_run=true
+ local scriptdir
++ dirname /usr/bin/openqa-clone-custom-git-refspec
+ scriptdir=/usr/bin
+ local 'cmd=true /usr/bin/openqa-clone-job --skip-chained-deps --parental-inheritance --within-instance "https://openqa.rockylinux.org" "13371" _GROUP="0" TEST+="@AlanMarshall/os-autoinst-distri-rocky#anaconda-txt" BUILD="AlanMarshall/os-autoinst-distri-rocky#162" CASEDIR="https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#anaconda-txt" PRODUCTDIR="os-autoinst-distri-rocky" NEEDLES_DIR="rocky/needles"'
+ [[ 0 -ne 0 ]]
+ [[ -n '' ]]
+ eval 'true /usr/bin/openqa-clone-job --skip-chained-deps --parental-inheritance --within-instance "https://openqa.rockylinux.org" "13371" _GROUP="0" TEST+="@AlanMarshall/os-autoinst-distri-rocky#anaconda-txt" BUILD="AlanMarshall/os-autoinst-distri-rocky#162" CASEDIR="https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#anaconda-txt" PRODUCTDIR="os-autoinst-distri-rocky" NEEDLES_DIR="rocky/needles"'
++ true /usr/bin/openqa-clone-job --skip-chained-deps --parental-inheritance --within-instance https://openqa.rockylinux.org 13371 _GROUP=0 TEST+=@AlanMarshall/os-autoinst-distri-rocky#anaconda-txt BUILD=AlanMarshall/os-autoinst-distri-rocky#162 CASEDIR=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#anaconda-txt PRODUCTDIR=os-autoinst-distri-rocky NEEDLES_DIR=rocky/needles
```
This PR provides updated needles and the default behavior of `openqa-clone-custom-git-refspec` is to **not** provide an alternate location for `NEEDLES`. The `--verbose --dry-run` output needs to be modified to ensure the needles provided in the PR are used in the test.
### Modify `--verbose --dry-run` output to point to needles in the PR...
Use output to modify clone job...
#### original
```
$ /usr/bin/openqa-clone-job --skip-chained-deps --parental-inheritance --within-instance https://openqa.rockylinux.org 13371 _GROUP=0 TEST+=@AlanMarshall/os-autoinst-distri-rocky#anaconda-txt BUILD=AlanMarshall/os-autoinst-distri-rocky#162 CASEDIR=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#anaconda-txt PRODUCTDIR=os-autoinst-distri-rocky
NEEDLES_DIR=rocky/needles
```
#### specify NEEDLES_DIR manually pointing at PR branch
```
$ /usr/bin/openqa-clone-job --skip-chained-deps --parental-inheritance --within-instance https://o
penqa.rockylinux.org 13371 _GROUP=0 TEST+=@AlanMarshall/os-autoinst-distri-rocky#anaconda-txt BUILD=AlanMarshall/os-autoinst-distr
i-rocky#162 CASEDIR=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#anaconda-txt PRODUCTDIR=os-autoinst-distri-rocky
NEEDLES_DIR=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git/needles#anaconda-txt
```
#### {{ rc.prod }} 9.1
```
$ /usr/bin/openqa-clone-job --skip-chained-deps --parental-inheritance --within-instance https://openqa.rockylinux.org 13255 _GROUP=0 TEST+=@AlanMarshall/os-autoinst-distri-rocky#anaconda-txt BUILD=AlanMarshall/os-autoinst-distri-rocky#162 CASEDIR=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#anaconda-txt PRODUCTDIR=os-autoinst-distri-rocky NEEDLES_DIR=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#anaconda-txt/needles
Created job #14228: rocky-9.1-universal-x86_64-Build20230319-Rocky-9.1-x86_64.0-install_anaconda_text@64bit -> https://openqa.rockylinux.org/t14228
```
```
$ openqa-cli api jobs/14228 --pretty
{
"job" : {
"assets" : {
"iso" : [
"Rocky-9.1-20221214.1-x86_64-dvd.iso"
]
},
"assigned_worker_id" : 9,
"blocked_by_id" : null,
"children" : {
"Chained" : [],
"Directly chained" : [],
"Parallel" : []
},
"clone_id" : null,
"group_id" : null,
"has_parents" : 0,
"id" : 14228,
"name" : "rocky-9.1-universal-x86_64-BuildAlanMarshall_os-autoinst-distri-rocky_162-install_anaconda_text@AlanMarshall_os-autoinst-distri-rocky_anaconda-txt@64bit",
"parents" : {
"Chained" : [],
"Directly chained" : [],
"Parallel" : []
},
"parents_ok" : 1,
"priority" : 0,
"result" : "passed",
"settings" : {
"ANACONDA_TEXT" : "1",
"ARCH" : "x86_64",
"ARCH_BASE_MACHINE" : "64bit",
"BACKEND" : "qemu",
"BUILD" : "AlanMarshall\/os-autoinst-distri-rocky#162",
"CASEDIR" : "https:\/\/github.com\/AlanMarshall\/os-autoinst-distri-rocky.git#anaconda-txt",
"CLONED_FROM" : "https:\/\/openqa.rockylinux.org\/tests\/13255",
"CURRREL" : "9",
"DISTRI" : "rocky",
"FLAVOR" : "universal",
"HDDSIZEGB" : "15",
"ISO" : "Rocky-9.1-20221214.1-x86_64-dvd.iso",
"LOCATION" : "https:\/\/dl.rockylinux.org\/pub\/rocky\/9.1",
"MACHINE" : "64bit",
"NAME" : "00014228-rocky-9.1-universal-x86_64-BuildAlanMarshall_os-autoinst-distri-rocky_162-install_anaconda_text@AlanMarshall_os-autoinst-distri-rocky_anaconda-txt@64bit",
"NEEDLES_DIR" : "https:\/\/github.com\/AlanMarshall\/os-autoinst-distri-rocky.git#anaconda-txt\/needles",
"NICTYPE_USER_OPTIONS" : "net=172.16.2.0\/24",
"PART_TABLE_TYPE" : "mbr",
"PRODUCTDIR" : "os-autoinst-distri-rocky",
"QEMUCPU" : "Nehalem",
"QEMUCPUS" : "2",
"QEMURAM" : "2048",
"QEMU_HOST_IP" : "172.16.2.2",
"QEMU_VIDEO_DEVICE" : "virtio-vga",
"QEMU_VIRTIO_RNG" : "1",
"TEST" : "install_anaconda_text@AlanMarshall\/os-autoinst-distri-rocky#anaconda-txt",
"TEST_SUITE_NAME" : "install_anaconda_text",
"TEST_TARGET" : "ISO",
"VERSION" : "9.1",
"WORKER_CLASS" : "qemu_x86_64",
"XRES" : "1024",
"YRES" : "768"
},
"state" : "done",
"t_finished" : "2023-03-22T05:28:28",
"t_started" : "2023-03-22T05:07:09",
"test" : "install_anaconda_text@AlanMarshall\/os-autoinst-distri-rocky#anaconda-txt"
}
}
```
![openqa-clone-custome-git-refspec-job-14228 example...](/assets/images/openqa-clone-custom-git-refspec-job-14228.png){ loading=lazy }
#### {{ rc.prod }} 8.7
```
$ /usr/bin/openqa-clone-job --skip-chained-deps --parental-inheritance --within-instance https://openqa.rockylinux.org 13371 _GROUP=0 TEST+=@AlanMarshall/os-autoinst-distri-rocky#anaconda-txt BUILD=AlanMarshall/os-autoinst-distri-rocky#162 CASEDIR=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#anaconda-txt PRODUCTDIR=os-autoinst-distri-rocky NEEDLES_DIR=https://github.com/AlanMarshall/os-autoinst-distri-rocky.git#anaconda-txt/needles
Created job #14229: rocky-8.7-universal-x86_64-Build20230319-Rocky-8.7-x86_64.0-install_anaconda_text@64bit -> https://openqa.rockylinux.org/t14229
```
```
$ openqa-cli api jobs/14229 --pretty
{
"job" : {
"assets" : {
"iso" : [
"Rocky-8.7-x86_64-dvd1.iso"
]
},
"assigned_worker_id" : 8,
"blocked_by_id" : null,
"children" : {
"Chained" : [],
"Directly chained" : [],
"Parallel" : []
},
"clone_id" : null,
"group_id" : null,
"has_parents" : 0,
"id" : 14229,
"name" : "rocky-8.7-universal-x86_64-BuildAlanMarshall_os-autoinst-distri-rocky_162-install_anaconda_text@AlanMarshall_os-autoinst-distri-rocky_anaconda-txt@64bit",
"parents" : {
"Chained" : [],
"Directly chained" : [],
"Parallel" : []
},
"parents_ok" : 1,
"priority" : 0,
"result" : "passed",
"settings" : {
"ANACONDA_TEXT" : "1",
"ARCH" : "x86_64",
"ARCH_BASE_MACHINE" : "64bit",
"BACKEND" : "qemu",
"BUILD" : "AlanMarshall\/os-autoinst-distri-rocky#162",
"CASEDIR" : "https:\/\/github.com\/AlanMarshall\/os-autoinst-distri-rocky.git#anaconda-txt",
"CLONED_FROM" : "https:\/\/openqa.rockylinux.org\/tests\/13371",
"CURRREL" : "8",
"DISTRI" : "rocky",
"FLAVOR" : "universal",
"HDDSIZEGB" : "15",
"ISO" : "Rocky-8.7-x86_64-dvd1.iso",
"LOCATION" : "https:\/\/dl.rockylinux.org\/pub\/rocky\/8.7",
"MACHINE" : "64bit",
"NAME" : "00014229-rocky-8.7-universal-x86_64-BuildAlanMarshall_os-autoinst-distri-rocky_162-install_anaconda_text@AlanMarshall_os-autoinst-distri-rocky_anaconda-txt@64bit",
"NEEDLES_DIR" : "https:\/\/github.com\/AlanMarshall\/os-autoinst-distri-rocky.git#anaconda-txt\/needles",
"NICTYPE_USER_OPTIONS" : "net=172.16.2.0\/24",
"PART_TABLE_TYPE" : "mbr",
"PRODUCTDIR" : "os-autoinst-distri-rocky",
"QEMUCPU" : "Nehalem",
"QEMUCPUS" : "2",
"QEMURAM" : "2048",
"QEMU_HOST_IP" : "172.16.2.2",
"QEMU_VIDEO_DEVICE" : "virtio-vga",
"QEMU_VIRTIO_RNG" : "1",
"TEST" : "install_anaconda_text@AlanMarshall\/os-autoinst-distri-rocky#anaconda-txt",
"TEST_SUITE_NAME" : "install_anaconda_text",
"TEST_TARGET" : "ISO",
"VERSION" : "8.7",
"WORKER_CLASS" : "qemu_x86_64",
"XRES" : "1024",
"YRES" : "768"
},
"state" : "done",
"t_finished" : "2023-03-22T05:31:22",
"t_started" : "2023-03-22T05:10:46",
"test" : "install_anaconda_text@AlanMarshall\/os-autoinst-distri-rocky#anaconda-txt"
}
}
```
![openqa-clone-custome-git-refspec-job-14229 example...](/assets/images/openqa-clone-custom-git-refspec-job-14229.png){ loading=lazy }
## References
[openQA Documentation](http://open.qa/documentation/)
{% include 'content_bottom.md' %}

View File

@ -0,0 +1,249 @@
---
title: openQA - openqa-clone-job Examples
author: Trevor Cooper
revision_date: 2023-04-22
rc:
prod: Rocky Linux
level: Final
---
# openqa-clone-job Examples
This page will provide a brief overview of basic and advanced job cloning using the `openqa-clone-job` command.
## System / Access Requirements
To complete any of the examples please complete the API `POST` Access steps outlined in the [openQA - Access](openqa_access.md) document.
## Basic `openqa-clone-job`
### Querying openQA for a specific test or job
First you might want to query the {{ rc.prod }} openQA system for the latest job ID for a specific job or test. The openQA client, hereafter refered to as `openqa-cli` will allow you to quickly do that via the API. Here is an example...
```
$ openqa-cli api --host http://openqa.rockylinux.org jobs/overview groupid=0 distri=rocky version=9.1 test=install_default_upload latest=1 | jq '.'
[
{
"id": 22735,
"name": "rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit"
}
]
```
This basically says "give me the job id and name of the most recent `install_default_upload` test for {{ rc.prod }} 9.1".
### Cloning a job "as-is"
With that job id in hand you can now clone that job directly to your local openQA development system with...
```
$ openqa-clone-job --from https://openqa.rockylinux.org --skip-download 22735
Cloning children of rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit
Created job #23: rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit -> http://localhost/t23
```
### Basic job overview
Now you should have the same job running in your local instance...
```
$ openqa-cli api jobs/overview
[{"id":23,"name":"rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit"}]
```
### Basic job details
```
$ openqa-cli api jobs/23 | jq '.'
{
"job": {
"assets": {
"iso": [
"Rocky-9.1-20221214.1-x86_64-dvd.iso"
]
},
"assigned_worker_id": 2,
"blocked_by_id": null,
"children": {
"Chained": [],
"Directly chained": [],
"Parallel": []
},
"clone_id": null,
"group": "Rocky",
"group_id": 2,
"has_parents": 0,
"id": 23,
"name": "rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit",
"parents": {
"Chained": [],
"Directly chained": [],
"Parallel": []
},
"parents_ok": 1,
"priority": 50,
"result": "none",
"settings": {
"ARCH": "x86_64",
"ARCH_BASE_MACHINE": "64bit",
"BACKEND": "qemu",
"BUILD": "20230423-Rocky-9.1-x86_64.0",
"CLONED_FROM": "https://openqa.rockylinux.org/tests/22735",
"CURRREL": "9",
"DEPLOY_UPLOAD_TEST": "install_default_upload",
"DESKTOP": "gnome",
"DISTRI": "rocky",
"FLAVOR": "dvd-iso",
"HDDSIZEGB": "15",
"ISO": "Rocky-9.1-20221214.1-x86_64-dvd.iso",
"LOCATION": "https://download.rockylinux.org/pub/rocky/9.1/BaseOS",
"MACHINE": "64bit",
"NAME": "00000023-rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit",
"NICTYPE_USER_OPTIONS": "net=172.16.2.0/24",
"PACKAGE_SET": "default",
"PART_TABLE_TYPE": "mbr",
"POSTINSTALL": "_collect_data",
"QEMUCPU": "Nehalem",
"QEMUCPUS": "2",
"QEMURAM": "2048",
"QEMU_HOST_IP": "172.16.2.2",
"QEMU_VIDEO_DEVICE": "virtio-vga",
"QEMU_VIRTIO_RNG": "1",
"STORE_HDD_1": "disk_dvd-iso_64bit.qcow2",
"TEST": "install_default_upload",
"TEST_SUITE_NAME": "install_default_upload",
"TEST_TARGET": "ISO",
"VERSION": "9.1",
"WORKER_CLASS": "qemu_x86_64",
"XRES": "1024",
"YRES": "768"
},
"state": "running",
"t_finished": null,
"t_started": "2023-04-23T03:02:06",
"test": "install_default_upload"
}
}
```
***NOTE: In the above job information you can clearly see the job was cloned from `https://openqa.rockylinux.org/tests/22735`.
## Advanced `openqa-clone-job`
You can, of course, perform more elaborate operations while cloneing a job either from your local instance or from the production instance. Typically, this might be done to modify some of the job POST variables in the cloned job while keeping all other variables unchanged.
### Changing variable during clone
Here is an example where the ISO is changed in the cloned job...
```
$ openqa-clone-job --from https://openqa.rockylinux.org --skip-download 22735 ISO=Rocky-9.1-x86_64-dvd.iso
Cloning children of rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit
Created job #24: rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit -> http://localhost/t24
```
### Job overview
```
$ openqa-cli api jobs/overview
[{"id":24,"name":"rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit"}]
```
### Job details
```
$ openqa-cli api jobs/24 | jq '.'
{
"job": {
"assets": {
"iso": [
"Rocky-9.1-x86_64-dvd.iso"
]
},
"assigned_worker_id": 1,
"blocked_by_id": null,
"children": {
"Chained": [],
"Directly chained": [],
"Parallel": []
},
"clone_id": null,
"group": "Rocky",
"group_id": 2,
"has_parents": 0,
"id": 24,
"name": "rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit",
"parents": {
"Chained": [],
"Directly chained": [],
"Parallel": []
},
"parents_ok": 1,
"priority": 50,
"result": "none",
"settings": {
"ARCH": "x86_64",
"ARCH_BASE_MACHINE": "64bit",
"BACKEND": "qemu",
"BUILD": "20230423-Rocky-9.1-x86_64.0",
"CLONED_FROM": "https://openqa.rockylinux.org/tests/22735",
"CURRREL": "9",
"DEPLOY_UPLOAD_TEST": "install_default_upload",
"DESKTOP": "gnome",
"DISTRI": "rocky",
"FLAVOR": "dvd-iso",
"HDDSIZEGB": "15",
"ISO": "Rocky-9.1-x86_64-dvd.iso",
"LOCATION": "https://download.rockylinux.org/pub/rocky/9.1/BaseOS",
"MACHINE": "64bit",
"NAME": "00000024-rocky-9.1-dvd-iso-x86_64-Build20230423-Rocky-9.1-x86_64.0-install_default_upload@64bit",
"NICTYPE_USER_OPTIONS": "net=172.16.2.0/24",
"PACKAGE_SET": "default",
"PART_TABLE_TYPE": "mbr",
"POSTINSTALL": "_collect_data",
"QEMUCPU": "Nehalem",
"QEMUCPUS": "2",
"QEMURAM": "2048",
"QEMU_HOST_IP": "172.16.2.2",
"QEMU_VIDEO_DEVICE": "virtio-vga",
"QEMU_VIRTIO_RNG": "1",
"STORE_HDD_1": "disk_dvd-iso_64bit.qcow2",
"TEST": "install_default_upload",
"TEST_SUITE_NAME": "install_default_upload",
"TEST_TARGET": "ISO",
"VERSION": "9.1",
"WORKER_CLASS": "qemu_x86_64",
"XRES": "1024",
"YRES": "768"
},
"state": "running",
"t_finished": null,
"t_started": "2023-04-23T03:08:03",
"test": "install_default_upload"
}
}
```
## Difference between Basic and Advanced `openqa-clone-job`
You should notice that the only substantive difference between the two cloned jobs is the ISO that is used to run the `install_default_upload` test...
```
$ openqa-cli api jobs/23 | jq '.job.settings.ISO'
"Rocky-9.1-20221214.1-x86_64-dvd.iso"
$ openqa-cli api jobs/24 | jq '.job.settings.ISO'
"Rocky-9.1-x86_64-dvd.iso"
```
## References
[openQA Documentation](http://open.qa/documentation/)
{% include 'content_bottom.md' %}