summaryrefslogtreecommitdiff
path: root/tests/mysql_client_test.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-08-26 12:38:31 +0200
committerSergei Golubchik <serg@mariadb.org>2017-08-26 12:38:31 +0200
commite20f1ec302ae2c8293eb4af054771d292b91e0b7 (patch)
tree80eb4942dc26e9270b3d4a7869a603bb1a497923 /tests/mysql_client_test.c
parentbb8e99fdc367a470c6195a2ae4c33f273fe55a25 (diff)
downloadmariadb-git-e20f1ec302ae2c8293eb4af054771d292b91e0b7.tar.gz
mysql_client_test: don't use 192.168.0.1
the test expects 192.168.0.1 not to resolve to anything. this is a fragile assumption. use 127.0.0.2 instead (which only marginally better)
Diffstat (limited to 'tests/mysql_client_test.c')
-rw-r--r--tests/mysql_client_test.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 03aaebaddbc..66c767cf238 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -19678,7 +19678,7 @@ static void test_proxy_header_tcp(const char *ipaddr, int port)
size_t header_lengths[2];
int i;
- // normalize IPv4-mapped IPv6 addresses, e.g ::ffff:192.168.0.1 to 192.168.0.1
+ // normalize IPv4-mapped IPv6 addresses, e.g ::ffff:127.0.0.2 to 127.0.0.2
const char *normalized_addr= strncmp(ipaddr, "::ffff:", 7)?ipaddr : ipaddr + 7;
memset(&v2_header, 0, sizeof(v2_header));
@@ -19736,6 +19736,7 @@ static void test_proxy_header_tcp(const char *ipaddr, int port)
mytest(result);
row = mysql_fetch_row(result);
addrlen = strlen(normalized_addr);
+ printf("%.*s %.*s\n", (int)addrlen, row[0], (int)addrlen, normalized_addr);
DIE_UNLESS(strncmp(row[0], normalized_addr, addrlen) == 0);
DIE_UNLESS(atoi(row[0] + addrlen+1) == port);
mysql_close(m);
@@ -19804,9 +19805,9 @@ static void test_proxy_header_ignore()
static void test_proxy_header()
{
- test_proxy_header_tcp("192.168.0.1",3333);
+ test_proxy_header_tcp("127.0.0.2",3333);
test_proxy_header_tcp("2001:db8:85a3::8a2e:370:7334",2222);
- test_proxy_header_tcp("::ffff:192.168.0.1",2222);
+ test_proxy_header_tcp("::ffff:127.0.0.2",2222);
test_proxy_header_localhost();
test_proxy_header_ignore();
}