summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Egesdahl <ryan.egesdahl@mongodb.com>2021-04-02 10:58:12 -0700
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-10 16:12:03 +0000
commitd9378a53b590fe3de9d458efd8787830e93c744b (patch)
treedb6f2231179cc1cdb652651c0a367f713156e61b
parent34daafcc5b30860a901dcdd076293111539592e3 (diff)
downloadmongo-d9378a53b590fe3de9d458efd8787830e93c744b.tar.gz
SERVER-55460 Fix RPM packaging and package testing for SLES 12
Some versions of SLES apparently don't define the _sharedstatedir RPM macro properly, leaving it at the old-time UNIX /usr/com default. This was causing the server to fail to start on such platforms because the expected data directory at /var/lib/mongodb was missing. The macro is now statically defined on SLES to /var like it should be on any modern Linux distribution. Also fixed were paths to systemd unit files in package testing and the fact that we weren't installing the tools-extra package, which we should be doing if only to verify that the script indeed continues to fail expectedly on the platform. (cherry picked from commit 649dc04027667b30155be39be39a880cb0b8743a) (cherry picked from commit 31a75fa034ab929b5c0ef834fde92c845041b036)
-rw-r--r--buildscripts/package_test/recipes/install_mongodb.rb6
-rw-r--r--buildscripts/package_test/test/recipes/service/install_mongodb_spec.rb16
-rw-r--r--rpm/mongodb-enterprise-init.spec8
-rw-r--r--rpm/mongodb-enterprise-unstable-init.spec8
-rw-r--r--rpm/mongodb-enterprise-unstable.spec8
-rw-r--r--rpm/mongodb-enterprise.spec8
-rw-r--r--rpm/mongodb-org-init.spec8
-rw-r--r--rpm/mongodb-org-unstable-init.spec8
-rw-r--r--rpm/mongodb-org-unstable.spec8
-rw-r--r--rpm/mongodb-org.spec8
10 files changed, 84 insertions, 2 deletions
diff --git a/buildscripts/package_test/recipes/install_mongodb.rb b/buildscripts/package_test/recipes/install_mongodb.rb
index 2cd70bfcbd3..82e6bc460e8 100644
--- a/buildscripts/package_test/recipes/install_mongodb.rb
+++ b/buildscripts/package_test/recipes/install_mongodb.rb
@@ -124,6 +124,12 @@ if platform_family? 'suse'
cwd homedir
end
+ execute 'install mongo tools' do
+ command 'zypper --no-gpg-checks -n install `find . -name "*tools-extra*.rpm"`'
+ live_stream true
+ cwd homedir
+ end
+
execute 'install mongo' do
command 'zypper --no-gpg-checks -n install `find . -name "*shell*.rpm"`'
cwd homedir
diff --git a/buildscripts/package_test/test/recipes/service/install_mongodb_spec.rb b/buildscripts/package_test/test/recipes/service/install_mongodb_spec.rb
index ad85bb3ee76..7c563d5f3af 100644
--- a/buildscripts/package_test/test/recipes/service/install_mongodb_spec.rb
+++ b/buildscripts/package_test/test/recipes/service/install_mongodb_spec.rb
@@ -68,6 +68,11 @@ if os[:arch] == 'x86_64'
its('exit_status') { should eq 0 }
its('stderr') { should eq '' }
end
+ elsif os[:name] == 'suse'
+ describe command("install_compass") do
+ its('exit_status') { should eq 1 }
+ its('stderr') { should match /You are using an unsupported platform/ }
+ end
else
describe command("install_compass") do
its('exit_status') { should eq 1 }
@@ -77,7 +82,7 @@ if os[:arch] == 'x86_64'
else
describe command("install_compass") do
its('exit_status') { should eq 1 }
- its('stderr') { should match /Sorry, MongoDB Compass is only supported on 64-bit Intel platforms./ }
+ its('stderr') { should match /Sorry, MongoDB Compass is only supported on 64-bit Intel platforms/ }
end
end
@@ -130,7 +135,14 @@ if sysvinit
end
if systemd
- describe file('/lib/systemd/system/mongod.service') do
+ unit_file_prefix = ''
+ if os[:name] == 'suse'
+ # Putting systemd unit files in /usr, which may be a separate partition
+ # and therefore not available during isolated startups, is bad practice.
+ # But it's what SUSE has chosen to do, so we have to deal with it.
+ unit_file_prefix = '/usr'
+ end
+ describe file("#{unit_file_prefix}/lib/systemd/system/mongod.service") do
it { should be_file }
end
end
diff --git a/rpm/mongodb-enterprise-init.spec b/rpm/mongodb-enterprise-init.spec
index 5b8c97b33d0..976b5115e84 100644
--- a/rpm/mongodb-enterprise-init.spec
+++ b/rpm/mongodb-enterprise-init.spec
@@ -1,3 +1,11 @@
+%if 0%{?suse_version}
+%define _sharedstatedir %{_localstatedir}/lib
+%endif
+
+%if ! %{defined _docdir}
+%define _docdir %{_datadir}/doc
+%endif
+
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
diff --git a/rpm/mongodb-enterprise-unstable-init.spec b/rpm/mongodb-enterprise-unstable-init.spec
index ba22a326303..c90e0fb9cc3 100644
--- a/rpm/mongodb-enterprise-unstable-init.spec
+++ b/rpm/mongodb-enterprise-unstable-init.spec
@@ -1,3 +1,11 @@
+%if 0%{?suse_version}
+%define _sharedstatedir %{_localstatedir}/lib
+%endif
+
+%if ! %{defined _docdir}
+%define _docdir %{_datadir}/doc
+%endif
+
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
diff --git a/rpm/mongodb-enterprise-unstable.spec b/rpm/mongodb-enterprise-unstable.spec
index cb37d0ac60b..7879c87ee46 100644
--- a/rpm/mongodb-enterprise-unstable.spec
+++ b/rpm/mongodb-enterprise-unstable.spec
@@ -1,3 +1,11 @@
+%if 0%{?suse_version}
+%define _sharedstatedir %{_localstatedir}/lib
+%endif
+
+%if ! %{defined _docdir}
+%define _docdir %{_datadir}/doc
+%endif
+
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
diff --git a/rpm/mongodb-enterprise.spec b/rpm/mongodb-enterprise.spec
index 6870368617e..94f95c4d44b 100644
--- a/rpm/mongodb-enterprise.spec
+++ b/rpm/mongodb-enterprise.spec
@@ -1,3 +1,11 @@
+%if 0%{?suse_version}
+%define _sharedstatedir %{_localstatedir}/lib
+%endif
+
+%if ! %{defined _docdir}
+%define _docdir %{_datadir}/doc
+%endif
+
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
diff --git a/rpm/mongodb-org-init.spec b/rpm/mongodb-org-init.spec
index c6d8eacbb40..324f7475a06 100644
--- a/rpm/mongodb-org-init.spec
+++ b/rpm/mongodb-org-init.spec
@@ -1,3 +1,11 @@
+%if 0%{?suse_version}
+%define _sharedstatedir %{_localstatedir}/lib
+%endif
+
+%if ! %{defined _docdir}
+%define _docdir %{_datadir}/doc
+%endif
+
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
diff --git a/rpm/mongodb-org-unstable-init.spec b/rpm/mongodb-org-unstable-init.spec
index 11cbf944ad3..86726d6f432 100644
--- a/rpm/mongodb-org-unstable-init.spec
+++ b/rpm/mongodb-org-unstable-init.spec
@@ -1,3 +1,11 @@
+%if 0%{?suse_version}
+%define _sharedstatedir %{_localstatedir}/lib
+%endif
+
+%if ! %{defined _docdir}
+%define _docdir %{_datadir}/doc
+%endif
+
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
diff --git a/rpm/mongodb-org-unstable.spec b/rpm/mongodb-org-unstable.spec
index 420dec61911..f1d9e92a497 100644
--- a/rpm/mongodb-org-unstable.spec
+++ b/rpm/mongodb-org-unstable.spec
@@ -1,3 +1,11 @@
+%if 0%{?suse_version}
+%define _sharedstatedir %{_localstatedir}/lib
+%endif
+
+%if ! %{defined _docdir}
+%define _docdir %{_datadir}/doc
+%endif
+
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
diff --git a/rpm/mongodb-org.spec b/rpm/mongodb-org.spec
index 9b3fd301414..04e30c9e306 100644
--- a/rpm/mongodb-org.spec
+++ b/rpm/mongodb-org.spec
@@ -1,3 +1,11 @@
+%if 0%{?suse_version}
+%define _sharedstatedir %{_localstatedir}/lib
+%endif
+
+%if ! %{defined _docdir}
+%define _docdir %{_datadir}/doc
+%endif
+
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif