Skip to content

Commit 27975e1

Browse files
committed
WL#15524 Patch #17 Run more existing MTR tests with TLS
Test ndb_tls.clusterj runs ndb.clusterj with MGM TLS. Test ndb_tls.basic_mgm_tls runs ndbcluster.basic with MGM TLS. Test ndb_tls.basic_trp_tls runs ndbcluster.basic with data TLS. basic_trp_tls is the first test in suite ndb_tls to use a configuration that includes multi-transporters. Change-Id: I8df94a31598b363d56336098358ecf23b0b05219
1 parent c2b4cb4 commit 27975e1

9 files changed

+264
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!include suite/ndbcluster/my.cnf
2+
3+
[mysql_cluster]
4+
ndb-tls-search-path=$MYSQLTEST_VARDIR/std_data/ndb-tls/active
5+
6+
[cluster_config.ndb_mgmd.1.1]
7+
RequireTls=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
CREATE TABLE t1 (
2+
a int PRIMARY KEY,
3+
b varchar(255)
4+
) ENGINE = NDB;
5+
INSERT INTO t1 VALUES (1, "MySQL Server with NDB");
6+
INSERT INTO t1 (a, b) VALUES (11, "Barrier effect");
7+
INSERT INTO t1 (a, b) VALUES
8+
(12, "The third row"),
9+
(37, "And of course number 37");
10+
SELECT * FROM t1 WHERE a = 1;
11+
a b
12+
1 MySQL Server with NDB
13+
UPDATE t1 SET b = CONCAT(b, " test") WHERE a = 1;
14+
SELECT * FROM t1 WHERE a = 1;
15+
a b
16+
1 MySQL Server with NDB test
17+
REPLACE t1 (a, b) VALUES (12, "Another layer");
18+
SELECT * FROM t1 WHERE a = 12 ORDER BY a;
19+
a b
20+
12 Another layer
21+
DELETE FROM t1 WHERE a = 11;
22+
SELECT COUNT(*) FROM t1;
23+
COUNT(*)
24+
3
25+
SELECT b FROM t1 WHERE b LIKE "MySQL%";
26+
b
27+
MySQL Server with NDB test
28+
DELETE FROM t1 ORDER BY b DESC;
29+
DROP TABLE t1;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--source suite/ndbcluster/basic.test
2+
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
!include suite/ndbcluster/my.cnf
2+
3+
[cluster_config.ndbd.1.1]
4+
RequireTls=On
5+
6+
[cluster_config.ndbd.2.1]
7+
RequireTls=On
8+
9+
[mysql_cluster]
10+
ndb-tls-search-path=$MYSQLTEST_VARDIR/std_data/ndb-tls/active
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
CREATE TABLE t1 (
2+
a int PRIMARY KEY,
3+
b varchar(255)
4+
) ENGINE = NDB;
5+
INSERT INTO t1 VALUES (1, "MySQL Server with NDB");
6+
INSERT INTO t1 (a, b) VALUES (11, "Barrier effect");
7+
INSERT INTO t1 (a, b) VALUES
8+
(12, "The third row"),
9+
(37, "And of course number 37");
10+
SELECT * FROM t1 WHERE a = 1;
11+
a b
12+
1 MySQL Server with NDB
13+
UPDATE t1 SET b = CONCAT(b, " test") WHERE a = 1;
14+
SELECT * FROM t1 WHERE a = 1;
15+
a b
16+
1 MySQL Server with NDB test
17+
REPLACE t1 (a, b) VALUES (12, "Another layer");
18+
SELECT * FROM t1 WHERE a = 12 ORDER BY a;
19+
a b
20+
12 Another layer
21+
DELETE FROM t1 WHERE a = 11;
22+
SELECT COUNT(*) FROM t1;
23+
COUNT(*)
24+
3
25+
SELECT b FROM t1 WHERE b LIKE "MySQL%";
26+
b
27+
MySQL Server with NDB test
28+
DELETE FROM t1 ORDER BY b DESC;
29+
DROP TABLE t1;
30+
SELECT node_id, remote_node_id, encrypted from ndbinfo.transporters
31+
WHERE status = 'CONNECTED' ORDER BY node_id, remote_node_id;
32+
node_id remote_node_id encrypted
33+
1 2 1
34+
1 3 1
35+
1 49 1
36+
2 1 1
37+
2 3 1
38+
2 49 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
--source suite/ndbcluster/basic.test
2+
3+
## Expect 6 encrypted links
4+
#
5+
SELECT node_id, remote_node_id, encrypted from ndbinfo.transporters
6+
WHERE status = 'CONNECTED' ORDER BY node_id, remote_node_id;

mysql-test/suite/ndb_tls/clusterj.cnf

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
!include suite/ndb/t/clusterj.cnf
2+
3+
# Provide certificates for every node
4+
5+
[mysql_cluster]
6+
ndb-tls-search-path=$MYSQLTEST_VARDIR/std_data/ndb-tls/active
7+
8+
9+
# Require MGM TLS
10+
11+
[cluster_config.ndb_mgmd.1.1]
12+
RequireTls=true
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Found Connector/J JAR in MTR_CLASSPATH
2+
Found clusterj.jar
3+
Found clusterj_test jar
4+
Found ndbclient library
5+
Looking for a suitable Java...
6+
Found Java
7+
DROP TABLE a;
8+
DROP TABLE allprimitives;
9+
DROP TABLE autopkint;
10+
DROP TABLE autopkbigint;
11+
DROP TABLE autopkmediumint;
12+
DROP TABLE autopksmallint;
13+
DROP TABLE autopktinyint;
14+
DROP TABLE b0;
15+
DROP TABLE bigintegertypes;
16+
DROP TABLE binarypk;
17+
DROP TABLE binarytypes;
18+
DROP TABLE bittypes;
19+
DROP TABLE blobtypes;
20+
DROP TABLE bytepk;
21+
DROP TABLE bytestype;
22+
DROP TABLE cassandra_byte_array;
23+
DROP TABLE cassandra_string;
24+
DROP TABLE charsetbig5;
25+
DROP TABLE charsetlatin1;
26+
DROP TABLE charsetsjis;
27+
DROP TABLE charsetswedishutf8;
28+
DROP TABLE charsetutf8;
29+
DROP TABLE conversation_summary;
30+
DROP TABLE datetimetypes;
31+
DROP TABLE datetypes;
32+
DROP TABLE decimaltypes;
33+
DROP TABLE dn2id;
34+
DROP TABLE doubletypes;
35+
DROP TABLE dynamicstringpks;
36+
DROP TABLE floattypes;
37+
DROP TABLE hashpk;
38+
DROP TABLE hope;
39+
DROP TABLE longintstringfk;
40+
DROP TABLE longintstringix;
41+
DROP TABLE longintstringpk;
42+
DROP TABLE longlongstringfk;
43+
DROP TABLE longlongstringpk;
44+
DROP TABLE longvarbinarypk;
45+
DROP TABLE mediumintegertypes;
46+
DROP TABLE mediumunsignedtypes;
47+
DROP TABLE nullvalues;
48+
DROP TABLE shortpk;
49+
DROP TABLE stress;
50+
DROP TABLE stringtype;
51+
DROP TABLE t_basic;
52+
DROP TABLE timestamptypes;
53+
DROP TABLE timestamp2types;
54+
DROP TABLE timetypes;
55+
DROP TABLE twopk;
56+
DROP TABLE yeartypes;
57+
DROP TABLE localetypes;
58+
DROP TABLE stringtypes;
59+
DROP TABLE subscriber;
60+
DROP TABLE hashonlylongintstringpk;
61+
DROP TABLE varbinarypk;
62+
DROP TABLE varbinarytypes;
63+
DROP TABLE IF EXISTS test2.t_basic2;
64+
DROP DATABASE IF EXISTS test2;
+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Run the Cluster/J tests with strict MGM TLS enabled
2+
3+
--source include/have_ndb.inc
4+
--source include/not_asan.inc
5+
--source suite/ndb/include/have_connectorj.inc
6+
--source suite/ndb/include/have_clusterj.inc
7+
--let JAVA_MIN_REQUIRED_VERSION=1.8
8+
--source suite/ndb/include/have_java.inc
9+
10+
--append_file $MYSQLTEST_VARDIR/tmp/clusterj.properties
11+
com.mysql.clusterj.tls.path=$MYSQLTEST_VARDIR/std_data/ndb-tls/active
12+
com.mysql.clusterj.tls.strict=1
13+
EOF
14+
15+
--let SEP=:
16+
if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 1`)
17+
{
18+
--let SEP=;
19+
}
20+
21+
exec
22+
$MTR_JAVA -ea -Xcheck:jni
23+
-Dclusterj.properties=$MYSQLTEST_VARDIR/tmp/clusterj.properties
24+
-Djava.library.path=$NDBCLIENT_LIB_DIR
25+
-Duser.timezone=$TZ
26+
-Djava.io.tmpdir=$MYSQLTEST_VARDIR/tmp
27+
-classpath $CLUSTERJ_TEST_JAR$SEP$CLUSTERJ_JAR$SEP$MTR_CLASSPATH
28+
testsuite.clusterj.AllTests $CLUSTERJ_TEST_JAR
29+
> $MYSQLTEST_VARDIR/tmp/clusterj_test.log ;
30+
31+
# If the test has succeeded, clean up the properties file and the log file
32+
--remove_file $MYSQLTEST_VARDIR/tmp/clusterj.properties
33+
--remove_file $MYSQLTEST_VARDIR/tmp/clusterj_test.log
34+
35+
# Clean up tables used in the JUnit tests.
36+
DROP TABLE a;
37+
DROP TABLE allprimitives;
38+
DROP TABLE autopkint;
39+
DROP TABLE autopkbigint;
40+
DROP TABLE autopkmediumint;
41+
DROP TABLE autopksmallint;
42+
DROP TABLE autopktinyint;
43+
DROP TABLE b0;
44+
DROP TABLE bigintegertypes;
45+
DROP TABLE binarypk;
46+
DROP TABLE binarytypes;
47+
DROP TABLE bittypes;
48+
DROP TABLE blobtypes;
49+
DROP TABLE bytepk;
50+
DROP TABLE bytestype;
51+
DROP TABLE cassandra_byte_array;
52+
DROP TABLE cassandra_string;
53+
DROP TABLE charsetbig5;
54+
DROP TABLE charsetlatin1;
55+
DROP TABLE charsetsjis;
56+
DROP TABLE charsetswedishutf8;
57+
DROP TABLE charsetutf8;
58+
DROP TABLE conversation_summary;
59+
DROP TABLE datetimetypes;
60+
DROP TABLE datetypes;
61+
DROP TABLE decimaltypes;
62+
DROP TABLE dn2id;
63+
DROP TABLE doubletypes;
64+
DROP TABLE dynamicstringpks;
65+
DROP TABLE floattypes;
66+
DROP TABLE hashpk;
67+
DROP TABLE hope;
68+
DROP TABLE longintstringfk;
69+
DROP TABLE longintstringix;
70+
DROP TABLE longintstringpk;
71+
DROP TABLE longlongstringfk;
72+
DROP TABLE longlongstringpk;
73+
DROP TABLE longvarbinarypk;
74+
DROP TABLE mediumintegertypes;
75+
DROP TABLE mediumunsignedtypes;
76+
DROP TABLE nullvalues;
77+
DROP TABLE shortpk;
78+
DROP TABLE stress;
79+
DROP TABLE stringtype;
80+
DROP TABLE t_basic;
81+
DROP TABLE timestamptypes;
82+
DROP TABLE timestamp2types;
83+
DROP TABLE timetypes;
84+
DROP TABLE twopk;
85+
DROP TABLE yeartypes;
86+
DROP TABLE localetypes;
87+
DROP TABLE stringtypes;
88+
DROP TABLE subscriber;
89+
DROP TABLE hashonlylongintstringpk;
90+
DROP TABLE varbinarypk;
91+
DROP TABLE varbinarytypes;
92+
DROP TABLE IF EXISTS test2.t_basic2;
93+
DROP DATABASE IF EXISTS test2;
94+
95+

0 commit comments

Comments
 (0)