diff options
author | Jonathan Reams <jbreams@mongodb.com> | 2017-03-27 16:20:40 -0400 |
---|---|---|
committer | Jonathan Reams <jbreams@mongodb.com> | 2017-04-07 11:26:35 -0400 |
commit | 8b57003ddf5c89774d49d02028c18deec284a3db (patch) | |
tree | e683be3bc8e6a2ad0ef4d3a191a14341503ba775 /jstests | |
parent | 5a5098ea760396adbb9b096bed6c30357ab3cacd (diff) | |
download | mongo-8b57003ddf5c89774d49d02028c18deec284a3db.tar.gz |
SERVER-27687 Fix cpuAddrSize detection on Linux for hostInfo command
(cherry picked from commit d2211f33b794dc638bec61a14ae9ba68e76b8946)
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/core/hostinfo.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/core/hostinfo.js b/jstests/core/hostinfo.js index 6d27b195f39..dbf1c95af72 100644 --- a/jstests/core/hostinfo.js +++ b/jstests/core/hostinfo.js @@ -31,3 +31,13 @@ if (hostinfo.os.type != "") { assert.neq(hostinfo.system.cpuArch, "" || null, "Missing CPU Architecture"); assert.neq(hostinfo.system.numaEnabled, "" || null, "Missing NUMA flag"); } + +var buildInfo = assert.commandWorked(db.runCommand({buildInfo: 1})); +if (buildInfo.buildEnvironment && buildInfo.buildEnvironment.target_arch) { + let targetArch = buildInfo.buildEnvironment.target_arch; + if (targetArch == "i386") + assert.eq(hostinfo.system.cpuAddrSize, 32); + else + assert.eq(hostinfo.system.cpuAddrSize, 64); + assert.eq(hostinfo.system.cpuAddrSize, buildInfo.bits); +} |