Skip to content

Removed test users env variables #1201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions .github/scripts/create_test_users.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ PROMPT Adding back create-trigger privilege to $UT3_DEVELOP_SCHEMA for testing
grant administer database trigger to $UT3_DEVELOP_SCHEMA;

--------------------------------------------------------------------------------
PROMPT Creating $UT3_TESTER - Power-user for testing internal framework code
PROMPT Creating UT3_TESTER - Power-user for testing internal framework code

create user $UT3_TESTER identified by "$UT3_TESTER_PASSWORD" default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE;
grant create session, create procedure, create type, create table to $UT3_TESTER;
create user UT3_TESTER identified by "ut3" default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE;
grant create session, create procedure, create type, create table to UT3_TESTER;

grant execute on dbms_lock to $UT3_TESTER;
grant execute on dbms_lock to UT3_TESTER;

PROMPT Granting $UT3_DEVELOP_SCHEMA code to $UT3_TESTER
PROMPT Granting $UT3_DEVELOP_SCHEMA code to UT3_TESTER

begin
for i in (
Expand All @@ -30,31 +30,31 @@ begin
and generated = 'N'
and object_name not like 'SYS%')
loop
execute immediate 'grant execute on $UT3_DEVELOP_SCHEMA."'||i.object_name||'" to $UT3_TESTER';
execute immediate 'grant execute on $UT3_DEVELOP_SCHEMA."'||i.object_name||'" to UT3_TESTER';
end loop;
end;
/

PROMPT Granting $UT3_DEVELOP_SCHEMA tables to $UT3_TESTER
PROMPT Granting $UT3_DEVELOP_SCHEMA tables to UT3_TESTER

begin
for i in ( select table_name from all_tables t where owner = '$UT3_DEVELOP_SCHEMA' and nested = 'NO' and iot_name is null)
loop
execute immediate 'grant select on $UT3_DEVELOP_SCHEMA.'||i.table_name||' to $UT3_TESTER';
execute immediate 'grant select on $UT3_DEVELOP_SCHEMA.'||i.table_name||' to UT3_TESTER';
end loop;
end;
/


--------------------------------------------------------------------------------
PROMPT Creating $UT3_USER - minimal privileges user for API testing
PROMPT Creating UT3_USER - minimal privileges user for API testing

create user $UT3_USER identified by "$UT3_USER_PASSWORD" default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE;
grant create session, create procedure, create type, create table to $UT3_USER;
create user UT3_USER identified by "ut3" default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE;
grant create session, create procedure, create type, create table to UT3_USER;

PROMPT Grants for starting a debugging session from $UT3_USER
grant debug connect session to $UT3_USER;
grant debug any procedure to $UT3_USER;
PROMPT Grants for starting a debugging session from UT3_USER
grant debug connect session to UT3_USER;
grant debug any procedure to UT3_USER;
begin
\$if dbms_db_version.version <= 11 \$then
null; -- no addition action necessary
Expand All @@ -64,7 +64,7 @@ begin
host =>'*',
ace => sys.xs\$ace_type(
privilege_list => sys.xs\$name_list('JDWP') ,
principal_name => '$UT3_USER',
principal_name => 'UT3_USER',
principal_type => sys.xs_acl.ptype_db
)
);
Expand All @@ -73,29 +73,29 @@ end;
/

--------------------------------------------------------------------------------
PROMPT Creating $UT3_TESTER_HELPER - provides functions to allow min grant test user setup tests.
PROMPT Creating UT3_TESTER_HELPER - provides functions to allow min grant test user setup tests.

create user $UT3_TESTER_HELPER identified by "$UT3_TESTER_HELPER_PASSWORD" default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE;
grant create session, create procedure, create type, create table to $UT3_TESTER_HELPER;
create user UT3_TESTER_HELPER identified by "ut3" default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE;
grant create session, create procedure, create type, create table to UT3_TESTER_HELPER;

PROMPT Grants for testing distributed transactions
grant create public database link to $UT3_TESTER_HELPER;
grant drop public database link to $UT3_TESTER_HELPER;
grant create public database link to UT3_TESTER_HELPER;
grant drop public database link to UT3_TESTER_HELPER;

PROMPT Grants for testing coverage outside of main $UT3_DEVELOP_SCHEMA schema.
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,
grant any object privilege, grant any privilege, create public synonym, drop public synonym, create any trigger
to $UT3_TESTER_HELPER;
to UT3_TESTER_HELPER;

grant create job to $UT3_TESTER_HELPER;
grant create job to UT3_TESTER_HELPER;

PROMPT Additional grants for disabling DDL trigger and testing parser without trigger enabled/present

grant alter any trigger to $UT3_TESTER_HELPER;
grant administer database trigger to $UT3_TESTER_HELPER;
grant execute on dbms_lock to $UT3_TESTER_HELPER;
grant alter any trigger to UT3_TESTER_HELPER;
grant administer database trigger to UT3_TESTER_HELPER;
grant execute on dbms_lock to UT3_TESTER_HELPER;

create user ut3_cache_test_owner identified by ut3;
grant create session, create procedure to ut3_cache_test_owner;
Expand Down
8 changes: 1 addition & 7 deletions .github/variables/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ UT3_DEVELOP_SCHEMA=UT3_DEVELOP
UT3_DEVELOP_SCHEMA_PASSWORD=ut3
UT3_RELEASE_VERSION_SCHEMA=UT3
UT3_RELEASE_VERSION_SCHEMA_PASSWORD=ut3
UT3_USER='UT3_USER'
UT3_USER_PASSWORD=ut3
UT3_TESTER=UT3_TESTER
UT3_TESTER_PASSWORD=ut3
UT3_TESTER_HELPER=UT3_TESTER_HELPER
UT3_TESTER_HELPER_PASSWORD=ut3
UT3_TABLESPACE=users

# Database Env
Expand All @@ -30,4 +24,4 @@ GIT_COMMITTER_NAME="github-actions[bot]"
GIT_COMMITTER_EMAIL="github-actions[bot]@users.noreply.github.com"

#Docker environment for running utPLSQL install commands
DOCKER_ENV="-e SQLCLI=sqlplus -e UT3_DEVELOP_SCHEMA -e UT3_DEVELOP_SCHEMA_PASSWORD -e UT3_RELEASE_VERSION_SCHEMA -e UT3_RELEASE_VERSION_SCHEMA_PASSWORD -e UT3_USER -e UT3_USER_PASSWORD -e UT3_TESTER -e UT3_TESTER_PASSWORD -e UT3_TESTER_HELPER -e UT3_TESTER_HELPER_PASSWORD -e UT3_TABLESPACE -e ORACLE_PWD -e CONNECTION_STR -e UTPLSQL_DIR"
DOCKER_ENV="-e SQLCLI=sqlplus -e UT3_DEVELOP_SCHEMA -e UT3_DEVELOP_SCHEMA_PASSWORD -e UT3_RELEASE_VERSION_SCHEMA -e UT3_RELEASE_VERSION_SCHEMA_PASSWORD -e UT3_TABLESPACE -e ORACLE_PWD -e CONNECTION_STR -e UTPLSQL_DIR"
6 changes: 3 additions & 3 deletions development/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ end;

drop user ${UT3_DEVELOP_SCHEMA} cascade;
drop user ${UT3_RELEASE_VERSION_SCHEMA} cascade;
drop user ${UT3_TESTER} cascade;
drop user ${UT3_TESTER_HELPER} cascade;
drop user ${UT3_USER} cascade;
drop user ut3_tester cascade;
drop user ut3_tester_helper cascade;
drop user ut3_user cascade;
drop user ut3_cache_test_owner cascade;
drop user ut3_no_extra_priv_user cascade;
drop user ut3_select_catalog_user cascade;
Expand Down
7 changes: 0 additions & 7 deletions development/template.env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,4 @@ export UT3_DEVELOP_SCHEMA=UT3_DEVELOP
export UT3_DEVELOP_SCHEMA_PASSWORD=ut3
export UT3_RELEASE_VERSION_SCHEMA=UT3
export UT3_RELEASE_VERSION_SCHEMA_PASSWORD=ut3
export UT3_TESTER=UT3_TESTER
export UT3_TESTER_PASSWORD=ut3
export UT3_TESTER_HELPER=UT3_TESTER_HELPER
export UT3_TESTER_HELPER_PASSWORD=ut3
export UT3_TABLESPACE=users
export UT3_USER="UT3\$USER#"
export UT3_USER_PASSWORD=ut3
export DOCKER_ENV="-e SQLCLI=sqlplus -e UT3_DEVELOP_SCHEMA -e UT3_DEVELOP_SCHEMA_PASSWORD -e UT3_RELEASE_VERSION_SCHEMA -e UT3_RELEASE_VERSION_SCHEMA_PASSWORD -e UT3_USER -e UT3_USER_PASSWORD -e UT3_TESTER -e UT3_TESTER_PASSWORD -e UT3_TESTER_HELPER -e UT3_TESTER_HELPER_PASSWORD -e UT3_TABLESPACE -e ORACLE_PWD -e CONNECTION_STR -e UTPLSQL_DIR"
6 changes: 3 additions & 3 deletions test/install_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd ${SCRIPT_DIR}


"$SQLCLI" ${UT3_TESTER_HELPER}/${UT3_TESTER_HELPER_PASSWORD}@//${CONNECTION_STR} @install_ut3_tester_helper.sql
"$SQLCLI" UT3_TESTER_HELPER/ut3@//${CONNECTION_STR} @install_ut3_tester_helper.sql

"$SQLCLI" ${UT3_USER}/${UT3_USER_PASSWORD}@//${CONNECTION_STR} @install_ut3_user_tests.sql
"$SQLCLI" UT3_USER/ut3@//${CONNECTION_STR} @install_ut3_user_tests.sql

"$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} @install_ut3_tester_tests.sql
"$SQLCLI" UT3_TESTER/ut3@//${CONNECTION_STR} @install_ut3_tester_tests.sql

2 changes: 1 addition & 1 deletion test/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -ev
#goto git root directory
git rev-parse && cd "$(git rev-parse --show-cdup)"

time utPLSQL-cli/bin/utplsql run ${UT3_TESTER_HELPER}/${UT3_TESTER_HELPER_PASSWORD}@${CONNECTION_STR} \
time utPLSQL-cli/bin/utplsql run UT3_TESTER_HELPER/ut3@${CONNECTION_STR} \
-source_path=source -owner=ut3_develop \
-p='ut3_tester,ut3_user' \
-test_path=test -c \
Expand Down