Skip to content

Commit

Permalink
Minor fixes to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vrajat authored and timothy-e committed Dec 13, 2022
1 parent 452ba79 commit 6c5bc5c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/postgres/src/test/regress/expected/yb_profile.out
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ SELECT prfname, prffailedloginattempts FROM pg_catalog.pg_yb_profile ORDER BY OI
-- Fail because it is a duplicate name
CREATE PROFILE test_profile LIMIT FAILED_LOGIN_ATTEMPTS 4;
ERROR: profile "test_profile" already exists
-- Fail because -ve numbers are not allowed
CREATE PROFILE test_profile LIMIT FAILED_LOGIN_ATTEMPTS -1;
ERROR: syntax error at or near "-"
LINE 1: CREATE PROFILE test_profile LIMIT FAILED_LOGIN_ATTEMPTS -1;
^
--
-- DROP PROFILE
--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ DROP PROFILE existing_profile;
-- Recreate profile for next test
\c yugabyte yugabyte
CREATE PROFILE existing_profile LIMIT FAILED_LOGIN_ATTEMPTS 3;
-- user_3 can execute these commands as it is a yb_superuser.
-- user_3 can execute these commands as it is a yb_super_admin.
\c yugabyte user_3
CREATE PROFILE test_profile_3 LIMIT FAILED_LOGIN_ATTEMPTS 3;
ALTER USER restricted_user PROFILE test_profile_3;
Expand Down
10 changes: 5 additions & 5 deletions src/postgres/src/test/regress/expected/yb_role_profile.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
Table "pg_catalog.pg_yb_role_profile"
Column | Type | Collation | Nullable | Default
------------------------+---------+-----------+----------+---------
rolisenabled | boolean | | not null |
rolid | oid | | not null |
prfid | oid | | not null |
rolisenabled | boolean | | not null |
rolfailedloginattempts | integer | | not null |
rollockedat | bigint | | not null |
rollockedat | integer | | not null |
Indexes:
"pg_yb_role_profile_oid_index" PRIMARY KEY, lsm (rolid ASC), tablespace "pg_global"
"pg_yb_role_profile_oid_index" PRIMARY KEY, lsm (oid ASC), tablespace "pg_global"
Tablespace: "pg_global"

SELECT oid, relname, reltype, relnatts FROM pg_class WHERE relname IN ('pg_yb_role_profile', 'pg_yb_role_profile_oid_index');
Expand Down Expand Up @@ -237,8 +237,8 @@ select count(*) from pg_yb_role_profile;
(1 row)

select * from pg_yb_role_profile;
rolisenabled | rolid | prfid | rolfailedloginattempts | rollockedat
--------------+-------+-------+------------------------+-------------
rolid | prfid | rolisenabled | rolfailedloginattempts | rollockedat
-------+-------+--------------+------------------------+-------------
(0 rows)

DROP PROFILE test_profile;
4 changes: 3 additions & 1 deletion src/postgres/src/test/regress/sql/yb_profile.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ CREATE PROFILE test_profile LIMIT FAILED_LOGIN_ATTEMPTS 3;
SELECT prfname, prffailedloginattempts FROM pg_catalog.pg_yb_profile ORDER BY OID;

-- Fail because it is a duplicate name

CREATE PROFILE test_profile LIMIT FAILED_LOGIN_ATTEMPTS 4;

-- Fail because -ve numbers are not allowed
CREATE PROFILE test_profile LIMIT FAILED_LOGIN_ATTEMPTS -1;

--
-- DROP PROFILE
--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DROP PROFILE existing_profile;
\c yugabyte yugabyte
CREATE PROFILE existing_profile LIMIT FAILED_LOGIN_ATTEMPTS 3;

-- user_3 can execute these commands as it is a yb_superuser.
-- user_3 can execute these commands as it is a yb_super_admin.

\c yugabyte user_3
CREATE PROFILE test_profile_3 LIMIT FAILED_LOGIN_ATTEMPTS 3;
Expand Down

0 comments on commit 6c5bc5c

Please sign in to comment.