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.
diff --git a/mail_error_log.t b/mail_error_log.t
index 013de3d..a563802 100644
--- a/mail_error_log.t
+++ b/mail_error_log.t
@@ -13,6 +13,7 @@
 use Test::More;
 
 use IO::Select;
+use Sys::Hostname;
 
 BEGIN { use FindBin; chdir($FindBin::Bin); }
 
@@ -233,8 +234,7 @@
 	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");
diff --git a/stream_access_log.t b/stream_access_log.t
index a354da6..e6e683e 100644
--- a/stream_access_log.t
+++ b/stream_access_log.t
@@ -12,6 +12,8 @@
 
 use Test::More;
 
+use Sys::Hostname;
+
 BEGIN { use FindBin; chdir($FindBin::Bin); }
 
 use lib 'lib';
@@ -158,7 +160,7 @@
 ok($t->read_file('complex.log'), 'if with complex value');
 ok($t->read_file('varlog_3.log'), 'variable in file');
 
-chomp(my $hostname = lc `hostname`);
+my $hostname = lc hostname();
 like($t->read_file('vars.log'), qr/^\d+:[\d.]+:$hostname:\d+$/, 'log vars');
 is($t->read_file('addr.log'),
 	"$escaped:$lhost:$lport:127.0.0.1:$dport:127.0.0.1:$uport\n",
diff --git a/stream_error_log.t b/stream_error_log.t
index d5df787..4d3d9f0 100644
--- a/stream_error_log.t
+++ b/stream_error_log.t
@@ -13,6 +13,7 @@
 use Test::More;
 
 use IO::Select;
+use Sys::Hostname;
 
 BEGIN { use FindBin; chdir($FindBin::Bin); }
 
@@ -241,8 +242,7 @@
 	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");
diff --git a/stream_variables.t b/stream_variables.t
index 2696c35..322df9f 100644
--- a/stream_variables.t
+++ b/stream_variables.t
@@ -12,6 +12,8 @@
 
 use Test::More;
 
+use Sys::Hostname;
+
 BEGIN { use FindBin; chdir($FindBin::Bin); }
 
 use lib 'lib';
@@ -80,7 +82,7 @@
 
 ###############################################################################
 
-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');
 
diff --git a/syslog.t b/syslog.t
index b2ab805..bbf4683 100644
--- a/syslog.t
+++ b/syslog.t
@@ -13,6 +13,7 @@
 use Test::More;
 
 use IO::Select;
+use Sys::Hostname;
 
 BEGIN { use FindBin; chdir($FindBin::Bin); }
 
@@ -321,8 +322,7 @@
 	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");