| Server IP : 45.40.142.9 / Your IP : 216.73.216.250 Web Server : Apache System : Linux s45-40-142-9.secureserver.net 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : bayspec ( 506) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/mysql-test/include/ |
Upload File : |
# ==== Purpose ====
#
# Check if nc/netcat utility is available
# The variable $nc contains name of utility
# (nc or netcat)
#
# ==== Usage ====
#
# --source include/have_util_nc.inc
# ...
# --exec $nc some options
#
disable_result_log;
disable_query_log;
--let $nc=
--let $_outfile= $MYSQLTEST_VARDIR/tmp/have_nc.tmp
# find nc
--error 0,1,127
--exec nc -h > $_outfile 2>&1
--eval SET @content = LOAD_FILE('$_outfile')
--remove_file $_outfile
if (`SELECT LOCATE('usage', @content) > 0`) {
--let $nc= nc
SET @content="";
}
# find netcat
if (`SELECT '$nc' = ''`) {
--error 0,1,127
--exec netcat -h > $_outfile 2>&1
--eval SET @content = LOAD_FILE('$_outfile')
--remove_file $_outfile
}
if (`SELECT LOCATE('usage', @content) > 0`) {
--let $nc= netcat
SET @content="";
}
# Skip the test case if utility not found
if (`SELECT '$nc' = ''`) {
--skip nc/netcat not found
}
enable_query_log;
enable_result_log;