Changeset - 85d033089f0e
[Not reviewed]
0 1 0
Branko Majic (branko) - 9 months ago 2023-08-10 00:04:24
branko@majic.rs
MAR-181: Remove release-specific code for database role tests:

- Code was present due to difference between Debian Stretch and Debian
Buster.
1 file changed with 2 insertions and 10 deletions:
0 comments (0 inline, 0 general)
roles/database/molecule/default/tests/test_default.py
Show inline comments
 
@@ -34,16 +34,8 @@ def test_database_user_permissions(host):
 
    Tests if database user has been granted correct permissions on the database.
 
    """
 

	
 
    ansible_facts = host.ansible("setup")["ansible_facts"]
 
    ansible_distribution_release = ansible_facts['ansible_distribution_release']
 

	
 
    # Small difference in usage of backtick (`) instead of single
 
    # quote (') when displaying grants for user.
 
    if ansible_distribution_release == "buster":
 
        expected_usage = "GRANT USAGE ON *.* TO `testdb`@`localhost` IDENTIFIED BY PASSWORD '*676852B7FAE972722AD20D6E74781D6B1A100544'"
 
        expected_privileges = "GRANT ALL PRIVILEGES ON `testdb`.* TO `testdb`@`localhost`"
 
    else:
 
        raise Exception("Tried running test on unsupported distribution: %s" % ansible_distribution_release)
 
    expected_usage = "GRANT USAGE ON *.* TO `testdb`@`localhost` IDENTIFIED BY PASSWORD '*676852B7FAE972722AD20D6E74781D6B1A100544'"
 
    expected_privileges = "GRANT ALL PRIVILEGES ON `testdb`.* TO `testdb`@`localhost`"
 

	
 
    visible_databases = host.run("mysql -utestdb -ptestdbpassword -BNe 'show databases'")
 

	
0 comments (0 inline, 0 general)