16 #include <gtest/gtest.h>
17 #include <gutil/strings/substitute.h>
22 using namespace strings;
26 const string& expected_error) {
28 string namenode = HdfsFsCache::GetNameNodeFromPath(path, &err);
30 EXPECT_EQ(namenode, expected_namenode);
32 EXPECT_EQ(err, expected_error);
36 TEST(HdfsFsCacheTest, Basic) {
39 string(
"hdfs://localhost:25000/"),
string(
""));
41 string(
"hdfs://nameservice1/"),
string(
""));
43 string(
"s3a://hdfsbucket/"),
string(
""));
48 ValidateNameNode(
string(
"file:///usr/hive"),
string(
"file:///"),
string(
""));
55 string path(
"://usr/hive");
57 Substitute(
"Path missing scheme: $0", path));
58 path = string(
"hdfs://test_invalid_path");
60 Substitute(
"Path missing '/' after authority: $0", path));
65 int main(
int argc,
char **argv) {
66 ::testing::InitGoogleTest(&argc, argv);
67 return RUN_ALL_TESTS();
string path("/usr/lib/sasl2:/usr/lib64/sasl2:/usr/local/lib/sasl2:/usr/lib/x86_64-linux-gnu/sasl2")
TEST(HdfsFsCacheTest, Basic)
void ValidateNameNode(const string &path, const string &expected_namenode, const string &expected_error)
int main(int argc, char **argv)