polardbxengine/mysql-test/suite/memcached/t/check_ports.test

29 lines
976 B
Plaintext

perl;
use File::Basename;
my $dirname=dirname($ENV{MYSQLTEST_FILE});
my @all_options=<$dirname/*-master.opt>;
my %ports_in_use;
foreach my $option_name (@all_options)
{
my $filename = basename($option_name);
my ($port_suffix) = $filename =~ /(\d+)/;
if(!$port_suffix){
die("The $option_name is missing a port number hint in the name, see README.");
}
my $expected_port = 11000 + $port_suffix;
open(F, $option_name);
if(grep{/p$expected_port/} <F>){
}else{
die("Could not find p$expected_port in $option_name, see README.");
}
close(F);
if(exists($ports_in_use{$expected_port})){
die("Port $expected_port is used by more than one test: $option_name and $ports_in_use{$expected_port}, see README.");
}
$ports_in_use{$expected_port} = $option_name;
}
EOF
--disable_query_log
SELECT "All -master.opt files have proper port number hint in their name" as result;
--enable_query_log