#!/bin/bash set -eu -o pipefail . "$(dirname "$0")"/_common openqa_url=${openqa_url:-https://openqa.opensuse.org} distri=${distri:-opensuse} flavor=${flavor:-DVD} flavor_override=${flavor_override:-mm-monitoring} # override flavor to avoid obsoletion by other scheduled products arch=${arch:-x86_64} version=${version:-Tumbleweed} test_name=${test_name:-ping_client} # we expect build numbers in the ISO 8601 format so we're looking for build strings starting with eight latin numerals build_regex=${build_regex:-^[0-9]+$} machine=${machine:-64bit} tmpfile=$(mktemp) trap 'rm -f "$tmpfile"' EXIT cat > "$tmpfile" << EOF --- products: mm-ping-test: distri: $distri flavor: $flavor_override arch: $arch version: $version machines: ${machine}: backend: qemu settings: WORKER_CLASS: qemu_x86_64,tap .common: &common BOOT_HDD_IMAGE: '1' DESKTOP: textmode IS_MM_SERVER: '1' NICTYPE: tap EXPECTED_NM_CONNECTIVITY: '(limited|full)' QEMU_DISABLE_SNAPSHOTS: '1' YAML_SCHEDULE: schedule/functional/mm_ping.yaml job_templates: ping_server: product: mm-ping-test machine: $machine settings: <<: *common HOSTNAME: server ping_client: product: mm-ping-test machine: $machine settings: <<: *common HOSTNAME: client PARALLEL_WITH: ping_server EOF # shellcheck disable=SC2016 hdd=$(runcli openqa-cli api --host "$openqa_url" jobs version="$version" scope=relevant arch="$arch" machine="$machine" flavor="$flavor" test="$test_name" latest=1 | runjq -r --arg regex "$build_regex" '.jobs | map(select(.result == "passed")) | map(select (.settings.BUILD | match($regex))) | max_by(.settings.BUILD) .settings.HDD_1') time openqa-cli schedule \ --monitor --follow \ --host "$openqa_url" \ --param-file SCENARIO_DEFINITIONS_YAML="$tmpfile" \ DISTRI="$distri" VERSION="$version" FLAVOR="$flavor_override" ARCH="$arch" \ BUILD="$(date -Im)" _GROUP_ID=0 \ HDD_1="$hdd"