Add gating test

Resolves: rhbz#1682904
Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Zdenek Veleba 2019-04-08 07:47:42 +00:00 committed by Peter Jones
parent 4765e4a596
commit cf65faed46
4 changed files with 98 additions and 0 deletions

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -0,0 +1,58 @@
#!/bin/bash
# exit when any command fails
set -e
declare -A archs
archs[ia64]="efi_alt_arch=none
efi_alt_arch_upper=NONE
efi_arch=ia64
efi_arch_upper=IA64
efi_has_alt_arch=00
efi_has_arch=01"
archs[x86_64]="efi_alt_arch=ia32
efi_alt_arch_upper=IA32
efi_arch=x64
efi_arch_upper=X64
efi_has_alt_arch=01
efi_has_arch=01"
archs["%{ix86}"]="efi_alt_arch=none
efi_alt_arch_upper=NONE
efi_arch=ia32
efi_arch_upper=IA32
efi_has_alt_arch=00
efi_has_arch=01"
archs[aarch64]="efi_alt_arch=none
efi_alt_arch_upper=NONE
efi_arch=aa64
efi_arch_upper=AA64
efi_has_alt_arch=00
efi_has_arch=01"
archs["%{arm}"]="efi_alt_arch=none
efi_alt_arch_upper=NONE
efi_arch=arm
efi_arch_upper=ARM
efi_has_alt_arch=00
efi_has_arch=01"
common="efi_esp_boot=/boot/efi/EFI/BOOT
efi_esp_dir=/boot/efi/EFI/redhat
efi_esp_efi=/boot/efi/EFI
efi_esp_root=/boot/efi
efi_vendor=redhat"
output=$(mktemp)
for arch in "${!archs[@]}"; do
echo "Testing ${arch}"
rpmbuild -bp --target ${arch}-redhat-linux test.spec \
| grep -A12 %prep > $output
for item in ${archs[$arch]}; do
grep ^$item $output
done
for item in ${common}; do
grep ^$item $output
done
echo ""
done

22
tests/test.spec Normal file
View File

@ -0,0 +1,22 @@
Name: test
Version: 1
Release: 1%{?dist}
Summary: test
License: None
%description
None
%prep
echo efi_alt_arch=%{efi_alt_arch}
echo efi_alt_arch_upper=%{efi_alt_arch_upper}
echo efi_arch=%{efi_arch}
echo efi_arch_upper=%{efi_arch_upper}
echo efi_esp_boot=%{efi_esp_boot}
echo efi_esp_dir=%{efi_esp_dir}
echo efi_esp_efi=%{efi_esp_efi}
echo efi_esp_root=%{efi_esp_root}
echo efi_has_alt_arch=%{efi_has_alt_arch}
echo efi_has_arch=%{efi_has_arch}
echo efi_srpm_macros_version=%{efi_srpm_macros_version}
echo efi_vendor=%{efi_vendor}

12
tests/tests.yml Normal file
View File

@ -0,0 +1,12 @@
---
- hosts: all
roles:
- role: standard-test-basic
tags:
- classic
required_packages:
- rpm-build
tests:
- rpm-macros:
dir: .
run: ./macros.efi-srpm_test.sh