Skip to content

Commit 8ad44d5

Browse files
committed
MENT-27 One more iteration
Pipeline amendments plus changed testcases, that create users, to make them with more "secure" pwd to satisfy "policy requirements"
1 parent 18ee34b commit 8ad44d5

File tree

4 files changed

+38
-20
lines changed

4 files changed

+38
-20
lines changed

azure-pipelines.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ jobs:
7575
cmake -G "Visual Studio 16 2019" -DCONC_WITH_MSI=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SIGNCODE=0 -DWITH_SSL=SCHANNEL -DWITH_OPENSSL=OFF
7676
cmake --build . --config RelWithDebInfo
7777
displayName: 'build connector'
78+
- task: CopyFiles@2
79+
inputs:
80+
contents: 'wininstall/**.msi'
81+
targetFolder: $(Build.ArtifactStagingDirectory)
82+
- task: PublishPipelineArtifact@1
83+
inputs:
84+
targetPath: '$(Build.ArtifactStagingDirectory)'
85+
artifactName: msi_package
7886

7987
- task: PowerShell@2
8088
inputs:
@@ -85,7 +93,7 @@ jobs:
8593
$regPath = "HKCU:\Software\ODBC\ODBC.INI\test"
8694
New-Item -Path $regPath
8795
New-ItemProperty -Path $regPath -Name "CONN_TIMEOUT" -Value "0"
88-
New-ItemProperty -Path $regPath -Name "DATABASE" -Value "testo"
96+
New-ItemProperty -Path $regPath -Name "DATABASE" -Value "test"
8997
New-ItemProperty -Path $regPath -Name "DESCRIPTION" -Value "MariaDB ODBC test"
9098
New-ItemProperty -Path $regPath -Name "Driver" -Value "MariaDB ODBC 3.1 Driver"
9199
New-ItemProperty -Path $regPath -Name "OPTIONS" -Value "0"
@@ -103,14 +111,14 @@ jobs:
103111
inputs:
104112
targetType: inline
105113
script: |
106-
$msifile = Get-ChildItem $env:$(System.DefaultWorkingDirectory)\mariadb-connector-odbc*.msi | Select-Object -First 1
107-
Push-AppveyorArtifact $msifile.FullName -FileName $msifile.Name
114+
$msifile = Get-ChildItem $env:$(System.DefaultWorkingDirectory)\wininstall\mariadb-connector-odbc*.msi | Select-Object -First 1
108115
Write $msifile
109-
msiexec /i $msifile INSTALLDIR=c:\mariadb-odbc /qn
116+
msiexec /i $msifile.fullname INSTALLDIR=c:\mariadb-odbc /qn
110117
displayName: 'install odbc'
111118

112119
- script: |
113120
set MARIADB_PLUGIN_DIR=$(System.DefaultWorkingDirectory)\libmariadb\plugins\lib\RelWithDebInfo
121+
SET TEST_SCHEMA=test
114122
115123
timeout /T 1
116124
cd test
@@ -225,12 +233,19 @@ jobs:
225233
226234
- script: |
227235
sudo apt-get install -f -y make cmake
228-
cd libmariadb
229-
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=OPENSSL -DCERT_PATH=$(System.DefaultWorkingDirectory)/tmp
230-
make
231-
232-
cd ..
233-
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_OPENSSL=ON -DWITH_SSL=OPENSSL
236+
#cd libmariadb
237+
#cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=OPENSSL -DCERT_PATH=$(System.DefaultWorkingDirectory)/tmp
238+
#make
239+
240+
#cd ..
241+
export TEST_SCHEMA=testo
242+
export TEST_DRIVER=maodbc_test
243+
export TEST_DSN=maodbc_test
244+
export TEST_SERVER=mariadb.example.com
245+
export TEST_UID=someUser
246+
export TEST_PASSWORD=Passw@rd2
247+
248+
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_OPENSSL=ON -DWITH_SSL=OPENSSL .
234249
cmake --build . --config RelWithDebInfo
235250
displayName: 'Build'
236251
@@ -262,6 +277,9 @@ jobs:
262277
export ODBCINI="$(System.DefaultWorkingDirectory)/test/odbc.ini"
263278
export ODBCSYSINI=$(System.DefaultWorkingDirectory)/test
264279
280+
cat $ODBCINI
281+
cat $ODBCSYSINI/odbcinst.ini
282+
265283
ctest -V
266284
267285
if [ $? -ne 0 ]; then

test/catalog1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ ODBC_TEST(my_colpriv)
232232
OK_SIMPLE_STMT(Stmt, "CREATE TABLE test_colprev3(a INT,b INT,c INT, d INT)");
233233

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

237237
OK_SIMPLE_STMT(Stmt, "GRANT SELECT(a,b),INSERT(d),UPDATE(c) ON test_colprev1 TO my_colpriv");
238238
OK_SIMPLE_STMT(Stmt, "GRANT SELECT(c,a),UPDATE(a,b) ON test_colprev3 TO my_colpriv");

test/catalog2.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ ODBC_TEST(t_bug50195)
295295
{
296296
diag("Test is run in Travis");
297297
SQLExecDirect(Stmt, (SQLCHAR *)"DROP USER bug50195@'%'", SQL_NTS);
298-
OK_SIMPLE_STMT(Stmt, "CREATE USER bug50195@'%' IDENTIFIED BY 'a'");
298+
OK_SIMPLE_STMT(Stmt, "CREATE USER bug50195@'%' IDENTIFIED BY 's3CureP@wd'");
299299

300300
OK_SIMPLE_STMT(Stmt, "GRANT ALL ON bug50195 TO bug50195@'%'");
301301
OK_SIMPLE_STMT(Stmt, "REVOKE SELECT ON bug50195 FROM bug50195@'%'");
@@ -305,8 +305,8 @@ ODBC_TEST(t_bug50195)
305305
SQLExecDirect(Stmt, (SQLCHAR *)"DROP USER [email protected]", SQL_NTS);
306306
SQLExecDirect(Stmt, (SQLCHAR *)"DROP USER bug50195@localhost", SQL_NTS);
307307

308-
OK_SIMPLE_STMT(Stmt, "CREATE USER [email protected] IDENTIFIED BY 'a'");
309-
OK_SIMPLE_STMT(Stmt, "CREATE USER bug50195@localhost IDENTIFIED BY 'a'");
308+
OK_SIMPLE_STMT(Stmt, "CREATE USER [email protected] IDENTIFIED BY 's3CureP@wd'");
309+
OK_SIMPLE_STMT(Stmt, "CREATE USER bug50195@localhost IDENTIFIED BY 's3CureP@wd'");
310310

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

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

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

324324
if (hstmt1 == NULL)
325325
{
326-
diag("Couldn't connect with new user of allocate the stmt");
326+
diag("Couldn't connect with new user or allocate the stmt");
327327

328328
if (Travis != 0 && TravisOnOsx == 0)
329329
{

test/unicode.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,11 +1153,11 @@ ODBC_TEST(t_bug28168)
11531153
SQLWCHAR *grantQuery= W(L"GRANT ALL ON t_bug28168 to "
11541154
L"'\x03A8\x0391\x03A1\x039F uid'@"
11551155
L"localhost identified by "
1156-
L"'\x03A8\x0391\x03A1\x039F pwd'");
1156+
L"'\x03A8\x0391\x03A1\x039F pWd@2019'");
11571157
SQLWCHAR *grantQuery2= W(L"GRANT ALL ON t_bug28168 to "
11581158
L"'\x03A8\x0391\x03A1\x039F uid'@"
11591159
L"'%' identified by "
1160-
L"'\x03A8\x0391\x03A1\x039F pwd'");
1160+
L"'\x03A8\x0391\x03A1\x039F pWd@2019'");
11611161
SQLSMALLINT errmsglen;
11621162
SQLINTEGER native_error= 0;
11631163

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

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

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

0 commit comments

Comments
 (0)