diff options
author | Ben Caimano <ben.caimano@mongodb.com> | 2019-11-08 22:19:39 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-11-08 22:19:39 +0000 |
commit | ccbad450aec9759834dafe2bd5f8fb0032704335 (patch) | |
tree | ffe8960ce3856bcf2a00b92b62902a8e150b7c5b /jstests/ssl | |
parent | 34cc781e42eabe52c409ad930e87ed785c0db9d5 (diff) | |
download | mongo-ccbad450aec9759834dafe2bd5f8fb0032704335.tar.gz |
SERVER-42961 Fix Split Horizon testing on SLES
Diffstat (limited to 'jstests/ssl')
-rw-r--r-- | jstests/ssl/repl_ssl_split_horizon.js | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/jstests/ssl/repl_ssl_split_horizon.js b/jstests/ssl/repl_ssl_split_horizon.js index 7b70b60e605..19e2648df6f 100644 --- a/jstests/ssl/repl_ssl_split_horizon.js +++ b/jstests/ssl/repl_ssl_split_horizon.js @@ -31,27 +31,43 @@ if (rc != 0) { // Output is of the format: 'glibc x.yz' var output = rawMongoProgramOutput(); + clearRawMongoProgramOutput(); + + jsTestLog(`getconf GNU_LIBC_VERSION\n${output}`); + var fields = output.split(" "); var glibc_version = parseFloat(fields[2]); + var rc = runProgram("cat", "/etc/os-release"); + if (rc != 0) { + jsTestLog( + `Failed the check for /etc/os-release, we are probably not on a *nix. Skipping this test.`); + return; + } + + var osRelease = rawMongoProgramOutput(); + clearRawMongoProgramOutput(); + + jsTestLog(`cat /etc/os-release\n${osRelease}`); + + var suzeMatch = osRelease.match(/ID="?sles"?/); + // Fail this test if we are on GLIBC >= 2.2 and HOSTALIASES still doesn't work if (glibc_version < 2.2) { jsTestLog( `HOSTALIASES does not seem to work as expected on this system. GLIBC version is ${glibc_version}, skipping this test.`); return; - } else { - var verCheck = runProgram("grep", "/etc/os-release", "\"SUSE Linux Enterprise Server\""); - if (verCheck == 0) { - jsTestLog( - `HOSTALIASES does not seem to work as expected but we detected SLES. GLIBC - version is ${glibc_version}, skipping this test.`); - return; - } - assert(false, - `HOSTALIASES does not seem to work as expected on this system. GLIBC - version is ${glibc_version}`); + } else if (suzeMatch) { + jsTestLog( + `HOSTALIASES does not seem to work as expected but we detected SLES. GLIBC + version is ${glibc_version}, skipping this test.`); + return; } + + assert(false, + `HOSTALIASES does not seem to work as expected on this system. GLIBC + version is ${glibc_version}`); } var replTest = new ReplSetTest({ |