summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Cooper <adam.cooper@mongodb.com>2019-12-30 14:30:39 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-11 22:27:43 +0000
commite329dd322df4a226b143031c99b5f943d3a9be4a (patch)
treee158df9adc7021a44ea79dec699c200f5f5068a7
parent1ad8c6db331f7cfff9c8c6b0a1dae6b75c5bae93 (diff)
downloadmongo-e329dd322df4a226b143031c99b5f943d3a9be4a.tar.gz
SERVER-45043 Fix SSL test failure on Ubuntu
(cherry picked from commit ede1a05cab81580150ac19579b09bd154af9f7f1)
-rw-r--r--jstests/ssl/libs/ssl_helpers.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/jstests/ssl/libs/ssl_helpers.js b/jstests/ssl/libs/ssl_helpers.js
index 2be2c627f19..e1d795fe283 100644
--- a/jstests/ssl/libs/ssl_helpers.js
+++ b/jstests/ssl/libs/ssl_helpers.js
@@ -281,9 +281,15 @@ function isDebian10() {
// Debian 10 disables TLS 1.0 and TLS 1.1 as part their default crypto policy
// We skip tests on Debian 10 that require these versions as a result.
try {
- // on non-debian systems, cat will throw here (file doesn't exist)
- const debianVersion = cat("/etc/debian_version").toLowerCase();
- return debianVersion.includes("10") || debianVersion.includes("buster");
+ // this file exists on systemd-based systems, necessary to avoid mischaracterizing debian
+ // derivatives as stock debian
+ const releaseFile = cat("/etc/os-release").toLowerCase();
+ const prettyName = releaseFile.split('\n').find(function(line) {
+ return line.startsWith("pretty_name");
+ });
+ return prettyName.includes("debian") &&
+ (prettyName.includes("10") || prettyName.includes("buster") ||
+ prettyName.includes("bullseye"));
} catch (e) {
return false;
}