Skip to content

Commit 16e108c

Browse files
committed
[misc] test correction
1 parent e384af5 commit 16e108c

File tree

2 files changed

+1
-128
lines changed

2 files changed

+1
-128
lines changed

test/integration/test-cluster.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ describe('cluster', function () {
958958
done(new Error('must have thrown an error !'));
959959
} else {
960960
expect(err.message).to.have.string(
961-
"No Connection available for 'PoolNode-0'. Last connection error was: (conn=-1, no: 45028, SQLState: HY000) retrieve connection from pool timeout after"
961+
"No Connection available for 'PoolNode-0'. Last connection error was: (conn:-1, no: 45028, SQLState: HY000) retrieve connection from pool timeout after"
962962
);
963963
conn.end();
964964
cluster.end();

test/integration/test-ssl.js

Lines changed: 0 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -135,89 +135,6 @@ describe('ssl', function () {
135135
await conn.end();
136136
});
137137

138-
it('self signed certificate server before ephemeral', async function () {
139-
if (isMaxscale()) this.skip();
140-
if (!sslEnable) this.skip();
141-
142-
// test will work either because server certificate chain is trusted (not don in tests)
143-
// or using mariadb ephemeral certificate validation
144-
if (
145-
!shareConn.info.isMariaDB() ||
146-
(shareConn.info.hasMinVersion(11, 4, 0) && !shareConn.info.hasMinVersion(23, 0, 0))
147-
)
148-
this.skip();
149-
try {
150-
await base.createConnection({ ssl: true, port: sslPort });
151-
throw new Error('must have thrown error');
152-
} catch (e) {
153-
assert.equal(e.errno, errors.ER_SELF_SIGNED);
154-
}
155-
});
156-
157-
it('self signed certificate forcing no password', async function () {
158-
if (isMaxscale()) this.skip();
159-
if (!sslEnable) this.skip();
160-
161-
// test will work either because server certificate chain is trusted (not done in tests)
162-
// or using mariadb ephemeral certificate validation
163-
if (shareConn.info.isMariaDB() && shareConn.info.hasMinVersion(11, 4, 0) && !shareConn.info.hasMinVersion(23, 0, 0))
164-
this.skip();
165-
if (Conf.baseConfig.password) this.skip();
166-
try {
167-
await base.createConnection({ ssl: true, port: sslPort });
168-
throw new Error('must have thrown error');
169-
} catch (e) {
170-
assert.equal(e.errno, errors.ER_SELF_SIGNED);
171-
}
172-
});
173-
174-
it('self signed certificate forcing with password ssl:true', async function () {
175-
if (isMaxscale()) this.skip();
176-
if (!sslEnable) this.skip();
177-
178-
// test will work either because server certificate chain is trusted (not don in tests)
179-
// or using mariadb ephemeral certificate validation
180-
if (
181-
!shareConn.info.isMariaDB() ||
182-
!shareConn.info.hasMinVersion(11, 4, 0) ||
183-
shareConn.info.hasMinVersion(23, 0, 0)
184-
)
185-
this.skip();
186-
if (!Conf.baseConfig.password) this.skip();
187-
const conn = await base.createConnection({
188-
user: 'sslTestUser',
189-
password: 'ytoKS@led5',
190-
ssl: true,
191-
port: sslPort
192-
});
193-
await validConnection(conn);
194-
await conn.end();
195-
});
196-
197-
it('self signed certificate forcing with password ssl: {rejectUnauthorized: true}', async function () {
198-
if (isMaxscale()) this.skip();
199-
if (!sslEnable) this.skip();
200-
201-
// test will work either because server certificate chain is trusted (not done in tests)
202-
// or using mariadb ephemeral certificate validation
203-
if (
204-
!shareConn.info.isMariaDB() ||
205-
!shareConn.info.hasMinVersion(11, 4, 0) ||
206-
shareConn.info.hasMinVersion(23, 0, 0)
207-
)
208-
this.skip();
209-
if (!Conf.baseConfig.password) this.skip();
210-
211-
const conn = await base.createConnection({
212-
user: 'sslTestUser',
213-
password: 'ytoKS@led5',
214-
ssl: { rejectUnauthorized: true },
215-
port: sslPort
216-
});
217-
await validConnection(conn);
218-
await conn.end();
219-
});
220-
221138
it('ensure connection use SSL ', async function () {
222139
if (isMaxscale()) this.skip();
223140
if (!sslEnable) this.skip();
@@ -232,19 +149,6 @@ describe('ssl', function () {
232149
conn.end();
233150
});
234151

235-
it('ensure connection use NOT SSL ', async function () {
236-
if (isMaxscale()) this.skip();
237-
if (!sslEnable) this.skip();
238-
if (!base.utf8Collation()) this.skip();
239-
const conn = await base.createConnection({
240-
user: 'nosslTestUser',
241-
password: 'ytoKS@led5',
242-
allowPublicKeyRetrieval: true
243-
});
244-
await validConnection(conn);
245-
conn.end();
246-
});
247-
248152
it('SSLv3 disable', async function () {
249153
if (!sslEnable) this.skip();
250154
try {
@@ -580,37 +484,6 @@ describe('ssl', function () {
580484
conn.query('DROP USER ChangeUser' + getHostSuffix());
581485
conn.end();
582486
});
583-
584-
it('ssl dialog authentication plugin', async function () {
585-
if (!process.env.TEST_PAM_USER) this.skip();
586-
if (isMaxscale()) this.skip();
587-
if (!shareConn.info.isMariaDB()) this.skip();
588-
if (!sslEnable) this.skip();
589-
590-
this.timeout(10000);
591-
try {
592-
await shareConn.query("INSTALL PLUGIN pam SONAME 'auth_pam'");
593-
} catch (error) {}
594-
try {
595-
await shareConn.query("DROP USER IF EXISTS '" + process.env.TEST_PAM_USER + "'" + getHostSuffix());
596-
} catch (error) {}
597-
598-
await shareConn.query(
599-
"CREATE USER '" + process.env.TEST_PAM_USER + "'" + getHostSuffix() + " IDENTIFIED VIA pam USING 'mariadb'"
600-
);
601-
await shareConn.query(
602-
"GRANT SELECT ON *.* TO '" + process.env.TEST_PAM_USER + "'" + getHostSuffix() + ' IDENTIFIED VIA pam'
603-
);
604-
await shareConn.query('FLUSH PRIVILEGES');
605-
606-
const conn = await base.createConnection({
607-
user: process.env.TEST_PAM_USER,
608-
password: process.env.TEST_PAM_PWD,
609-
ssl: { rejectUnauthorized: false },
610-
port: sslPort
611-
});
612-
await conn.end();
613-
});
614487
});
615488

616489
function checkProtocol(conn, protocol) {

0 commit comments

Comments
 (0)