def setUpClass(cls): cls.run_as_user = getpass.getuser() test_utils.connect_to_debugger() cls.test_base_path = tempfile.mkdtemp() cls.test_conf_path = os.path.join(cls.test_base_path, "etc", "agent.conf") conf_args = [ "-c", "Amazon", "-u", "http://doesntmatter.org/ws", "-p", cls.test_base_path, "-t", os.path.join(cls.test_base_path, "tmp"), "-C", "ws", "-U", cls.run_as_user, "-l", "/tmp/agent_status_test.log" ] rc = configure.main(conf_args) if rc != 0: raise Exception("We could not configure the test env")
def setUpClass(cls): cls.run_as_user = getpass.getuser() test_utils.connect_to_debugger() cls.test_base_path = tempfile.mkdtemp() cls.test_conf_path = os.path.join( cls.test_base_path, "etc", "agent.conf") conf_args = ["-c", "Other", "-u", "http://doesntmatter.org/ws", "-p", cls.test_base_path, "-t", os.path.join(cls.test_base_path, "tmp"), "-C", "ws", "-U", cls.run_as_user, "-l", "/tmp/agent_status_test.log"] rc = configure.main(conf_args) if rc != 0: raise Exception("We could not configure the test env")
def setUpClass(cls): cls.run_as_user = getpass.getuser() test_utils.connect_to_debugger() cls.test_base_path = tempfile.mkdtemp() cls.test_conf_path = os.path.join( cls.test_base_path, "etc", "agent.conf") conf_args = ["-c", "Other", "-u", "http://doesntmatter.org/ws", "-p", cls.test_base_path, "-t", os.path.join(cls.test_base_path, "tmp"), "-C", "ws", "-U", cls.run_as_user, "-l", "/tmp/agent_status_test.log", "--intrusion-detection-ossec", "true", "--install-extras", "--extra-package-location", os.environ['DCM_AGENT_TEST_EXTRA_PACKAGE_URL']] rc = configure.main(conf_args) if rc != 0: raise Exception("We could not configure the test env")
def setUpClass(cls): test_utils.connect_to_debugger() cls.run_as_user = getpass.getuser() cls.test_base_path = tempfile.mkdtemp() conf_args = [ "-c", "Amazon", "-u", "http://doesntmatter.org/ws", "-p", cls.test_base_path, "-t", os.path.join(cls.test_base_path, "tmp"), "-C", "success_tester", "-U", cls.run_as_user, "-l", "/tmp/agent_test_log.log" ] if 'DCM_AWS_EXTRAS_BUCKET' in os.environ: extras_repo = ("http://" + os.environ['DCM_AWS_EXTRAS_BUCKET'] + ".s3.amazonaws.com") conf_args.append("--extra-package-location") conf_args.append(extras_repo) if 'DCM_INSTALL_EXTRAS' in os.environ: conf_args.append("--install-extras") rc = configure.main(conf_args) if rc != 0: raise Exception("We could not configure the test env")
def setUpClass(cls): test_utils.connect_to_debugger() cls.run_as_user = getpass.getuser() cls.test_base_path = tempfile.mkdtemp() conf_args = ["-c", "Amazon", "-u", "http://doesntmatter.org/ws", "-p", cls.test_base_path, "-t", os.path.join(cls.test_base_path, "tmp"), "-C", "success_tester", "-U", cls.run_as_user, "-l", "/tmp/agent_test_log.log"] if 'DCM_AWS_EXTRAS_BUCKET' in os.environ: extras_repo = ("http://" + os.environ['DCM_AWS_EXTRAS_BUCKET'] + ".s3.amazonaws.com") conf_args.append("--extra-package-location") conf_args.append(extras_repo) if 'DCM_INSTALL_EXTRAS' in os.environ: conf_args.append("--install-extras") rc = configure.main(conf_args) if rc != 0: raise Exception("We could not configure the test env")
def setUpClass(cls): test_utils.connect_to_debugger()
def setUp(self): test_utils.connect_to_debugger() self.alert_sender = MagicMock() with open("/tmp/alerts.log", "w") as f: f.writelines(TEST_STRING_LONG)
def setUpClass(cls): test_utils.connect_to_debugger() cls.conf = config.AgentConfig([])