Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Commit 5ff3778

Browse files
authored
Add hostname to Machine line on AIX (#141)
On AIX the `nodename` returned by `uname` is not always consistent with the hostname returned by `gethostname()`. Explicitly add the hostname to the `Machine:` line in the report on AIX as we already do for z/OS. PR-URL: #141 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
1 parent 86c64a5 commit 5ff3778

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/node_report.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,14 @@ static void PrintVersionInformation(std::ostream& out) {
458458
if (libc_version != NULL) {
459459
out << "(glibc: " << (*libc_version)() << ")" << std::endl;
460460
}
461+
#if defined(_AIX)
462+
char hn[256];
463+
memset(hn,0,sizeof(hn));
464+
gethostname(hn,sizeof(hn));
465+
out << "\nMachine: " << hn << " " << os_info.nodename << " " << os_info.machine << "\n";
466+
#else
461467
out << "\nMachine: " << os_info.nodename << " " << os_info.machine << "\n";
468+
#endif
462469
#endif
463470
}
464471
#endif

test/common.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@ exports.validateContent = function validateContent(data, t, options) {
132132
t.match(nodeReportSection,
133133
new RegExp('Machine: ' + os.hostname(), 'i'), // ignore case on Windows
134134
'Checking machine name in report header section contains os.hostname()');
135-
} else if (this.isAIX()) {
136-
t.match(nodeReportSection,
137-
new RegExp('Machine: ' + os.hostname().split('.')[0]), // truncate on AIX
138-
'Checking machine name in report header section contains os.hostname()');
139135
} else {
140136
t.match(nodeReportSection,
141137
new RegExp('Machine: ' + os.hostname()),

0 commit comments

Comments
 (0)