Esempio n. 1
0
    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
Esempio n. 2
0
    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
Esempio n. 3
0
def getTestDirectory(base):
    path = os.path.join(base, "test-dir" + str(random.randint(1000, 9999)))
    utils.reset_dir(path)
    return path
Esempio n. 4
0
 def setUp(self):
     utils.reset_dir(CONFIG_DIR)
Esempio n. 5
0
def getTestDirectory(base):
    path = os.path.join(base, "test-dir" + str(random.randint(1000, 9999)))
    utils.reset_dir(path)
    return path
Esempio n. 6
0
 def setUp(self):
     utils.reset_dir(CONFIG_DIR)
Esempio n. 7
0
 def setUp(self):
     self.generators = []
     utils.reset_dir(TEMP_DIR)
Esempio n. 8
0
 def setUp(self):
     utils.reset_dir(TEMP_DIR)