Beispiel #1
0
from grr.endtoend_tests import base
from grr.lib import access_control
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import flags
from grr.lib import startup


flags.DEFINE_bool("local_client", True,
                  "The target client(s) are running locally.")

flags.DEFINE_bool("local_worker", False,
                  "Run tests with a local worker.")

flags.DEFINE_list("client_ids", [],
                  "List of client ids to test. If unset we use "
                  "Test.end_to_end_client_ids from the config.")

flags.DEFINE_list("hostnames", [],
                  "List of client hostnames to test. If unset we use "
                  "Test.end_to_end_client_hostnames from the config.")

flags.DEFINE_list("testnames", [],
                  "List of test names to run. If unset we run all "
                  "relevant tests.")


def RunEndToEndTests():
  runner = unittest.TextTestRunner()

  # We are running a test so let the config system know that.
Beispiel #2
0
from grr.server import data_store
from grr.server import email_alerts
from grr.server import flow
from grr.server.aff4_objects import aff4_grr
from grr.server.aff4_objects import filestore
from grr.server.aff4_objects import users

from grr.server.flows.general import audit
from grr.server.flows.general import discovery
from grr.server.hunts import results as hunts_results

from grr.test_lib import testing_startup

flags.DEFINE_list(
    "tests",
    None,
    help=("Test module to run. If not specified we run"
          "All modules in the test suite."))

flags.DEFINE_list("labels", ["small"],
                  "A list of test labels to run. (e.g. benchmarks,small).")

flags.DEFINE_string(
    "profile", "", "If set, the test is run using cProfile, storing the "
    "resulting profile data in the given filename. Running multiple tests"
    "will overwrite this file so --tests should be used to limit this to a"
    "single test.")

FIXED_TIME = rdfvalue.RDFDatetime.Now() - rdfvalue.Duration("8d")

Beispiel #3
0
from grr.gui import tests
from grr.lib import flags
from grr.lib import test_lib
from grr.lib import tests
from grr.lib import utils
from grr.parsers import tests
from grr.path_detection import tests
from grr.server import tests
from grr.worker import worker_test
# pylint: enable=unused-import,g-bad-import-order

flags.DEFINE_string("output", None,
                    "The name of the file we write on (default stderr).")

flags.DEFINE_list("exclude_tests", [],
                  "A comma-separated list of tests to exclude form running.")

flags.DEFINE_integer("processes", 0,
                     "Total number of simultaneous tests to run.")


class Colorizer(object):
    """A Class which wraps a string with colors."""

    COLORS = "BLACK BLUE GREEN CYAN RED MAGENTA YELLOW WHITE"
    COLOR_MAP = dict([(x, i) for i, x in enumerate(COLORS.split())])

    terminal_capable = False

    def __init__(self, stream=None):
        if stream is None:
Beispiel #4
0
from grr.server.grr_response_server import data_store
from grr.server.grr_response_server import maintenance_utils
from grr.server.grr_response_server import server_startup
from grr_response_test.end_to_end_tests import test_base
# pylint: disable=unused-import
from grr_response_test.end_to_end_tests import tests
# pylint: enable=unused-import

flags.DEFINE_string("api_endpoint", "http://localhost:8000",
                    "GRR API endpoint.")

flags.DEFINE_string("api_user", "admin", "Username for GRR API.")

flags.DEFINE_string("api_password", "", "Password for GRR API.")

flags.DEFINE_list("client_ids", [], "List of client ids to test.")

flags.DEFINE_list("hostnames", [], "List of client hostnames to test.")

flags.DEFINE_list(
    "testnames", [], "List of test cases to run. If unset we run all "
    "tests for a client's platform.")

# We use a logging Filter to exclude noisy unwanted log output.
flags.DEFINE_list("filenames_excluded_from_log", ["connectionpool.py"],
                  "Files whose log messages won't get printed.")

flags.DEFINE_bool("upload_test_binaries", True,
                  "Whether to upload executables needed by some e2e tests.")