pacemaker/0005-Test-cts-don-t-use-readlink-e-unless-supported.patch
Jan Pokorný 436eae4e1e
2.0.0-0.1.rc2 - Update for new upstream tarball
... for release candidate: Pacemaker-2.0.0-rc2,
  for full details, see included ChangeLog file or
  https://github.com/ClusterLabs/pacemaker/releases/tag/Pacemaker-2.0.0-rc2

Adapt spec file more akin to upstream version including:
. out-of-tree change from 1.1.18-2 build got subsumed (508ad52e7)
. %%{_sysconfdir}/pacemaker path got properly owned
  (-cli package; f6e3ab98d)
. -libs package started to properly declare Requires(pre): shadow-utils
  (293fcc1e8 + b3d49d210)
. some build conditionals and dependencies dropped for no longer
  (snmp, esmtp; f24bdc6f2 and 1f7374884, respectively) or never
  being relevant (~bison, byacc, flex; 61aef8af4)
. some dependencies were constrained with new or higher lower bounds:
  corosync needs to be of version 2+ unconditionally (ccd58fe29),
  ditto some others components (~GLib, 1ac2e7cbb), plus both 2 and 3
  versions of Python are now (comprehensively for the auxiliary
  functionality where used) supported upstream with the latter being
  a better fit (453355f8f)
. package descriptions got to reflect the drop of legacy low-level
  cluster infrastructures (55ab749bf)

Adapt spec file akin to current packaging guidelines including:
. drop some redundant/futile expressions (defattr, "-n %%{name}-libs"
  instead of plain "libs", "timezone hack"), add some notes for future
. make -cts and -doc packages noarch (former enabled with 088a5e7d4)
. simplify "systemd_requires" macro invocation, and relax it to
  "systemd_ordering" for -remote package where possible so as not
  to drag systemd into a lightweight system setup (e.g. container)
  needlessly
. adjust, in a compatible way, common ldconfig invocation with
  post{,un} scriptlets
  (https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets)
. drop some more unuseful conditionals (upstart_job)

Apply some regression fixes on top as patches (PR #1457, #1459)

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2018-04-13 18:27:39 +02:00

105 lines
3.2 KiB
Diff

From 25698bc62f4b1bf14112012809e1c70b57a44cd9 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Mon, 9 Apr 2018 14:05:55 -0500
Subject: [PATCH 05/17] Test: cts: don't use readlink -e unless supported
BSD readlink doesn't
---
cts/cts-cli.in | 9 ++++++++-
cts/cts-pengine.in | 32 ++++++++++++++------------------
cts/cts-regression.in | 9 ++++++++-
3 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/cts/cts-cli.in b/cts/cts-cli.in
index e62e5e2fe..365f4b10b 100755
--- a/cts/cts-cli.in
+++ b/cts/cts-cli.in
@@ -15,8 +15,15 @@ Options:
-v, --valgrind Run all commands under valgrind
-s Save actual output as expected output"
+# If readlink supports -e (i.e. GNU), use it
+readlink -e / >/dev/null 2>/dev/null
+if [ $? -eq 0 ]; then
+ test_home="$(dirname $(readlink -e $0))"
+else
+ test_home="$(dirname $0)"
+fi
+
: ${shadow=cts-cli}
-test_home="$(dirname $(readlink -e $0))"
shadow_dir=$(mktemp -td cts-cli.shadow.XXXXXXXXXX)
num_errors=0
num_passed=0
diff --git a/cts/cts-pengine.in b/cts/cts-pengine.in
index 905354db2..fb0952580 100644
--- a/cts/cts-pengine.in
+++ b/cts/cts-pengine.in
@@ -1,21 +1,10 @@
#!@BASH_PATH@
-
- # Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public
- # License as published by the Free Software Foundation; either
- # version 2 of the License, or (at your option) any later version.
- #
- # This software is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- # General Public License for more details.
- #
- # You should have received a copy of the GNU General Public
- # License along with this library; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- #
+#
+# Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
+#
+# This source code is licensed under the GNU General Public License version 2
+# or later (GPLv2+) WITHOUT ANY WARRANTY.
+#
USAGE_TEXT="Usage: cts-pengine [<options>]
Options:
@@ -34,7 +23,14 @@ SBINDIR="@sbindir@"
BUILDDIR="@abs_top_builddir@"
CRM_SCHEMA_DIRECTORY="@CRM_SCHEMA_DIRECTORY@"
-test_home=$(dirname $(readlink -e $0))
+# If readlink supports -e (i.e. GNU), use it
+readlink -e / >/dev/null 2>/dev/null
+if [ $? -eq 0 ]; then
+ test_home="$(dirname $(readlink -e $0))"
+else
+ test_home="$(dirname $0)"
+fi
+
io_dir="$test_home/pengine"
failed="$test_home/.regression.failed.diff"
test_binary=
diff --git a/cts/cts-regression.in b/cts/cts-regression.in
index 6c9931f79..e89394b69 100755
--- a/cts/cts-regression.in
+++ b/cts/cts-regression.in
@@ -24,7 +24,14 @@ Tests (default tests are 'pengine cli lrmd'):
fencing Fencing daemon
all Synonym for 'pengine cli lrmd fencing'"
-test_home="$(dirname $(readlink -e $0))"
+# If readlink supports -e (i.e. GNU), use it
+readlink -e / >/dev/null 2>/dev/null
+if [ $? -eq 0 ]; then
+ test_home="$(dirname $(readlink -e $0))"
+else
+ test_home="$(dirname $0)"
+fi
+
valgrind=""
verbose=""
tests=""
--
2.17.0