Skip to content
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

Split akv verification tests to fix SSL issue #781

Merged
merged 4 commits into from
May 25, 2018
Merged

Split akv verification tests to fix SSL issue #781

merged 4 commits into from
May 25, 2018

Conversation

david-puglielli
Copy link
Contributor

@david-puglielli david-puglielli commented May 25, 2018

Removed *_verification.phpt and replaced with _usernamepassword.phpt and _clientsecret.phpt.


This change is Reviewable

@david-puglielli david-puglielli requested a review from yitam May 25, 2018 00:22
@codecov-io
Copy link

codecov-io commented May 25, 2018

Codecov Report

Merging #781 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #781   +/-   ##
=======================================
  Coverage   80.06%   80.06%           
=======================================
  Files          25       25           
  Lines        7323     7323           
=======================================
  Hits         5863     5863           
  Misses       1460     1460
Impacted Files Coverage Δ
.../php-7.1.17-src/ext/sqlsrv/shared/core_results.cpp
...phpdev/vc14/x86/php-7.1.17-src/ext/sqlsrv/conn.cpp
...php-7.1.17-src/ext/pdo_sqlsrv/shared/core_util.cpp
...phpdev/vc14/x86/php-7.1.17-src/ext/sqlsrv/init.cpp
...ev/vc14/x86/php-7.1.17-src/ext/sqlsrv/php_sqlsrv.h
...vc14/x86/php-7.1.17-src/ext/pdo_sqlsrv/pdo_dbh.cpp
...php-7.1.17-src/ext/pdo_sqlsrv/shared/core_conn.cpp
...6/php-7.1.17-src/ext/sqlsrv/shared/core_stream.cpp
...4/x86/php-7.1.17-src/ext/pdo_sqlsrv/pdo_parser.cpp
...x86/php-7.1.17-src/ext/sqlsrv/shared/core_conn.cpp
... and 40 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0eefaf...ff0e460. Read the comment docs.

Copy link
Contributor

@yitam yitam left a comment

Choose a reason for hiding this comment

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

Several things: (1) please drop test tables at the end of your tests (2) now that the tests are split, they share the same code except how to connect -- suggestion: for easier maintenance, move the same methods to one file to be included in the tests (3) why str size 64? If it's a constant, you might consider using the keyword const and upper case letters for the constants (4) to be consistent with the naming scheme, please add underscores _ for the file names usernamepassword and clientsecret (5) please fix the comments in values.php

@david-puglielli
Copy link
Contributor Author

Regarding strsize, it's 64 just to make sure the column size is large enough to accommodate the string values in values.php that are used for this test. But it changes in other AE tests that use other longer strings in values.php.

Copy link
Contributor

@yitam yitam left a comment

Choose a reason for hiding this comment

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

Please read my comments / questions.

// Set up the columns and build the insert query. Each data type has an
// AE-encrypted and a non-encrypted column side by side in the table.
// If column encryption is not set in MsSetup.inc, this function simply
// creates two non-encrypted columns side-by-side for each type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if I agree with your comment here because you have a specific connection string in your test, so it's not really affected by the flags in MsSetup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ColumnMeta does use the flags in MsSetup though, so setting $keystore and $dataEncrypted to encrypt in MsSetup will encrypt the _AE columns if the rest of the connection string enables encryption.

require_once("MsCommon_mid-refactor.inc");
require_once("MsSetup.inc");
require_once('values.php');
require_once('pdo_ae_azure_key_vault_common.php');

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you drop the your test table(s) in this test and the sqlsrv equivalent one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, at the end of insertDataAndVerify() in the new common files.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm... I don't see this insertDataAndVerify() anywhere... not sure how I miss it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's in sqlsrv_ae_azure_key_vault_common.php and pdo_ae_azure_key_vault_common.php.

require_once('pdo_ae_azure_key_vault_common.php');

$strsize = 64;

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment to explain why you picked 64 for the strsize

require_once('sqlsrv_ae_azure_key_vault_common.php');

$strsize = 64;

Copy link
Contributor

Choose a reason for hiding this comment

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

Add comment about 64 please

@@ -114,7 +85,7 @@ for ($i = 0; $i < sizeof($columnEncryption); ++$i) {
checkErrors(
$errors,
array('08001','0'),
array('08001','-1'), // SSL error occurs in Ubuntu
array('08001','-1'), // SSL error on some Linuxes
array('IMSSP','-110'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still have SSL errors after this split?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because I did not split the keywords test. This test runs through 254 connections so splitting is not practical.

Copy link
Contributor

Choose a reason for hiding this comment

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

How often does the SSL error occur? Does it always happen after the first successful connection?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't remember how often it happens...

require_once('sqlsrv_ae_azure_key_vault_common.php');

$strsize = 64;

Copy link
Contributor

Choose a reason for hiding this comment

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

you use 64 in almost every AKV test -- why not create a constant in values.php and reference it in all your tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea...

Copy link
Contributor

@yitam yitam left a comment

Choose a reason for hiding this comment

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

Let's not forget to fix the remaining SSL issues
Drop tables in pdo keyword test too
Otherwise approved.

@david-puglielli david-puglielli merged commit 0861f06 into microsoft:dev May 25, 2018
@coveralls
Copy link

coveralls commented May 26, 2018

Coverage Status

Coverage remained the same at 74.697% when pulling ff0e460 on david-puglielli:akv-verification-test-fix into f0eefaf on Microsoft:dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants