From 3f3fa594062b3748cf9de6488345eafdbb55dfc4 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Mon, 9 May 2016 12:25:52 -0400 Subject: [PATCH] Account for rpm behavior difference on directories This commit modifies the packaging tests to account for the fact that rpm behaves differently with respect to preserving directories marked as "CONFIG | NOREPLACE" on older versions versus newer versions. Older versions will leave the directory as-is while newer versions will append the suffix ".rpmsave" to the directory name. Relates #18216 --- .../test/resources/packaging/scripts/40_rpm_package.bats | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qa/vagrant/src/test/resources/packaging/scripts/40_rpm_package.bats b/qa/vagrant/src/test/resources/packaging/scripts/40_rpm_package.bats index 0d3170cafeb..0555f55cba6 100644 --- a/qa/vagrant/src/test/resources/packaging/scripts/40_rpm_package.bats +++ b/qa/vagrant/src/test/resources/packaging/scripts/40_rpm_package.bats @@ -161,8 +161,10 @@ setup() { assert_file_exist "/etc/elasticsearch/jvm.options.rpmsave" assert_file_not_exist "/etc/elasticsearch/logging.yml" assert_file_exist "/etc/elasticsearch/logging.yml.rpmsave" - assert_file_exist "/etc/elasticsearch/scripts.rpmsave" - assert_file_exist "/etc/elasticsearch/scripts.rpmsave/script" + # older versions of rpm behave differently and preserve the + # directory but do not append the ".rpmsave" suffix + test -e "/etc/elasticsearch/scripts" || test -e "/etc/elasticsearch/scripts.rpmsave" + test -e "/etc/elasticsearch/scripts/script" || test -e "/etc/elasticsearch/scripts.rpmsave/script" assert_file_not_exist "/etc/init.d/elasticsearch" assert_file_not_exist "/usr/lib/systemd/system/elasticsearch.service"