"Fossies" - the Fresh Open Source Software Archive

Member "osquery-4.3.0/tests/integration/tables/alf.cpp" (14 Apr 2020, 1276 Bytes) of package /linux/misc/osquery-4.3.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "alf.cpp": 4.0.2_vs_4.2.0.

    1 /**
    2  *  Copyright (c) 2014-present, Facebook, Inc.
    3  *  All rights reserved.
    4  *
    5  *  This source code is licensed in accordance with the terms specified in
    6  *  the LICENSE file found in the root directory of this source tree.
    7  */
    8 
    9 // Sanity check integration test for alf
   10 // Spec file: specs/darwin/alf.table
   11 
   12 #include <osquery/tests/integration/tables/helper.h>
   13 
   14 namespace osquery {
   15 namespace table_tests {
   16 
   17 class alf : public testing::Test {
   18  protected:
   19   void SetUp() override {
   20     setUpEnvironment();
   21   }
   22 };
   23 
   24 TEST_F(alf, test_sanity) {
   25   // 1. Query data
   26   auto const data = execute_query("select * from alf");
   27   // 2. Check size before validation
   28   // ASSERT_GE(data.size(), 0ul);
   29   // ASSERT_EQ(data.size(), 1ul);
   30   // ASSERT_EQ(data.size(), 0ul);
   31   // 3. Build validation map
   32   // See helper.h for avaialbe flags
   33   // Or use custom DataCheck object
   34   // ValidationMap row_map = {
   35   //      {"allow_signed_enabled", IntType}
   36   //      {"firewall_unload", IntType}
   37   //      {"global_state", IntType}
   38   //      {"logging_enabled", IntType}
   39   //      {"logging_option", IntType}
   40   //      {"stealth_enabled", IntType}
   41   //      {"version", NormalType}
   42   //}
   43   // 4. Perform validation
   44   // validate_rows(data, row_map);
   45 }
   46 
   47 } // namespace table_tests
   48 } // namespace osquery