Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8cc14a

Browse files
authored
Merge pull request #893 from utPLSQL/feature/introduce_testing_with_accurate_grants
Feature/introduce testing with accurate grants
2 parents 2381ee8 + b56d27a commit c8cc14a

141 files changed

Lines changed: 4514 additions & 3879 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ env:
2525
- UT3_USER_PASSWORD=ut3
2626
- UT3_TESTER=ut3_tester
2727
- UT3_TESTER_PASSWORD=ut3
28+
- UT3_TESTER_HELPER=ut3_tester_helper
29+
- UT3_TESTER_HELPER_PASSWORD=ut3
2830
- UT3_TABLESPACE=users
2931
# Environment for building a release
3032
- CURRENT_BRANCH=${TRAVIS_BRANCH}
@@ -45,7 +47,7 @@ env:
4547
#utPLSQL released version directory
4648
- UTPLSQL_DIR="utPLSQL_latest_release"
4749
- SELFTESTING_BRANCH=${TRAVIS_BRANCH}
48-
- UTPLSQL_CLI_VERSION="3.1.0"
50+
- UTPLSQL_CLI_VERSION="3.1.6"
4951
# Maven
5052
- MAVEN_HOME=/usr/local/maven
5153
- MAVEN_CFG=$HOME/.m2

.travis/install.sh

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ SQL
4747
4848
alter session set plsql_optimize_level=0;
4949
@install.sql $UT3_OWNER
50+
@create_synonyms_and_grants_for_public.sql $UT3_OWNER
5051
SQL
5152

5253
fi
@@ -60,27 +61,32 @@ grant select any dictionary to $UT3_OWNER;
6061
grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER;
6162
SQL
6263

63-
#Create user that will own the tests
64+
#Create user that will own the tests that are relevant to internal framework
6465
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
6566
set feedback off
6667
@create_utplsql_owner.sql $UT3_TESTER $UT3_TESTER_PASSWORD $UT3_TABLESPACE
67-
68-
--needed for testing distributed transactions
69-
grant create public database link to $UT3_TESTER;
70-
grant drop public database link to $UT3_TESTER;
71-
set feedback on
72-
--Needed for testing coverage outside of main UT3 schema.
73-
grant create any procedure, drop any procedure, execute any procedure, create any type, drop any type, execute any type, under any type, select any table, update any table, insert any table, delete any table, create any table, drop any table, alter any table, select any dictionary to $UT3_TESTER;
74-
revoke execute on dbms_crypto from $UT3_TESTER;
75-
grant create job to $UT3_TESTER;
7668
exit
7769
SQL
7870

79-
#Create additional UT3$USER# to test for special characters
71+
#Create additional UT3$USER# to test for special characters and front end API testing
8072
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
8173
set feedback off
8274
@create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE
83-
--Grant UT3 framework to UT3$USER#
75+
--Grant UT3 framework to min user
8476
@create_user_grants.sql $UT3_OWNER $UT3_USER
8577
exit
8678
SQL
79+
80+
#Create additional UT3_TESTER_HELPER that will provide a functions to allow min grant test user setup test
81+
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
82+
set feedback off
83+
@create_utplsql_owner.sql $UT3_TESTER_HELPER $UT3_TESTER_HELPER_PASSWORD $UT3_TABLESPACE
84+
--needed for testing distributed transactions
85+
grant create public database link to $UT3_TESTER_HELPER;
86+
grant drop public database link to $UT3_TESTER_HELPER;
87+
set feedback on
88+
--Needed for testing coverage outside of main UT3 schema.
89+
grant create any procedure, drop any procedure, execute any procedure, create any type, drop any type, execute any type, under any type, select any table, update any table, insert any table, delete any table, create any table, drop any table, alter any table, select any dictionary, create any synonym, drop any synonym to $UT3_TESTER_HELPER;
90+
grant create job to $UT3_TESTER_HELPER;
91+
exit
92+
SQL

development/cleanup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ git rev-parse && cd "$(git rev-parse --show-cdup)"
77

88
"${SQLCLI}" sys/${ORACLE_PWD}@//${CONNECTION_STR} AS SYSDBA <<-SQL
99
set echo on
10-
set serveroutput on
1110
begin
1211
for x in (
1312
select * from dba_objects
@@ -22,6 +21,7 @@ end;
2221
drop user ${UT3_OWNER} cascade;
2322
drop user ${UT3_RELEASE_VERSION_SCHEMA} cascade;
2423
drop user ${UT3_TESTER} cascade;
24+
drop user ${UT3_TESTER_HELPER} cascade;
2525
drop user ${UT3_USER} cascade;
2626
2727
begin

development/template.env.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export SQLCLI=sql # For sqlcl client
44
#export SQLCLI=sqlplus # For sqlplus client
55
export CONNECTION_STR=127.0.0.1:1521/xe # Adjust the connect string
66
export ORACLE_PWD=oracle # Adjust your local SYS password
7-
export UTPLSQL_CLI_VERSION="3.1.0"
7+
export UTPLSQL_CLI_VERSION="3.1.6"
88
export SELFTESTING_BRANCH=develop
99

1010
export UTPLSQL_DIR="utPLSQL_latest_release"
@@ -13,7 +13,8 @@ export UT3_OWNER_PASSWORD=ut3
1313
export UT3_RELEASE_VERSION_SCHEMA=ut3_latest_release
1414
export UT3_TESTER=ut3_tester
1515
export UT3_TESTER_PASSWORD=ut3
16+
export UT3_TESTER_HELPER=ut3_tester_helper
17+
export UT3_TESTER_HELPER_PASSWORD=ut3
1618
export UT3_TABLESPACE=users
1719
export UT3_USER="UT3\$USER#"
1820
export UT3_USER_PASSWORD=ut3
19-

source/uninstall_objects.sql

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ drop type ut_data_value_boolean force;
137137

138138
drop type ut_data_value_blob force;
139139

140-
drop type ut_data_value_object force;
141-
142-
drop type ut_data_value_collection force;
143-
144140
drop type ut_data_value_anydata force;
145141

146142
drop type ut_data_value_xmltype force;

0 commit comments

Comments
 (0)