From 8bbcd0efa1f7a78e29345babfaaa1a00b11e270f Mon Sep 17 00:00:00 2001 From: Lawrin Novitsky Date: Mon, 29 Jul 2019 23:50:27 +0200 Subject: [PATCH] MENT-27 One more iteration Pipeline amendments plus changed testcases, that create users, to make them with more "secure" pwd to satisfy "policy requirements" --- azure-pipelines.yml | 27 ++++++++++++++++++--------- test/catalog1.c | 2 +- test/catalog2.c | 10 +++++----- test/unicode.c | 8 ++++---- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2a38c987..24c366ec 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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,13 @@ 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 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 .. + export TEST_SCHEMA=testo + cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_OPENSSL=ON -DWITH_SSL=OPENSSL . cmake --build . --config RelWithDebInfo displayName: 'Build' diff --git a/test/catalog1.c b/test/catalog1.c index f466e4d1..619a008c 100644 --- a/test/catalog1.c +++ b/test/catalog1.c @@ -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"); diff --git a/test/catalog2.c b/test/catalog2.c index be528f0d..ee1160d8 100644 --- a/test/catalog2.c +++ b/test/catalog2.c @@ -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) { diff --git a/test/unicode.c b/test/unicode.c index aa618658..d988383b 100644 --- a/test/unicode.c +++ b/test/unicode.c @@ -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,