thermald/tests/version.sh
Benjamin Berg 3f00b7a868 Accept 2.5 as package version
Thermald release tarballs do not generally contain the .0, while the
printed releaes may or may not contain a .0. i.e. we can get a mismatch.
Accpet a missing .0 on either the RPM (/tarball) version or the output
version.

Related: #2040081
2022-07-25 20:47:50 +02:00

18 lines
553 B
Bash
Executable File

#!/bin/bash
#
# Thermald is a systemd unit file that requires specific hardware and
# firmware. As such it is difficult to test in an automated fashion.
# fail the whole test if any of the command pipelines below fails
set -ex
rpmversion=$(rpm -q --queryformat '%{VERSION}' thermald)
version=$(thermald --version)
if [ "$version" != "$rpmversion" -a "$version.0" != "$rpmversion" -a "$version" != "$rpmversion.0" ]; then
echo "reported thermald version (${version}) does not match rpm version (${rpmversion})"
exit 1
fi
# if we get here, it's OK