Debian Codegraph @

mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test

raw
1
2 #
3 # Tests for the performance_schema host_cache.
4 #
5 # Simulate failures from DNS full round trip (FCRDNS):
6 # - IP --> HOST --> IP returns no match
7 # - reported in COUNT_FCRDNS_ERRORS
8
9 --source include/not_embedded.inc
10 --source include/have_debug.inc
11 --source include/have_perfschema.inc
12 --source include/have_hostname_cache.inc
13
14 # [Warning] Hostname 'santa.claus.ipv4.example.com' does not resolve to '192.0.2.4'.
15 # [Note] Hostname 'santa.claus.ipv4.example.com' has the following IP addresses:
16 # [Note] - 192.0.2.126
17 # [Note] - 192.0.2.127
18 call mtr.add_suppression("santa.claus.ipv4.example.com");
19
20 # Enforce a clean state
21 --source ../include/wait_for_pfs_thread_count.inc
22 --source ../include/hostcache_set_state.inc
23
24 create user 'root'@'192.0.2.4';
25 grant select on test.* to 'root'@'192.0.2.4';
26
27 connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
28 select "Con1 is alive";
29 select current_user();
30 disconnect con1;
31
32 --connection default
33 SET @saved_dbug = @@GLOBAL.debug_dbug;
34 set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
35
36 connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
37 select "Con2 is alive";
38 select current_user();
39 disconnect con2;
40
41 --connection default
42 --source ../include/hostcache_dump.inc
43
44 connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
45 select "Con3 is alive";
46 select current_user();
47 disconnect con3;
48
49 --connection default
50 --source ../include/hostcache_dump.inc
51
52 revoke select on test.* from 'root'@'192.0.2.4';
53 drop user 'root'@'192.0.2.4';
54
55 SET @@GLOBAL.debug_dbug = @saved_dbug;
56