"Fossies" - the Fresh Open Source Software Archive

Member "osquery-4.3.0/tests/integration/tables/asl.cpp" (14 Apr 2020, 1122 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. For more information about "asl.cpp" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 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 asl
   10 // Spec file: specs/darwin/asl.table
   11 
   12 #include <osquery/tests/integration/tables/helper.h>
   13 
   14 namespace osquery {
   15 namespace table_tests {
   16 
   17 class asl : public testing::Test {
   18  protected:
   19   void SetUp() override {
   20     setUpEnvironment();
   21   }
   22 };
   23 
   24 TEST_F(asl, test_sanity) {
   25   ValidationMap row_map = {
   26       {"time", IntType},
   27       {"time_nano_sec", IntType},
   28       {"host", NormalType},
   29       {"sender", NormalType},
   30       {"facility", NormalType},
   31       {"pid", IntType},
   32       {"gid", IntType},
   33       {"uid", IntType},
   34       {"level", IntType},
   35       {"message", NormalType},
   36       {"ref_pid", IntOrEmpty},
   37       {"ref_proc", NormalType},
   38       {"extra", NormalType},
   39   };
   40 
   41   auto const data = execute_query("select * from asl limit 1");
   42   ASSERT_FALSE(data.empty());
   43   validate_rows(data, row_map);
   44 }
   45 
   46 } // namespace table_tests
   47 } // namespace osquery