reply reviews from Jenny

This commit is contained in:
v-kaywon 2017-07-26 12:45:58 -07:00 committed by Jenny Tam
parent baf73565b4
commit bf7e4d80f6
5 changed files with 15 additions and 13 deletions

View file

@ -19,7 +19,8 @@ function IsAEQualified($conn)
$msodbcsql_ver = $conn->getAttribute(PDO::ATTR_CLIENT_VERSION)["DriverVer"];
$server_ver = $conn->getAttribute(PDO::ATTR_SERVER_VERSION);
$msodbcsql_maj = explode(".", $msodbcsql_ver)[0];
if ($msodbcsql_maj < 13 || explode('.', $server_ver)[0] < 13)
$msodbcsql_min = explode(".", $msodbcsql_ver)[1];
if ($msodbcsql_maj < 13 || ($msodbcsql_maj == 13 && $msodbcsql_min == 0) || explode('.', $server_ver)[0] < 13)
return false;
return true;
}

View file

@ -1,7 +1,7 @@
--TEST--
retrieval of names of column master key and column encryption key generated in the database setup
--SKIPIF--
<?php if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') die("Skipped: Test for Windows"); ?>
<?php require('skipif_unix.inc'); ?>
--FILE--
<?php
sqlsrv_configure( 'WarningsReturnAsErrors', 0 );
@ -20,7 +20,7 @@ if (IsAEQualified($conn)){
$encryption_key_row = $stmt->fetch();
if ($master_key_row[0] == 'AEMasterKey' && $encryption_key_row[0] == 'AEColumnKey'){
echo "Test Successfully.\n";
echo "Test Successfully done.\n";
}
else {
die("Column Master Key and Column Encryption Key not created.\n");
@ -28,9 +28,9 @@ if (IsAEQualified($conn)){
unset($stmt);
}
else {
echo "Test Successfully.\n";
echo "Test Successfully done.\n";
}
unset($conn);
?>
--EXPECT--
Test Successfully.
Test Successfully done.

View file

@ -45,8 +45,8 @@ def executeBulkCopy(conn_options, dbname, tblname, datafile):
inst_command = redirect_string.format(dbname, tblname, datafile) + conn_options
executeCommmand(inst_command)
def setupAE( conn_options, dbname ):
if platform.system() == 'Windows':
def setupAE( conn_options, dbname, azure ):
if (platform.system() == 'Windows' and azure.lower() == 'no'):
# import self signed certificate
inst_command = "certutil -user -p '' -importPFX My PHPcert.pfx NoRoot"
executeCommmand(inst_command)
@ -84,7 +84,7 @@ if __name__ == '__main__':
# populate these tables
populateTables(conn_options, args.DBNAME)
# setup AE (certificate, column master key and column encryption key)
setupAE(conn_options, args.DBNAME)
setupAE(conn_options, args.DBNAME, azure)
os.chdir(current_working_dir)

View file

@ -85,7 +85,8 @@ function IsAEQualified($conn)
$msodbcsql_ver = sqlsrv_client_info($conn)['DriverVer'];
$server_ver = sqlsrv_server_info($conn)['SQLServerVersion'];
$msodbcsql_maj = explode(".", $msodbcsql_ver)[0];
if ($msodbcsql_maj < 13 || explode('.', $server_ver)[0] < 13)
$msodbcsql_min = explode(".", $msodbcsql_ver)[1];
if ($msodbcsql_maj < 13 || ($msodbcsql_maj == 13 && $msodbcsql_min == 0) || explode('.', $server_ver)[0] < 13)
return false;
return true;
}

View file

@ -1,7 +1,7 @@
--TEST--
retrieval of names of column master key and column encryption key generated in the database setup
--SKIPIF--
<?php if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') die("Skipped: Test for Windows"); ?>
<?php require('skipif_unix.inc'); ?>
--FILE--
<?php
sqlsrv_configure( 'WarningsReturnAsErrors', 0 );
@ -22,7 +22,7 @@ if (IsAEQualified($conn)){
$encryption_key_name = sqlsrv_get_field($stmt, 0);
if ($master_key_name == 'AEMasterKey' && $encryption_key_name == 'AEColumnKey'){
echo "Test Successfully.\n";
echo "Test Successfully done.\n";
}
else {
echo "Column Master Key and Column Encryption Key not created.\n";
@ -30,9 +30,9 @@ if (IsAEQualified($conn)){
sqlsrv_free_stmt($stmt);
}
else {
echo "Test Successfully.\n";
echo "Test Successfully done.\n";
}
sqlsrv_close( $conn );
?>
--EXPECT--
Test Successfully.
Test Successfully done.