Debian Codegraph @

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

raw
1
2 #
3 # Tests for the performance_schema host_cache.
4 #
5 # Simulate success from DNS full round trip (FCRDNS):
6 # - IP --> HOST --> IP returns the client IP
7 # - completes host validation in HOST_VALIDATED
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] IP address '192.0.2.4' could not be resolved:
15 # no reverse address mapping.
16 call mtr.add_suppression("192.0.2.4");
17
18 # Enforce a clean state
19 --source ../include/wait_for_pfs_thread_count.inc
20 --source ../include/hostcache_set_state.inc
21
22 create user 'root'@'santa.claus.ipv4.example.com';
23 grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
24
25 connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
26 select "Con1 is alive";
27 select current_user();
28 disconnect con1;
29
30 --connection default
31 SET @saved_dbug = @@GLOBAL.debug_dbug;
32 set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
33
34 connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
35 select "Con2 is alive";
36 select current_user();
37 disconnect con2;
38
39 --connection default
40 --source ../include/hostcache_dump.inc
41
42 connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
43 select "Con3 is alive";
44 select current_user();
45 disconnect con3;
46
47 --connection default
48 --source ../include/hostcache_dump.inc
49
50 revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
51 drop user 'root'@'santa.claus.ipv4.example.com';
52
53 SET @@GLOBAL.debug_dbug = @saved_dbug;
54