Enable test suite for DRCP
This commit is contained in:
parent
4d05ad311a
commit
8544904f65
|
@ -110,6 +110,8 @@ Set the following environment variables to provide credentials for the test suit
|
||||||
|
|
||||||
* `NODE_ORACLEDB_QA`. This boolean environment variable serves as the toggle switch of certain tests. Some tests, such as `callTimeout.js`, use hard-coded variables as assertion condition. The test results may be inconsistent in different network situations.
|
* `NODE_ORACLEDB_QA`. This boolean environment variable serves as the toggle switch of certain tests. Some tests, such as `callTimeout.js`, use hard-coded variables as assertion condition. The test results may be inconsistent in different network situations.
|
||||||
|
|
||||||
|
* `NODE_ORACLEDB_DRCP` provides an option for skipping test run when DRCP is enabled. Setting this environment variable to `true` will skip certain test case run due to DRCP restrictions.
|
||||||
|
|
||||||
Note: the test suite requires the schema to have these privileges: CREATE TABLE, CREATE SESSION,
|
Note: the test suite requires the schema to have these privileges: CREATE TABLE, CREATE SESSION,
|
||||||
CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER, and CREATE TYPE.
|
CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER, and CREATE TYPE.
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,6 @@ const dbConfig = require('./dbconfig.js');
|
||||||
const testsUtil = require('./testsUtil.js');
|
const testsUtil = require('./testsUtil.js');
|
||||||
|
|
||||||
describe('161. changePassword.js', function() {
|
describe('161. changePassword.js', function() {
|
||||||
|
|
||||||
let DBA_config;
|
let DBA_config;
|
||||||
let dbaConn;
|
let dbaConn;
|
||||||
let sql;
|
let sql;
|
||||||
|
@ -54,7 +53,7 @@ describe('161. changePassword.js', function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
before (async function() {
|
before (async function() {
|
||||||
if (!dbConfig.test.DBA_PRIVILEGE) this.skip();
|
if (dbConfig.test.drcp || !dbConfig.test.DBA_PRIVILEGE) this.skip();
|
||||||
sql = "BEGIN \n" +
|
sql = "BEGIN \n" +
|
||||||
" DECLARE \n" +
|
" DECLARE \n" +
|
||||||
" e_user_missing EXCEPTION; \n" +
|
" e_user_missing EXCEPTION; \n" +
|
||||||
|
@ -79,7 +78,7 @@ describe('161. changePassword.js', function() {
|
||||||
}); // before
|
}); // before
|
||||||
|
|
||||||
after(async function() {
|
after(async function() {
|
||||||
if (dbConfig.test.DBA_PRIVILEGE) {
|
if (dbConfig.test.DBA_PRIVILEGE && !dbConfig.test.drcp) {
|
||||||
sql = "DROP USER " + myUser + " CASCADE";
|
sql = "DROP USER " + myUser + " CASCADE";
|
||||||
dbaConn = await oracledb.getConnection(DBA_config);
|
dbaConn = await oracledb.getConnection(DBA_config);
|
||||||
await dbaConn.execute(sql);
|
await dbaConn.execute(sql);
|
||||||
|
@ -439,10 +438,13 @@ describe('161. changePassword.js', function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
before (async function() {
|
before (async function() {
|
||||||
if (!dbConfig.test.DBA_PRIVILEGE) this.skip();
|
isRunnable = (!dbConfig.test.drcp && dbConfig.test.DBA_PRIVILEGE);
|
||||||
|
if (isRunnable) {
|
||||||
isRunnable = await testsUtil.checkPrerequisites(2300000000, 2300000000);
|
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
||||||
if (!isRunnable) this.skip();
|
}
|
||||||
|
if (!isRunnable) {
|
||||||
|
this.skip();
|
||||||
|
}
|
||||||
}); // before
|
}); // before
|
||||||
|
|
||||||
after(async function() {
|
after(async function() {
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
* 1. Edit the credential section of this file.
|
* 1. Edit the credential section of this file.
|
||||||
* 2. Set these environment variables:
|
* 2. Set these environment variables:
|
||||||
* NODE_ORACLEDB_USER, NODE_ORACLEDB_PASSWORD, NODE_ORACLEDB_CONNECTIONSTRING,
|
* NODE_ORACLEDB_USER, NODE_ORACLEDB_PASSWORD, NODE_ORACLEDB_CONNECTIONSTRING,
|
||||||
* NODE_ORACLEDB_EXTERNALAUTH,
|
* NODE_ORACLEDB_EXTERNALAUTH, NODE_ORACLEDB_DRCP,
|
||||||
* NODE_ORACLEDB_DBA_PRIVILEGE,
|
* NODE_ORACLEDB_DBA_PRIVILEGE,
|
||||||
* NODE_ORACLEDB_DBA_USER, NODE_ORACLEDB_DBA_PASSWORD
|
* NODE_ORACLEDB_DBA_USER, NODE_ORACLEDB_DBA_PASSWORD
|
||||||
*
|
*
|
||||||
|
@ -47,7 +47,8 @@ const config = {
|
||||||
printDebugMsg: false,
|
printDebugMsg: false,
|
||||||
mode: 'thin',
|
mode: 'thin',
|
||||||
instantClientPath: '',
|
instantClientPath: '',
|
||||||
isCloudService: false
|
isCloudService: false,
|
||||||
|
drcp: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -66,6 +67,10 @@ if (process.env.NODE_ORACLEDB_EXTERNALAUTH) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.env.NODE_ORACLEDB_DRCP) {
|
||||||
|
config.test.drcp = (process.env.NODE_ORACLEDB_DRCP.toLowerCase() === 'true');
|
||||||
|
}
|
||||||
|
|
||||||
if (!config.test.externalAuth) {
|
if (!config.test.externalAuth) {
|
||||||
if (process.env.NODE_ORACLEDB_USER) {
|
if (process.env.NODE_ORACLEDB_USER) {
|
||||||
config.user = process.env.NODE_ORACLEDB_USER;
|
config.user = process.env.NODE_ORACLEDB_USER;
|
||||||
|
|
|
@ -753,6 +753,9 @@ describe('272. jsonDualityView1.js', function() {
|
||||||
)`;
|
)`;
|
||||||
|
|
||||||
before(async function() {
|
before(async function() {
|
||||||
|
if (dbConfig.test.drcp) {
|
||||||
|
this.skip();
|
||||||
|
}
|
||||||
const credential = {
|
const credential = {
|
||||||
user : dbConfig.test.DBA_user,
|
user : dbConfig.test.DBA_user,
|
||||||
password : dbConfig.test.DBA_password,
|
password : dbConfig.test.DBA_password,
|
||||||
|
@ -768,12 +771,16 @@ describe('272. jsonDualityView1.js', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function() {
|
after(async function() {
|
||||||
|
if (dbConfig.test.drcp) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await connection.execute(`drop user njs_test1 cascade`);
|
await connection.execute(`drop user njs_test1 cascade`);
|
||||||
await connection.execute(`drop user njs_test2 cascade`);
|
await connection.execute(`drop user njs_test2 cascade`);
|
||||||
await connection.close();
|
await connection.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('272.3.11.1 Query with test1 user', async function() {
|
it('272.3.11.1 Query with test1 user', async function() {
|
||||||
|
|
||||||
const studentView = `CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW student_ov
|
const studentView = `CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW student_ov
|
||||||
AS
|
AS
|
||||||
student @insert @update @delete
|
student @insert @update @delete
|
||||||
|
|
|
@ -43,7 +43,10 @@ describe('273. jsonDualityView2.js', function() {
|
||||||
let isRunnable = false;
|
let isRunnable = false;
|
||||||
|
|
||||||
before(async function() {
|
before(async function() {
|
||||||
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
isRunnable = (!dbConfig.test.drcp);
|
||||||
|
if (isRunnable) {
|
||||||
|
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
||||||
|
}
|
||||||
if (!isRunnable) {
|
if (!isRunnable) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
|
@ -326,6 +329,9 @@ describe('273. jsonDualityView2.js', function() {
|
||||||
`constraint pk_student primary key (stuid) \n` +
|
`constraint pk_student primary key (stuid) \n` +
|
||||||
`)`;
|
`)`;
|
||||||
before(async function() {
|
before(async function() {
|
||||||
|
if (dbConfig.test.drcp) {
|
||||||
|
this.skip();
|
||||||
|
}
|
||||||
await dbaConn.execute(createUser1);
|
await dbaConn.execute(createUser1);
|
||||||
await dbaConn.execute(grantPriv1);
|
await dbaConn.execute(grantPriv1);
|
||||||
await dbaConn.execute(createUser2);
|
await dbaConn.execute(createUser2);
|
||||||
|
@ -342,6 +348,9 @@ describe('273. jsonDualityView2.js', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function() {
|
after(async function() {
|
||||||
|
if (dbConfig.test.drcp) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await conn2.close();
|
await conn2.close();
|
||||||
await conn1.close();
|
await conn1.close();
|
||||||
await dbaConn.execute(`drop user njs_test1 cascade`);
|
await dbaConn.execute(`drop user njs_test1 cascade`);
|
||||||
|
@ -471,12 +480,18 @@ describe('273. jsonDualityView2.js', function() {
|
||||||
let conn = null;
|
let conn = null;
|
||||||
const pwd = testsUtil.generateRandomPassword();
|
const pwd = testsUtil.generateRandomPassword();
|
||||||
before(async function() {
|
before(async function() {
|
||||||
|
if (dbConfig.test.drcp) {
|
||||||
|
this.skip();
|
||||||
|
}
|
||||||
await dbaConn.execute(`create user njs_testuser1 identified by ${pwd}`);
|
await dbaConn.execute(`create user njs_testuser1 identified by ${pwd}`);
|
||||||
await dbaConn.execute(`grant create session,resource,create table,unlimited tablespace to njs_testuser1`);
|
await dbaConn.execute(`grant create session,resource,create table,unlimited tablespace to njs_testuser1`);
|
||||||
await dbaConn.execute(`grant execute on sys.dbms_redact to njs_testuser1`);
|
await dbaConn.execute(`grant execute on sys.dbms_redact to njs_testuser1`);
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function() {
|
after(async function() {
|
||||||
|
if (dbConfig.test.drcp) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await dbaConn.execute(`drop user njs_testuser1 cascade`);
|
await dbaConn.execute(`drop user njs_testuser1 cascade`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,10 @@ describe('274 jsonDualityView3.js', function() {
|
||||||
let isRunnable = false;
|
let isRunnable = false;
|
||||||
const pwd = testsUtil.generateRandomPassword();
|
const pwd = testsUtil.generateRandomPassword();
|
||||||
before(async function() {
|
before(async function() {
|
||||||
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
isRunnable = (!dbConfig.test.drcp);
|
||||||
|
if (isRunnable) {
|
||||||
|
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
||||||
|
}
|
||||||
if (!isRunnable) {
|
if (!isRunnable) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,11 @@ describe('275. jsonDualityView4.js', function() {
|
||||||
let isRunnable = false;
|
let isRunnable = false;
|
||||||
|
|
||||||
before(async function() {
|
before(async function() {
|
||||||
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
isRunnable = (!dbConfig.test.drcp);
|
||||||
if (!(isRunnable && dbConfig.test.DBA_PRIVILEGE)) {
|
if (isRunnable) {
|
||||||
|
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
||||||
|
}
|
||||||
|
if (!isRunnable) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,11 @@ describe('276. jsonDualityView5.js', function() {
|
||||||
let isRunnable = false;
|
let isRunnable = false;
|
||||||
|
|
||||||
before(async function() {
|
before(async function() {
|
||||||
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
isRunnable = (!dbConfig.test.drcp);
|
||||||
if (!(isRunnable && dbConfig.test.DBA_PRIVILEGE)) {
|
if (isRunnable) {
|
||||||
|
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
||||||
|
}
|
||||||
|
if (!isRunnable) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ describe('277. jsonDualityView6.js', function() {
|
||||||
|
|
||||||
before(async function() {
|
before(async function() {
|
||||||
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
|
||||||
if (!(isRunnable && dbConfig.test.DBA_PRIVILEGE)) {
|
if (dbConfig.test.drcp || !(isRunnable && dbConfig.test.DBA_PRIVILEGE)) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ describe('277. jsonDualityView6.js', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
after(async function() {
|
after(async function() {
|
||||||
if (!isRunnable) return;
|
if (dbConfig.test.drcp || !isRunnable) return;
|
||||||
await connection.close();
|
await connection.close();
|
||||||
|
|
||||||
await dbaConn.execute(`drop user njs_jsonDv6 cascade`);
|
await dbaConn.execute(`drop user njs_jsonDv6 cascade`);
|
||||||
|
|
|
@ -68,7 +68,7 @@ describe('248. userName.js', function() {
|
||||||
describe('248.1 test with different size of username', () => {
|
describe('248.1 test with different size of username', () => {
|
||||||
|
|
||||||
it('248.1.1 test with username size 30', async function() {
|
it('248.1.1 test with username size 30', async function() {
|
||||||
if (!dbConfig.test.DBA_PRIVILEGE) this.skip();
|
if (dbConfig.test.drcp || !dbConfig.test.DBA_PRIVILEGE) this.skip();
|
||||||
|
|
||||||
const userSchema = assist.createSchemaString(30);
|
const userSchema = assist.createSchemaString(30);
|
||||||
const password = testsUtil.generateRandomPassword();
|
const password = testsUtil.generateRandomPassword();
|
||||||
|
@ -90,7 +90,7 @@ describe('248. userName.js', function() {
|
||||||
|
|
||||||
it('248.1.2 test with username size 100', async function() {
|
it('248.1.2 test with username size 100', async function() {
|
||||||
let runnable = await testsUtil.isLongUserNameRunnable();
|
let runnable = await testsUtil.isLongUserNameRunnable();
|
||||||
if (!runnable) {
|
if (dbConfig.test.drcp || !runnable) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ describe('248. userName.js', function() {
|
||||||
|
|
||||||
it('248.1.3 test with username size 128', async function() {
|
it('248.1.3 test with username size 128', async function() {
|
||||||
let runnable = await testsUtil.isLongUserNameRunnable();
|
let runnable = await testsUtil.isLongUserNameRunnable();
|
||||||
if (!runnable) {
|
if (dbConfig.test.drcp || !runnable) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ describe('248. userName.js', function() {
|
||||||
describe('248.2 test with different size of user', () => {
|
describe('248.2 test with different size of user', () => {
|
||||||
|
|
||||||
it('248.2.1 test with user size 30', async function() {
|
it('248.2.1 test with user size 30', async function() {
|
||||||
if (!dbConfig.test.DBA_PRIVILEGE) this.skip();
|
if (dbConfig.test.drcp || !dbConfig.test.DBA_PRIVILEGE) this.skip();
|
||||||
|
|
||||||
const userSchema = assist.createSchemaString(30);
|
const userSchema = assist.createSchemaString(30);
|
||||||
const password = testsUtil.generateRandomPassword();
|
const password = testsUtil.generateRandomPassword();
|
||||||
|
@ -267,7 +267,7 @@ describe('248. userName.js', function() {
|
||||||
|
|
||||||
it('248.2.2 test with user size 100', async function() {
|
it('248.2.2 test with user size 100', async function() {
|
||||||
let runnable = await testsUtil.isLongUserNameRunnable();
|
let runnable = await testsUtil.isLongUserNameRunnable();
|
||||||
if (!runnable) {
|
if (dbConfig.test.drcp || !runnable) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ describe('248. userName.js', function() {
|
||||||
|
|
||||||
it('248.2.3 test with user size 128', async function() {
|
it('248.2.3 test with user size 128', async function() {
|
||||||
let runnable = await testsUtil.isLongUserNameRunnable();
|
let runnable = await testsUtil.isLongUserNameRunnable();
|
||||||
if (!runnable) {
|
if (dbConfig.test.drcp || !runnable) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue