diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2021-06-21 15:40:48 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2021-06-22 15:02:29 +0300 |
commit | 45e56320da54a8a20a55770b3a3578b44e9fa8c0 (patch) | |
tree | 7d0f550e3cb171d2e44a5f9d5eac4653b96d3c6b | |
parent | 4d1c665e4fc4220dca7e7f0fb49a688fa0687418 (diff) | |
download | rpm-45e56320da54a8a20a55770b3a3578b44e9fa8c0.tar.gz |
Make hardlink test independent of rpm version string
A nice little WTF this one: changing the version string length affects
the manipulated offsets in the built package. The offsets were done with
the development time 4.16.90 version, but with eg 4.17.0-beta1 the
offsets are different and the test fails.
(cherry picked from commit 9db0b6fbc3636c8ac0e455fb15d717af5785e0fe)
-rw-r--r-- | tests/rpmi.at | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/rpmi.at b/tests/rpmi.at index 00a7aa294..dfa386e59 100644 --- a/tests/rpmi.at +++ b/tests/rpmi.at @@ -742,18 +742,20 @@ runroot rpmbuild \ -bb --quiet /data/SPECS/hlinktest.spec pkg="/build/RPMS/noarch/hlinktest-1.0-1.noarch.rpm" +# the offsets in the file depend on the version string length +vlen=$(runroot rpm -qp --qf "%{rpmversion}\n" "${pkg}" | wc -c) cp "${RPMTEST}/${pkg}" "${RPMTEST}/tmp/1.rpm" dd if=/dev/zero of="${RPMTEST}/tmp/1.rpm" \ - conv=notrunc bs=1 seek=8180 count=6 2> /dev/null + conv=notrunc bs=1 seek=$(expr 8172 + $vlen) count=6 2> /dev/null cp "${RPMTEST}/${pkg}" "${RPMTEST}/tmp/2.rpm" dd if=/dev/zero of="${RPMTEST}/tmp/2.rpm" \ - conv=notrunc bs=1 seek=8150 count=6 2> /dev/null + conv=notrunc bs=1 seek=$(expr 8142 + $vlen) count=6 2> /dev/null cp "${RPMTEST}/${pkg}" "${RPMTEST}/tmp/3.rpm" dd if=/dev/zero of="${RPMTEST}/tmp/3.rpm" \ - conv=notrunc bs=1 seek=8050 count=6 2> /dev/null + conv=notrunc bs=1 seek=$(expr 8042 + $vlen) count=6 2> /dev/null AT_CHECK([ RPMDB_INIT |