cossacklabs / acra

Database security suite. Database proxy with field-level encryption, search through encrypted data, SQL injections prevention, intrusion detection, honeypots. Supports client-side and proxy-side ("transparent") encryption. SQL, NoSQL.
https://www.cossacklabs.com/acra/
Apache License 2.0
1.35k stars 127 forks source link

Fix acrarollback tests #642

Closed Lagovas closed 1 year ago

Lagovas commented 1 year ago
  1. Found, that tests for acra-rollback do nothing and don't check that last query returns anything before iteration:

    result = self.engine_raw.execute(acrarollback_output_table.select())
        result = result.fetchall()
        for data in result:
            self.assertIn(data[0], source_data)

    And they succeed even with errors like key 'keypair1' not found. So, fixed the name of keypairs and added additional check that there are anything to iterate.

  2. Found, that our GetDriverConnectionStringHost method incorrectly parses usernames that don't look like valid schema for net.URL. So, replaced custom parsing logic to use an appropriate function from the target driver that knows how to deal with its own custom connection string.

Checklist