Skip to content

Commit f4b2773

Browse files
committed
Merge 8.0 -> trunk
2 parents 36393de + 0a1837e commit f4b2773

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

mysql-test/lib/My/ConfigFactory.pm

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,15 @@ sub fix_rsa_public_key {
292292
return "$std_data/rsa_public_key.pem";
293293
}
294294

295+
sub fix_bind_address {
296+
my ($self) = @_;
297+
if ($self->{ARGS}->{bind_local}) {
298+
# Listen only for incoming network connections from local machine
299+
return "localhost";
300+
}
301+
return undef;
302+
}
303+
295304
# Rules to run for each mysqld in the config
296305
# - some rules depend on each other and thus need to be run
297306
# in the order listed here
@@ -308,9 +317,11 @@ my @mysqld_rules = (
308317
{ 'datadir' => \&fix_datadir },
309318
{ 'port' => \&fix_port },
310319
{ 'admin-port' => \&fix_admin_port },
320+
{ 'bind-address' => \&fix_bind_address },
311321
{ 'general_log' => \&fix_general_log },
312322
{ 'general_log_file' => \&fix_log },
313323
{ 'loose-mysqlx-port' => \&fix_x_port },
324+
{ 'loose-mysqlx-bind-address' => \&fix_bind_address },
314325
{ 'loose-mysqlx-socket' => \&fix_x_socket },
315326
{ 'loose-mysqlx-ssl' => \&fix_ssl_disabled },
316327
{ 'loose-mysqlx-ssl-ca' => "" },
@@ -754,7 +765,9 @@ sub new_config {
754765
@ndb_mgmd_rules);
755766

756767
$self->run_section_rules($config, 'ndb_mgmd.',
757-
({ 'cluster-config-suffix' => \&fix_cluster_config_suffix },));
768+
({ 'cluster-config-suffix' => \&fix_cluster_config_suffix },
769+
{ 'bind-address' => \&fix_bind_address },
770+
));
758771

759772
$self->run_section_rules($config, 'cluster_config.ndbd', @ndbd_rules);
760773

mysql-test/mysql-test-run.pl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
my $opt_mysqlx_baseport = $ENV{'MYSQLXPLUGIN_PORT'} || "auto";
150150
my $opt_port_base = $ENV{'MTR_PORT_BASE'} || "auto";
151151
my $opt_port_exclude = $ENV{'MTR_PORT_EXCLUDE'} || "none";
152+
my $opt_bind_local = $ENV{'MTR_BIND_LOCAL'};
152153
my $opt_reorder = 1;
153154
my $opt_retry = 3;
154155
my $opt_retry_failure = env_or_val(MTR_RETRY_FAILURE => 2);
@@ -1677,6 +1678,7 @@ sub command_line_setup {
16771678
'mysqlx-port=i' => \$opt_mysqlx_baseport,
16781679
'port-base|mtr-port-base=i' => \$opt_port_base,
16791680
'port-exclude|mtr-port-exclude=s' => \$opt_port_exclude,
1681+
'bind-local!' => \$opt_bind_local,
16801682

16811683
# Test case authoring
16821684
'check-testcases!' => \$opt_check_testcases,
@@ -4218,6 +4220,7 @@ sub default_mysqld {
42184220
baseport => 0,
42194221
user => $opt_user,
42204222
password => '',
4223+
bind_local => $opt_bind_local
42214224
});
42224225

42234226
my $mysqld = $config->group('mysqld.1') or
@@ -5018,6 +5021,7 @@ ($)
50185021
tmpdir => $opt_tmpdir,
50195022
user => $opt_user,
50205023
vardir => $opt_vardir,
5024+
bind_local => $opt_bind_local
50215025
});
50225026

50235027
# Write the new my.cnf
@@ -7951,6 +7955,11 @@ ($)
79517955
and is not "auto", it overrides build-thread.
79527956
port-exclude=#-# Specify the range of ports to exclude when searching
79537957
for available port ranges to use.
7958+
bind-local Bind listening ports to localhost, i.e disallow
7959+
"incoming network connections" which might cause
7960+
firewall to display annoying popups.
7961+
Can be set in environment variable MTR_BIND_LOCAL=1.
7962+
To disable use --no-bind-local.
79547963
79557964
Options for test case authoring
79567965

0 commit comments

Comments
 (0)