Mercurial > hg > nginx-tests
diff stream_error_log.t @ 1600:b61e820caa83
Tests: using Sys::Hostname to get hostname in a portable way.
The hostname utility is not defined by POSIX and not available
by default on some modern Linux distro's (Arch, Fedora).
Reported by Geert Hendrickx.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 12 Oct 2020 18:13:07 +0100 |
parents | e4974af3fb12 |
children | f3ba4c74de31 |
line wrap: on
line diff
--- a/stream_error_log.t +++ b/stream_error_log.t @@ -13,6 +13,7 @@ use strict; use Test::More; use IO::Select; +use Sys::Hostname; BEGIN { use FindBin; chdir($FindBin::Bin); } @@ -241,8 +242,7 @@ SKIP: { ok($sec < 60, "$desc valid seconds"); ok(defined($host), "$desc has host"); - chomp(my $hostname = lc `hostname`); - is($host , $hostname, "$desc valid host"); + is($host, lc(hostname()), "$desc valid host"); ok(defined($tag), "$desc has tag"); like($tag, qr'\w+', "$desc valid tag");