~jan-kneschke/mysql-proxy/packet-tracking-assertions

« back to all changes in this revision

Viewing changes to tests/suite/base/t/failover.test

  • Committer: Kay Roepke
  • Author(s): Jan Kneschke
  • Date: 2008-01-23 22:00:28 UTC
  • Revision ID: kay@mysql.com-20080123220028-hq2xqb69apa75fnx
first round on mysql-shell based on the proxy code

this is mostly a verification if the proxy-code is flexible enough to handle 
all three scenarios of: client, server and forwarding (proxy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#  $%BEGINLICENSE%$
2
 
#  Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
3
 
4
 
#  This program is free software; you can redistribute it and/or
5
 
#  modify it under the terms of the GNU General Public License as
6
 
#  published by the Free Software Foundation; version 2 of the
7
 
#  License.
8
 
9
 
#  This program is distributed in the hope that it will be useful,
10
 
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
 
#  GNU General Public License for more details.
13
 
14
 
#  You should have received a copy of the GNU General Public License
15
 
#  along with this program; if not, write to the Free Software
16
 
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17
 
#  02110-1301  USA
18
 
19
 
#  $%ENDLICENSE%$
20
 
# this test 
21
 
# * starts two backends
22
 
# * sets and verifies IDs in the backends
23
 
# * reconnects and verifies that the IDs are still in place
24
 
# * stop the first backend and verifies that queries against it fail
25
 
# * checks that new connects end up on the second backend
26
 
 
27
 
connect (conn1,127.0.0.1,root,,,$PROXY_PORT);
28
 
connect (conn2,127.0.0.1,root,,,$PROXY_PORT);
29
 
 
30
 
connection conn1;
31
 
SET ID 1;
32
 
GET ID;
33
 
 
34
 
connection conn2;
35
 
SET ID 2;
36
 
GET ID;
37
 
 
38
 
disconnect conn1;
39
 
 
40
 
# check if we end up on the the right backend
41
 
connect (conn1,127.0.0.1,root,,,$PROXY_PORT);
42
 
connection conn1;
43
 
GET ID;
44
 
 
45
 
# now kill the backend
46
 
--error 2013
47
 
KILL BACKEND;
48
 
 
49
 
# ... and this should fail now as the backend is gone
50
 
GET ID;
51
 
 
52
 
disconnect conn1;
53
 
 
54
 
connection conn2;
55
 
GET ID;
56
 
 
57
 
connect (conn1,127.0.0.1,root,,,$PROXY_PORT);
58
 
GET ID;
59
 
disconnect conn1;
60