Skip to content

Commit

Permalink
Integration test to ensure OpenMRS tables are encrypted.
Browse files Browse the repository at this point in the history
  • Loading branch information
schuyler committed Feb 7, 2020
1 parent e2b89bd commit 32632c7
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
test_10_openmrs_tables_are_encrypted () {
sudo mysql -s openmrs >table_count <<End
SELECT COUNT(*) FROM information_schema.INNODB_TABLESPACES_ENCRYPTION
WHERE name LIKE "openmrs/%"
AND encryption_scheme = 1;
End
[ "$(cat table_count)" -gt 0 ]
}

2 comments on commit 32632c7

@zestyping
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does -gt 0 mean this only checks if at least one table is encrypted? Don't we want all the tables to be encrypted?

@schuyler
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zestyping MySQL starts encrypting tables on a background thread when encryption is enabled. As a result, there's no obvious way to know when the job is done. This test makes the assumption that if at least one of the openmrs tables is encrypted, then the server background thread is doing its work and all openmrs tables will be encrypted eventually. I'll comment this assumption in the test.

Please sign in to comment.