diff stream_variables.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 766bcbb632ee
children f3ba4c74de31
line wrap: on
line diff
--- a/stream_variables.t
+++ b/stream_variables.t
@@ -12,6 +12,8 @@ use strict;
 
 use Test::More;
 
+use Sys::Hostname;
+
 BEGIN { use FindBin; chdir($FindBin::Bin); }
 
 use lib 'lib';
@@ -80,7 +82,7 @@ EOF
 
 ###############################################################################
 
-chomp(my $hostname = lc `hostname`);
+my $hostname = lc hostname();
 like(stream('127.0.0.1:' . port(8080))->read(),
 	qr/^\d+:[\d.]+:$hostname:\d+:0$/, 'vars');