~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/suite/rpl/t/rpl_ssl1.test

  • Committer: Monty Taylor
  • Date: 2009-02-21 03:33:30 UTC
  • mfrom: (895 drizzle)
  • mto: (896.2.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 898.
  • Revision ID: mordred@inaugust.com-20090221033330-v110f94679dej04p
MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
source include/have_ssl_communication.inc;
2
 
source include/master-slave.inc;
3
 
 
4
 
# We don't test all types of ssl auth params here since it's a bit hard 
5
 
# until problems with OpenSSL 0.9.7 are unresolved
6
 
 
7
 
# creating replication user for whom ssl auth is required
8
 
# preparing playground
9
 
connection master;
10
 
grant replication slave on *.* to replssl@localhost require ssl;
11
 
create table t1 (t int);
12
 
save_master_pos;
13
 
 
14
 
#syncing with master
15
 
connection slave;
16
 
sync_with_master;
17
 
 
18
 
#trying to use this user without ssl
19
 
stop slave;
20
 
change master to master_user='replssl',master_password='';
21
 
start slave;
22
 
 
23
 
#showing that replication don't work
24
 
connection master;
25
 
insert into t1 values (1);
26
 
#reasonable timeout for changes to propagate to slave
27
 
let $wait_condition= SELECT COUNT(*) = 1 FROM t1;
28
 
source include/wait_condition.inc;
29
 
connection slave;
30
 
select * from t1;
31
 
 
32
 
#showing that replication could work with ssl params
33
 
stop slave;
34
 
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR
35
 
eval change master to master_ssl=1 , master_ssl_ca ='$DRIZZLE_TEST_DIR/std_data/cacert.pem', master_ssl_cert='$DRIZZLE_TEST_DIR/std_data/client-cert.pem', master_ssl_key='$DRIZZLE_TEST_DIR/std_data/client-key.pem';
36
 
start slave;
37
 
 
38
 
#avoiding unneeded sleeps
39
 
connection master;
40
 
save_master_pos;
41
 
connection slave;
42
 
sync_with_master;
43
 
 
44
 
#checking that replication is ok
45
 
select * from t1;
46
 
 
47
 
#checking show slave status
48
 
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
49
 
--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
50
 
query_vertical show slave status;
51
 
 
52
 
#checking if replication works without ssl also performing clean up
53
 
stop slave;
54
 
change master to master_user='root',master_password='', master_ssl=0;
55
 
start slave;
56
 
connection master;
57
 
drop user replssl@localhost;
58
 
drop table t1;
59
 
save_master_pos;
60
 
connection slave;
61
 
sync_with_master;
62
 
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
63
 
--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
64
 
query_vertical show slave status;
65
 
 
66
 
# End of 4.1 tests
67
 
 
68
 
# Start replication with ssl_verify_server_cert turned on
69
 
connection slave;
70
 
stop slave;
71
 
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR
72
 
eval change master to
73
 
 master_host="localhost",
74
 
 master_ssl=1 ,
75
 
 master_ssl_ca ='$DRIZZLE_TEST_DIR/std_data/cacert.pem',
76
 
 master_ssl_cert='$DRIZZLE_TEST_DIR/std_data/client-cert.pem',
77
 
 master_ssl_key='$DRIZZLE_TEST_DIR/std_data/client-key.pem',
78
 
 master_ssl_verify_server_cert=1;
79
 
start slave;
80
 
 
81
 
connection master;
82
 
create table t1 (t int);
83
 
insert into t1 values (1);
84
 
 
85
 
sync_slave_with_master;
86
 
 
87
 
echo on slave;
88
 
#checking that replication is ok
89
 
select * from t1;
90
 
 
91
 
#checking show slave status
92
 
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
93
 
--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
94
 
query_vertical show slave status;
95
 
 
96
 
connection master;
97
 
drop table t1;
98
 
sync_slave_with_master;