-
Notifications
You must be signed in to change notification settings - Fork 22
[DPE-7520] Test that the charmed_read role cannot write data #945
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
Conversation
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…oles' into feature/16_predefined_catalog_roles Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…and create a table Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…nup' into feature/16_predefined_catalog_roles Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…ned_dba_role Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…into feature/16_predefined_roles_cleanup Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…nup' into feature/16_predefined_catalog_roles Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…ned_dba_role Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…into feature/16_predefined_roles_cleanup Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…nup' into feature/16_predefined_catalog_roles Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…into feature/16_predefined_roles_cleanup Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…nup' into feature/16_predefined_catalog_roles Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…ned_roles_cleanup Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…nup' into feature/16_predefined_catalog_roles Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…ned_catalog_roles Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 16/edge #945 +/- ##
========================================
Coverage 70.13% 70.13%
========================================
Files 16 16
Lines 3817 3817
Branches 554 554
========================================
Hits 2677 2677
Misses 1002 1002
Partials 138 138 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…role-write-data Signed-off-by: Marcelo Henrique Neppel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, can we expand the testcase here a bit (to sleep better)?
logger.info("Checking that the charmed_read role cannot write to the database") | ||
with pytest.raises(psycopg2.errors.InsufficientPrivilege): | ||
cursor.execute("CREATE TABLE test_table_2 (id INTEGER);") | ||
connection.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM here, should we also try here to INSERT into test_table
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'll add that scenario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…isting table Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Signed-off-by: Marcelo Henrique Neppel <[email protected]>
…role-write-data Signed-off-by: Marcelo Henrique Neppel <[email protected]>
Issue
Currently, we only test that the charmed_read role can read data, and not that it can’t write data.
Solution
Add a check in the current integration test to verify that the role cannot write data.
Checklist