You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-3494: initial commit of test program to verify storagemanager.cnf during postConfigure.
This commit is contained in:
@ -5429,6 +5429,12 @@ bool storageSetup(bool amazonInstall)
|
||||
hdfs = false;
|
||||
sysConfig->setConfig("StorageManager", "Enabled", "Y");
|
||||
sysConfig->setConfig("SystemConfig", "DataFilePlugin", "libcloudio.so");
|
||||
// Verify S3 Configuration settings
|
||||
if (system("testS3Connection"))
|
||||
{
|
||||
cout << "ERROR: S3Storage Configuration check failed. Verify storagemanager.cnf settings and rerun postConfigure." << endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -75,6 +75,11 @@ target_compile_definitions(unit_tests PUBLIC BOOST_NO_CXX11_SCOPED_ENUMS)
|
||||
target_link_libraries(unit_tests storagemanager)
|
||||
set_property(TARGET unit_tests PROPERTY CXX_STANDARD 11)
|
||||
|
||||
add_executable(testS3Connection src/testS3Connection.cpp)
|
||||
target_compile_definitions(testS3Connection PUBLIC BOOST_NO_CXX11_SCOPED_ENUMS)
|
||||
target_link_libraries(testS3Connection storagemanager)
|
||||
set_property(TARGET testS3Connection PROPERTY CXX_STANDARD 11)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${TMPDIR})
|
||||
|
||||
add_custom_command(
|
||||
@ -129,7 +134,7 @@ install(TARGETS storagemanager
|
||||
COMPONENT columnstore-platform
|
||||
)
|
||||
|
||||
install(TARGETS StorageManager smcat smput smls smrm
|
||||
install(TARGETS StorageManager smcat smput smls smrm testS3Connection
|
||||
RUNTIME DESTINATION ${ENGINE_BINDIR}
|
||||
COMPONENT columnstore-platform
|
||||
)
|
||||
|
68
storage-manager/src/testS3Connection.cpp
Normal file
68
storage-manager/src/testS3Connection.cpp
Normal file
@ -0,0 +1,68 @@
|
||||
/* Copyright (C) 2020 MariaDB Corporation
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; version 2 of
|
||||
the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include "S3Storage.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
using namespace storagemanager;
|
||||
using namespace std;
|
||||
|
||||
void printUsage() {
|
||||
cout << "MariaDB Columnstore Storage Manager Test Configuration Connectivity.\n" << endl;
|
||||
cout << "Usage: testS3Connection \n" << endl;
|
||||
cout << "Returns Success=0 Failure=1\n" << endl;
|
||||
}
|
||||
int s3TestConnection()
|
||||
{
|
||||
S3Storage* s3 = NULL;
|
||||
int ret = 0;
|
||||
try
|
||||
{
|
||||
S3Storage* s3 = new S3Storage();
|
||||
cout << "S3 Storage Manager Configuration OK" << endl;
|
||||
delete s3;
|
||||
}
|
||||
catch (exception &e)
|
||||
{
|
||||
cout << "S3 Storage Manager Configuration Error:" << endl;
|
||||
cout << e.what() << endl;
|
||||
if (s3)
|
||||
delete s3;
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int option;
|
||||
while ((option = getopt(argc, argv, "h")) != EOF )
|
||||
{
|
||||
switch (option)
|
||||
{
|
||||
case 'h':
|
||||
default:
|
||||
printUsage();
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return s3TestConnection();
|
||||
}
|
Reference in New Issue
Block a user