forked from caoXF/curve
66 lines
2.1 KiB
C++
66 lines
2.1 KiB
C++
/*
|
|
* Copyright (c) 2020 NetEase Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
/*
|
|
* Project: curve
|
|
* File Created: Wednesday, 3rd October 2018 5:08:08 pm
|
|
* Author: tongguangxun
|
|
*/
|
|
|
|
#include <gflags/gflags.h>
|
|
#include <glog/logging.h>
|
|
#include <gmock/gmock.h>
|
|
#include <gtest/gtest.h>
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "test/integration/cluster_common/cluster.h"
|
|
|
|
std::string mdsMetaServerAddr = "127.0.0.1:9104"; // NOLINT
|
|
uint32_t segment_size = 1 * 1024 * 1024 * 1024ul; // NOLINT
|
|
uint32_t chunk_size = 4 * 1024 * 1024; // NOLINT
|
|
std::string configpath = "./test/client/configs/client.conf"; // NOLINT
|
|
|
|
const std::vector<std::string> clientConf {
|
|
std::string("mds.listen.addr=127.0.0.1:9104,127.0.0.1:9104"),
|
|
std::string("global.logPath=./runlog/"),
|
|
std::string("chunkserver.rpcTimeoutMS=1000"),
|
|
std::string("chunkserver.opMaxRetry=3"),
|
|
std::string("metacache.getLeaderRetry=3"),
|
|
std::string("metacache.getLeaderTimeOutMS=1000"),
|
|
std::string("global.fileMaxInFlightRPCNum=2048"),
|
|
std::string("metacache.rpcRetryIntervalUS=500"),
|
|
std::string("mds.rpcRetryIntervalUS=500"),
|
|
std::string("schedule.threadpoolSize=2"),
|
|
std::string("throttle.enable=true"),
|
|
};
|
|
|
|
int main(int argc, char** argv) {
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
::testing::InitGoogleMock(&argc, argv);
|
|
google::ParseCommandLineFlags(&argc, &argv, false);
|
|
|
|
curve::CurveCluster* cluster = new curve::CurveCluster();
|
|
|
|
cluster->PrepareConfig<curve::ClientConfigGenerator>(
|
|
configpath, clientConf);
|
|
|
|
int ret = RUN_ALL_TESTS();
|
|
|
|
return ret;
|
|
}
|