コード例 #1
0
ファイル: test_base.py プロジェクト: Yinkozi/osquery
    def __init__(self):
        global ARGS, CONFIG, CONFIG_DIR
        parser = argparse.ArgumentParser(
            description=("osquery python integration testing."))
        parser.add_argument("--config",
                            metavar="FILE",
                            default=None,
                            help="Use special options from a config.")
        parser.add_argument("--verbose",
                            default=False,
                            action="store_true",
                            help="Run daemons and extensions with --verbose")

        # Directory structure options
        parser.add_argument("--build",
                            metavar="PATH",
                            default=".",
                            help="Path to osquery build (./build/<sys>/).")
        ARGS = parser.parse_args()

        if not os.path.exists(ARGS.build):
            print("Cannot find --build: %s" % ARGS.build)
            print("You must first run: make")
            exit(1)

        # Write config
        random.seed(time.time())

        utils.reset_dir(CONFIG_DIR)
        CONFIG = read_config(ARGS.config) if ARGS.config else DEFAULT_CONFIG
コード例 #2
0
ファイル: test_base.py プロジェクト: zwass/osquery
    def __init__(self):
        global ARGS, CONFIG, CONFIG_DIR
        parser = argparse.ArgumentParser(description=(
            "osquery python integration testing."
        ))
        parser.add_argument(
            "--config", metavar="FILE", default=None,
            help="Use special options from a config."
        )
        parser.add_argument(
            "--verbose", default=False, action="store_true",
            help="Run daemons and extensions with --verbose"
        )

        # Directory structure options
        parser.add_argument(
            "--build", metavar="PATH", default=".",
            help="Path to osquery build (./build/<sys>/)."
        )
        ARGS = parser.parse_args()

        if not os.path.exists(ARGS.build):
            print("Cannot find --build: %s" % ARGS.build)
            print("You must first run: make")
            exit(1)

        # Write config
        random.seed(time.time())

        utils.reset_dir(CONFIG_DIR)
        CONFIG = read_config(ARGS.config) if ARGS.config else DEFAULT_CONFIG
コード例 #3
0
ファイル: test_base.py プロジェクト: zwass/osquery
def getTestDirectory(base):
    path = os.path.join(base, "test-dir" + str(random.randint(1000, 9999)))
    utils.reset_dir(path)
    return path
コード例 #4
0
ファイル: test_base.py プロジェクト: zwass/osquery
 def setUp(self):
     utils.reset_dir(CONFIG_DIR)
コード例 #5
0
ファイル: test_base.py プロジェクト: Yinkozi/osquery
def getTestDirectory(base):
    path = os.path.join(base, "test-dir" + str(random.randint(1000, 9999)))
    utils.reset_dir(path)
    return path
コード例 #6
0
ファイル: test_base.py プロジェクト: Yinkozi/osquery
 def setUp(self):
     utils.reset_dir(CONFIG_DIR)
コード例 #7
0
 def setUp(self):
     self.generators = []
     utils.reset_dir(TEMP_DIR)
コード例 #8
0
 def setUp(self):
     utils.reset_dir(TEMP_DIR)