osquery-1/osquery/database/plugins/tests/rocksdb_tests.cpp
Teddy Reed afd17f8134 1. Reorganize RocksDB database handle into a plugin
2. Introduce a SQLite-based database plugin
3. Refactor database usage to include local 'fast-calls'
4. Introduce an 'ephemeral' database plugin for testing (like a mock)
2016-03-06 20:40:16 -08:00

35 lines
1023 B
C++

/*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include <osquery/sql.h>
#include "osquery/database/tests/plugin_tests.h"
namespace osquery {
class RocksDBDatabasePluginTests : public DatabasePluginTests {
protected:
std::string name() override { return "rocksdb"; }
};
// Define the default set of database plugin operation tests.
CREATE_DATABASE_TESTS(RocksDBDatabasePluginTests);
TEST_F(RocksDBDatabasePluginTests, test_rocksdb_loglevel) {
// Make sure a log file was created.
EXPECT_FALSE(pathExists(path_ + "/LOG"));
// Make sure no log file is created.
// RocksDB logs are intercepted and forwarded to the GLog sink.
auto details = SQL::selectAllFrom("file", "path", EQUALS, path_ + "/LOG");
ASSERT_EQ(details.size(), 0U);
}
}