From cf65faed468d0cb45d383bb9ccef466e08b7810e Mon Sep 17 00:00:00 2001 From: Zdenek Veleba Date: Mon, 8 Apr 2019 07:47:42 +0000 Subject: [PATCH] Add gating test Resolves: rhbz#1682904 Signed-off-by: Peter Jones --- gating.yaml | 6 ++++ tests/macros.efi-srpm_test.sh | 58 +++++++++++++++++++++++++++++++++++ tests/test.spec | 22 +++++++++++++ tests/tests.yml | 12 ++++++++ 4 files changed, 98 insertions(+) create mode 100644 gating.yaml create mode 100644 tests/macros.efi-srpm_test.sh create mode 100644 tests/test.spec create mode 100644 tests/tests.yml diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..6985029 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-8 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/macros.efi-srpm_test.sh b/tests/macros.efi-srpm_test.sh new file mode 100644 index 0000000..7875cea --- /dev/null +++ b/tests/macros.efi-srpm_test.sh @@ -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 diff --git a/tests/test.spec b/tests/test.spec new file mode 100644 index 0000000..c649d9a --- /dev/null +++ b/tests/test.spec @@ -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} diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..c943904 --- /dev/null +++ b/tests/tests.yml @@ -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