|
5 | 5 |
|
6 | 6 | #install core of utplsql |
7 | 7 | time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL |
| 8 | +whenever sqlerror exit failure rollback |
8 | 9 | set feedback off |
9 | 10 | set verify off |
10 | 11 |
|
|
57 | 58 |
|
58 | 59 | fi |
59 | 60 |
|
60 | | -#additional privileges to run scripted tests |
61 | | -time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL |
62 | | -set feedback on |
63 | | ---needed for Mystats script to work |
64 | | -grant select any dictionary to $UT3_OWNER; |
65 | | ---Needed for testing a coverage outside ut3_owner. |
66 | | -grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER; |
67 | | -SQL |
68 | 61 |
|
69 | | -#Create user that will own the tests that are relevant to internal framework |
70 | 62 | time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL |
71 | 63 | set feedback off |
72 | | -@create_utplsql_owner.sql $UT3_TESTER $UT3_TESTER_PASSWORD $UT3_TABLESPACE |
73 | | ---needed for disabling DDL trigger and testint parser without trigger enabled/present |
74 | | -grant alter any trigger to ut3_tester; |
| 64 | +whenever sqlerror exit failure rollback |
| 65 | +
|
| 66 | +-------------------------------------------------------------------------------- |
| 67 | +PROMPT Adding back create-trigger privilege to $UT3_OWNER for testing |
| 68 | +grant administer database trigger to $UT3_OWNER; |
| 69 | +
|
| 70 | +-------------------------------------------------------------------------------- |
| 71 | +PROMPT Creating $UT3_TESTER - Power-user for testing internal framework code |
| 72 | +
|
| 73 | +create user $UT3_TESTER identified by "$UT3_TESTER_PASSWORD" default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE; |
| 74 | +grant create session, create procedure, create type, create table to $UT3_TESTER; |
| 75 | +
|
| 76 | +PROMPT Additional grants for disabling DDL trigger and testing parser without trigger enabled/present |
| 77 | +
|
| 78 | +grant alter any trigger to $UT3_TESTER; |
75 | 79 | grant administer database trigger to $UT3_TESTER; |
76 | | -exit |
77 | | -SQL |
| 80 | +grant execute on dbms_lock to $UT3_TESTER; |
78 | 81 |
|
79 | | -#Create additional UT3$USER# to test for special characters and front end API testing |
80 | | -time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL |
81 | | -set feedback off |
82 | | -@create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE |
83 | | ---Grant UT3 framework to min user |
84 | | -@create_user_grants.sql $UT3_OWNER $UT3_USER |
85 | | -exit |
86 | | -SQL |
| 82 | +PROMPT Granting $UT3_OWNER code to $UT3_TESTER |
87 | 83 |
|
88 | | -#Create additional UT3_TESTER_HELPER that will provide a functions to allow min grant test user setup test |
89 | | -time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL |
90 | | -set feedback off |
91 | | -@create_utplsql_owner.sql $UT3_TESTER_HELPER $UT3_TESTER_HELPER_PASSWORD $UT3_TABLESPACE |
92 | | ---needed for testing distributed transactions |
| 84 | +begin |
| 85 | + for i in ( |
| 86 | + select object_name from all_objects t |
| 87 | + where t.object_type in ('PACKAGE','TYPE') |
| 88 | + and owner = 'UT3' |
| 89 | + and generated = 'N' |
| 90 | + and object_name not like 'SYS%') |
| 91 | + loop |
| 92 | + execute immediate 'grant execute on ut3."'||i.object_name||'" to UT3_TESTER'; |
| 93 | + end loop; |
| 94 | +end; |
| 95 | +/ |
| 96 | +
|
| 97 | +PROMPT Granting $UT3_OWNER tables to $UT3_TESTER |
| 98 | +
|
| 99 | +begin |
| 100 | + for i in ( select table_name from all_tables t where owner = 'UT3' and nested = 'NO' and IOT_TYPE is NULL) |
| 101 | + loop |
| 102 | + execute immediate 'grant select on UT3.'||i.table_name||' to UT3_TESTER'; |
| 103 | + end loop; |
| 104 | +end; |
| 105 | +/ |
| 106 | +
|
| 107 | +
|
| 108 | +-------------------------------------------------------------------------------- |
| 109 | +PROMPT Creating $UT3_USER - minimal privileges user for API testing |
| 110 | +
|
| 111 | +create user $UT3_USER identified by "$UT3_USER_PASSWORD" default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE; |
| 112 | +grant create session, create procedure, create type, create table to $UT3_USER; |
| 113 | +
|
| 114 | +
|
| 115 | +-------------------------------------------------------------------------------- |
| 116 | +PROMPT Creating $UT3_TESTER_HELPER - provides functions to allow min grant test user setup tests. |
| 117 | +
|
| 118 | +create user $UT3_TESTER_HELPER identified by "$UT3_TESTER_HELPER_PASSWORD" default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE; |
| 119 | +grant create session, create procedure, create type, create table to $UT3_TESTER_HELPER; |
| 120 | +
|
| 121 | +PROMPT Grants for testing distributed transactions |
93 | 122 | grant create public database link to $UT3_TESTER_HELPER; |
94 | 123 | grant drop public database link to $UT3_TESTER_HELPER; |
95 | | -set feedback on |
96 | | ---Needed for testing coverage outside of main UT3 schema. |
| 124 | +
|
| 125 | +PROMPT Grants for testing coverage outside of main UT3 schema. |
97 | 126 | 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; |
98 | 127 | grant create job to $UT3_TESTER_HELPER; |
99 | | ---Needed to allow for enable/disable of annotation triggers |
100 | | -grant administer database trigger to $UT3_TESTER_HELPER; |
| 128 | +
|
101 | 129 | exit |
102 | 130 | SQL |
0 commit comments