Skip to content

Commit 15a291e

Browse files
committed
MDEV-14978 fix client.client-env-variable test
* fix paths to work when installed and not only from the source dir * don't use a cnf file (no need to restart the server for this) * set MYSQL_HOST to a valid hostname when testing an invalid MARIADB_HOST * use invalid ip to have clients fail quickly and not waste time on resolving the invalid hostname followup for eedbb90
1 parent a812dba commit 15a291e

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

mysql-test/suite/client/client-env-variable.cnf

Lines changed: 0 additions & 5 deletions
This file was deleted.

mysql-test/suite/client/client-env-variable.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ USE test;
22
CREATE TABLE pet (name VARCHAR(20));
33
localhost
44
****************
5-
nonexistent-server
5+
255.255.255.255
66
Done
77
DROP TABLE pet;

mysql-test/suite/client/client-env-variable.test

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
# The environment variables for client programs have default options file
55
# They interfere with the MTR test so I am creating new variables for them
66

7-
--let MARIADB = $MYSQL_BINDIR/client//mariadb
8-
--let MARIADBADMIN = $MYSQL_BINDIR/client//mariadb-admin
9-
--let MARIADBBINLOG = $MYSQL_BINDIR/client//mariadb-binlog
10-
--let MARIADBCHECK = $MYSQL_BINDIR/client//mariadb-check
11-
--let MARIADBDUMP = $MYSQL_BINDIR/client//mariadb-dump
12-
--let MARIADBIMPORT = $MYSQL_BINDIR/client//mariadb-import
13-
--let MARIADBSHOW = $MYSQL_BINDIR/client//mariadb-show
14-
--let MARIADBSLAP = $MYSQL_BINDIR/client//mariadb-slap
7+
--let MARIADBADMIN = $EXE_MYSQL-admin
8+
--let MARIADBBINLOG = $EXE_MYSQL-binlog
9+
--let MARIADBCHECK = $EXE_MYSQL-check
10+
--let MARIADBDUMP = $EXE_MYSQL-dump
11+
--let MARIADBIMPORT = $EXE_MYSQL-import
12+
--let MARIADBSHOW = $EXE_MYSQL-show
13+
--let MARIADBSLAP = $EXE_MYSQL-slap
1514

1615
# Creating a table for the client programs
1716
USE test;
@@ -26,12 +25,12 @@ EOF
2625
# Options for client program
2726
--let $options = --user=root --port=$MASTER_MYPORT --disable-ssl-verify-server-cert
2827

29-
# Check to see if environment variable is defined
30-
# MARIADB_HOST is defined in client-env-variable.cnf
28+
# Positive test for client program with MARIADB_HOST
29+
--let MARIADB_HOST=localhost
30+
--let MYSQL_HOST=nonexistent-server
3131
--echo $MARIADB_HOST
3232

33-
# Positive test for client program with MARIADB_HOST
34-
--exec $MARIADB $options -e "SHOW DATABASES;" > /dev/null 2>&1
33+
--exec $EXE_MYSQL $options -e "SHOW DATABASES;" > /dev/null 2>&1
3534
--exec $MARIADBADMIN $options processlist > /dev/null 2>&1
3635
--exec $MARIADBBINLOG $options --read-from-remote-server master-bin.000001 > /dev/null 2>&1
3736
--exec $MARIADBCHECK $options -c --databases test > /dev/null 2>&1
@@ -42,15 +41,16 @@ EOF
4241

4342
#Set up negative test with invalid server
4443
--echo ****************
45-
--let MARIADB_HOST=nonexistent-server
44+
--let MARIADB_HOST=255.255.255.255
45+
--let MYSQL_HOST=localhost
4646
--echo $MARIADB_HOST
4747

4848
# Now run the same command as in the postive test case
4949
# Client programs are expected to fail since the server does not exist
5050
# Some client program fails with error 1 and some fails wtih error 2
5151

5252
--error 1
53-
--exec $MARIADB $options -e "SHOW DATABASES;" > /dev/null 2>&1
53+
--exec $EXE_MYSQL $options -e "SHOW DATABASES;" > /dev/null 2>&1
5454

5555
--error 1
5656
--exec $MARIADBADMIN $options processlist > /dev/null 2>&1
@@ -71,7 +71,7 @@ EOF
7171
--exec $MARIADBSLAP $options > /dev/null 2>&1
7272

7373
# Run the same command but with '--host' to verify command line input overrides env variable
74-
--exec $MARIADB $options --host localhost -e "SHOW DATABASES;" > /dev/null 2>&1
74+
--exec $EXE_MYSQL $options --host localhost -e "SHOW DATABASES;" > /dev/null 2>&1
7575
--exec $MARIADBADMIN $options --host localhost processlist > /dev/null 2>&1
7676
--exec $MARIADBBINLOG $options --host localhost --read-from-remote-server master-bin.000001 > /dev/null 2>&1
7777
--exec $MARIADBCHECK $options --host localhost -c --databases test > /dev/null 2>&1

0 commit comments

Comments
 (0)