Пример #1
0
def test_bulk_discovery_start_with_defaults(web, local_test_hosts):  # noqa: F811 # pylint: disable=redefined-outer-name
    result = web.bulk_discovery_start({
        "hostnames": ["test-host"],
    })
    assert result["started"] is True

    _wait_for_bulk_discovery_job(web)

    status = web.bulk_discovery_status()
    assert status["is_active"] is False
    assert status["job"]["state"] == "finished"
    assert "discovery successful" in status["job"]["result_msg"]
    assert "discovery started" in status["job"]["output"]
    assert "test-host: discovery successful" in status["job"]["output"]
Пример #2
0
def test_bulk_discovery_start_multiple_with_subdir(web, local_test_hosts):
    result = web.bulk_discovery_start({
        "hostnames": ["test-host", "test-host2"],
        "mode": "new",
        "use_cache": True,
        "do_scan": True,
        "bulk_size": 5,
        "ignore_single_check_errors": True,
    })
    assert result["started"] is True

    _wait_for_bulk_discovery_job(web)

    status = web.bulk_discovery_status()
    assert status["is_active"] is False
    assert status["job"]["state"] == "finished"
Пример #3
0
def test_bulk_discovery_start_with_parameters(web, local_test_hosts):  # noqa: F811 # pylint: disable=redefined-outer-name
    result = web.bulk_discovery_start({
        "hostnames": ["test-host"],
        "mode": "new",
        "use_cache": True,
        "do_scan": True,
        "bulk_size": 5,
        "ignore_single_check_errors": True,
    })
    assert result["started"] is True

    _wait_for_bulk_discovery_job(web)

    status = web.bulk_discovery_status()
    assert status["is_active"] is False
    assert status["job"]["state"] == "finished"
Пример #4
0
def test_bulk_discovery_start_with_defaults(web, local_test_hosts):
    result = web.bulk_discovery_start({
        "hostnames": ["test-host"],
    })
    assert result["started"] is True

    _wait_for_bulk_discovery_job(web)

    status = web.bulk_discovery_status()
    assert status["is_running"] is False
    assert status["job"]["state"] == "finished"
    assert "discovery successful" in status["job"]["result_msg"]
    assert "discovery started" in status["job"]["output"]
    assert "test-host: discovery successful" in status["job"]["output"]
    assert "65 added" in status["job"]["output"]
    assert "discovery successful" in status["job"]["output"]
Пример #5
0
def test_bulk_discovery_start_with_defaults(web, local_test_hosts):  # noqa: F811 # pylint: disable=redefined-outer-name
    result = web.bulk_discovery_start({
        "hostnames": ["test-host"],
    })
    assert result["started"] is True

    _wait_for_bulk_discovery_job(web)

    status = web.bulk_discovery_status()
    assert status["is_active"] is False
    assert status["job"]["state"] == "finished"
    assert "discovery successful" in status["job"]["result_msg"]
    assert "discovery started" in status["job"]["output"]
    assert "test-host: discovery successful" in status["job"]["output"]
    # FIXME:
    #   There are supposed to be 63 services to be discovered. Due to the ongoing migration
    #   however, the services in testlib.base:KNOWN_AUTO_MIGRATION_FAILURES can't be detected
    #   right now. Please add the 63 in here once KNOWN_AUTO_MIGRATION_FAILURES is empty.
    assert "47 added" in status["job"]["output"]
    assert "discovery successful" in status["job"]["output"]
Пример #6
0
 def job_completed():
     status = web.bulk_discovery_status()
     return status["job"]["state"] != "initialized" and status[
         "is_active"] is False