From 63b2f883247848546f84509b691c4f1676c6f0b2 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Thu, 24 Feb 2022 15:43:41 +0100 Subject: [PATCH] fix build flags (#2044896) Resolves: #2044896 --- gating.yaml | 6 ++++++ tests/run_tests.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++ tests/tests.yml | 9 +++++++++ uuid.spec | 14 +++++++++++-- 4 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 gating.yaml create mode 100755 tests/run_tests.sh create mode 100644 tests/tests.yml diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..648918d --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100755 index 0000000..856aabb --- /dev/null +++ b/tests/run_tests.sh @@ -0,0 +1,50 @@ +#!/bin/sh + + +function ntimes +{ + I=0 + for((I=0;I<50;I++)) + do + "$@" + done +} + +function fail +{ + echo "FAIL: $1" >&2 + exit 1 +} + +# check output is always different +if [ -n "$(uuid -n 50 | uniq --repeated)" ] +then + fail "dulicated output" +fi + +# check it can parse uuid it generated +if ! uuid -d $(uuid -v1) >/dev/null 2>&1 +then + fail "can't decore uuid" +fi + +# check v3 uses same output for same seed +if ! [ "$({ uuid -n 5 -v3 ns:URL https://fedoraproject.org/; uuid -n 5 -v3 ns:URL https://fedoraproject.org/ ; } | wc -l)" = 10 ] +then + fail "v3 should have same output for same seed" +fi + +# check v5 uses same output for same seed +if ! [ "$({ uuid -n 5 -v3 ns:URL https://fedoraproject.org/; uuid -n 5 -v3 ns:URL https://fedoraproject.org/ ; } | wc -l)" = 10 ] +then + fail "v5 should have same output for same seed" +fi + +# check v3 and v5 use different hashes (output) +if ! [ "$({ uuid -n 5 -v3 ns:URL https://fedoraproject.org/; uuid -n 5 -v5 ns:URL https://fedoraproject.org/ ; } | uniq | wc -l)" = 2 ] +then + fail "v3 and v5 uuid shouldn't be the same" +fi + +echo "SUCCESS" +exit 0 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..be50ecb --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,9 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + tests: + - simple: + dir: . + run: run_tests.sh diff --git a/uuid.spec b/uuid.spec index ba9ffed..64ec86d 100644 --- a/uuid.spec +++ b/uuid.spec @@ -6,7 +6,7 @@ Name: uuid Version: 1.6.2 -Release: 54%{?dist} +Release: 55%{?dist} Summary: Universally Unique Identifier library License: MIT URL: http://www.ossp.org/pkg/lib/uuid/ @@ -161,6 +161,13 @@ find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \; %{_fixperms} $RPM_BUILD_ROOT/* popd +# fix multilib issues +cp $RPM_BUILD_ROOT/%{_bindir}/uuid-config $RPM_BUILD_ROOT/%{_bindir}/uuid-config.$(uname -m) +cat >$RPM_BUILD_ROOT/%{_bindir}/uuid-config < - 1.6.2-55 +- fix build flags (#2044896) + * Tue Aug 10 2021 Mohan Boddu - 1.6.2-53 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688