Skip to content
Permalink
Browse files

MENT-27 One more iteration

Pipeline amendments plus changed testcases, that create users, to make
them with more "secure" pwd to satisfy "policy requirements"
  • Loading branch information...
lawrinn committed Jul 29, 2019
1 parent 18ee34b commit 8ad44d522838ae573e98e75851fc00c571570c2a
Showing with 38 additions and 20 deletions.
  1. +28 −10 azure-pipelines.yml
  2. +1 −1 test/catalog1.c
  3. +5 −5 test/catalog2.c
  4. +4 −4 test/unicode.c
@@ -75,6 +75,14 @@ jobs:
cmake -G "Visual Studio 16 2019" -DCONC_WITH_MSI=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SIGNCODE=0 -DWITH_SSL=SCHANNEL -DWITH_OPENSSL=OFF
cmake --build . --config RelWithDebInfo
displayName: 'build connector'
- task: CopyFiles@2
inputs:
contents: 'wininstall/**.msi'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: msi_package

- task: PowerShell@2
inputs:
@@ -85,7 +93,7 @@ jobs:
$regPath = "HKCU:\Software\ODBC\ODBC.INI\test"
New-Item -Path $regPath
New-ItemProperty -Path $regPath -Name "CONN_TIMEOUT" -Value "0"
New-ItemProperty -Path $regPath -Name "DATABASE" -Value "testo"
New-ItemProperty -Path $regPath -Name "DATABASE" -Value "test"
New-ItemProperty -Path $regPath -Name "DESCRIPTION" -Value "MariaDB ODBC test"
New-ItemProperty -Path $regPath -Name "Driver" -Value "MariaDB ODBC 3.1 Driver"
New-ItemProperty -Path $regPath -Name "OPTIONS" -Value "0"
@@ -103,14 +111,14 @@ jobs:
inputs:
targetType: inline
script: |
$msifile = Get-ChildItem $env:$(System.DefaultWorkingDirectory)\mariadb-connector-odbc*.msi | Select-Object -First 1
Push-AppveyorArtifact $msifile.FullName -FileName $msifile.Name
$msifile = Get-ChildItem $env:$(System.DefaultWorkingDirectory)\wininstall\mariadb-connector-odbc*.msi | Select-Object -First 1
Write $msifile
msiexec /i $msifile INSTALLDIR=c:\mariadb-odbc /qn
msiexec /i $msifile.fullname INSTALLDIR=c:\mariadb-odbc /qn
displayName: 'install odbc'

- script: |
set MARIADB_PLUGIN_DIR=$(System.DefaultWorkingDirectory)\libmariadb\plugins\lib\RelWithDebInfo
SET TEST_SCHEMA=test
timeout /T 1
cd test
@@ -225,12 +233,19 @@ jobs:
- script: |
sudo apt-get install -f -y make cmake
cd libmariadb
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=OPENSSL -DCERT_PATH=$(System.DefaultWorkingDirectory)/tmp
make
cd ..
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_OPENSSL=ON -DWITH_SSL=OPENSSL
#cd libmariadb
#cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=OPENSSL -DCERT_PATH=$(System.DefaultWorkingDirectory)/tmp
#make
#cd ..
export TEST_SCHEMA=testo
export TEST_DRIVER=maodbc_test
export TEST_DSN=maodbc_test
export TEST_SERVER=mariadb.example.com
export TEST_UID=someUser
export TEST_PASSWORD=Passw@rd2
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_OPENSSL=ON -DWITH_SSL=OPENSSL .
cmake --build . --config RelWithDebInfo
displayName: 'Build'
@@ -262,6 +277,9 @@ jobs:
export ODBCINI="$(System.DefaultWorkingDirectory)/test/odbc.ini"
export ODBCSYSINI=$(System.DefaultWorkingDirectory)/test
cat $ODBCINI
cat $ODBCSYSINI/odbcinst.ini
ctest -V
if [ $? -ne 0 ]; then
@@ -232,7 +232,7 @@ ODBC_TEST(my_colpriv)
OK_SIMPLE_STMT(Stmt, "CREATE TABLE test_colprev3(a INT,b INT,c INT, d INT)");

(void)SQLExecDirect(Stmt, (SQLCHAR *)"DROP USER my_colpriv", SQL_NTS);
OK_SIMPLE_STMT(Stmt, "CREATE USER my_colpriv");
OK_SIMPLE_STMT(Stmt, "CREATE USER my_colpriv IDENTIFIED BY 's3CureP@wd'");

OK_SIMPLE_STMT(Stmt, "GRANT SELECT(a,b),INSERT(d),UPDATE(c) ON test_colprev1 TO my_colpriv");
OK_SIMPLE_STMT(Stmt, "GRANT SELECT(c,a),UPDATE(a,b) ON test_colprev3 TO my_colpriv");
@@ -295,7 +295,7 @@ ODBC_TEST(t_bug50195)
{
diag("Test is run in Travis");
SQLExecDirect(Stmt, (SQLCHAR *)"DROP USER bug50195@'%'", SQL_NTS);
OK_SIMPLE_STMT(Stmt, "CREATE USER bug50195@'%' IDENTIFIED BY 'a'");
OK_SIMPLE_STMT(Stmt, "CREATE USER bug50195@'%' IDENTIFIED BY 's3CureP@wd'");

OK_SIMPLE_STMT(Stmt, "GRANT ALL ON bug50195 TO bug50195@'%'");
OK_SIMPLE_STMT(Stmt, "REVOKE SELECT ON bug50195 FROM bug50195@'%'");
@@ -305,8 +305,8 @@ ODBC_TEST(t_bug50195)
SQLExecDirect(Stmt, (SQLCHAR *)"DROP USER bug50195@127.0.0.1", SQL_NTS);
SQLExecDirect(Stmt, (SQLCHAR *)"DROP USER bug50195@localhost", SQL_NTS);

OK_SIMPLE_STMT(Stmt, "CREATE USER bug50195@127.0.0.1 IDENTIFIED BY 'a'");
OK_SIMPLE_STMT(Stmt, "CREATE USER bug50195@localhost IDENTIFIED BY 'a'");
OK_SIMPLE_STMT(Stmt, "CREATE USER bug50195@127.0.0.1 IDENTIFIED BY 's3CureP@wd'");
OK_SIMPLE_STMT(Stmt, "CREATE USER bug50195@localhost IDENTIFIED BY 's3CureP@wd'");

OK_SIMPLE_STMT(Stmt, "GRANT ALL ON bug50195 TO bug50195@'127.0.0.1'");
OK_SIMPLE_STMT(Stmt, "GRANT ALL ON bug50195 TO bug50195@'localhost'");
@@ -319,11 +319,11 @@ ODBC_TEST(t_bug50195)

CHECK_ENV_RC(Env, SQLAllocConnect(Env, &hdbc1));

hstmt1= DoConnect(hdbc1, FALSE, my_dsn, "bug50195", "a", 0, NULL, NULL, NULL, NULL);
hstmt1= DoConnect(hdbc1, FALSE, my_dsn, "bug50195", "s3CureP@wd", 0, NULL, NULL, NULL, NULL);

if (hstmt1 == NULL)
{
diag("Couldn't connect with new user of allocate the stmt");
diag("Couldn't connect with new user or allocate the stmt");

if (Travis != 0 && TravisOnOsx == 0)
{
@@ -1153,11 +1153,11 @@ ODBC_TEST(t_bug28168)
SQLWCHAR *grantQuery= W(L"GRANT ALL ON t_bug28168 to "
L"'\x03A8\x0391\x03A1\x039F uid'@"
L"localhost identified by "
L"'\x03A8\x0391\x03A1\x039F pwd'");
L"'\x03A8\x0391\x03A1\x039F pWd@2019'");
SQLWCHAR *grantQuery2= W(L"GRANT ALL ON t_bug28168 to "
L"'\x03A8\x0391\x03A1\x039F uid'@"
L"'%' identified by "
L"'\x03A8\x0391\x03A1\x039F pwd'");
L"'\x03A8\x0391\x03A1\x039F pWd@2019'");
SQLSMALLINT errmsglen;
SQLINTEGER native_error= 0;

@@ -1201,7 +1201,7 @@ ODBC_TEST(t_bug28168)
wcscat(conn_in, L";UID=");
wcscat(conn_in, L"{\x03A8\x0391\x03A1\x039F uid}");
wcscat(conn_in, L";PWD=");
wcscat(conn_in, L"{\x03A8\x0391\x03A1\x039F pwd}");
wcscat(conn_in, L"{\x03A8\x0391\x03A1\x039F pWd@2019}");
wcscat(conn_in, L";DATABASE=");
mbstowcs(dummy, (char *)my_schema, sizeof(dummy)/sizeof(wchar_t));
wcscat(conn_in, dummy);
@@ -1217,7 +1217,7 @@ ODBC_TEST(t_bug28168)
CHECK_DBC_RC(hdbc2, SQLDisconnect(hdbc2));

/* we change the password in the connection string to test the error msg */
wstr= wcsstr(conn_in, L" pwd}") - 4;
wstr= wcsstr(conn_in, L" pWd@2019}") - 4;
*wstr++= 'x';

FAIL_IF(SQLDriverConnectW(hdbc2, NULL, W(conn_in), SQL_NTS,

0 comments on commit 8ad44d5

Please sign in to comment.
You can’t perform that action at this time.