Commit fab265c4 authored by Sarah Clark's avatar Sarah Clark
Browse files

routersploit: enable testing

parent b8337266
Loading
Loading
Loading
Loading
+34 −10
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  python3,
}:
@@ -17,17 +18,19 @@ python3.pkgs.buildPythonApplication (finalAttrs: {

  build-system = with python3.pkgs; [ setuptools ];

  dependencies = with python3.pkgs; [
  dependencies =
    with python3.pkgs;
    [
      paramiko
      pycryptodome
      pysnmp
      requests
      setuptools
    ]
    ++ lib.optionals (pythonAtLeast "3.13") [
      standard-telnetlib
    ];

  # Tests are out-dated and support for newer pysnmp is not implemented yet
  doCheck = false;

  nativeCheckInputs = with python3.pkgs; [
    pytest-xdist
    pytestCheckHook
@@ -47,6 +50,27 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
    "tests/test_module_info.py"
  ];

  disabledTests = [
    # AttributeError: module 'paramiko' has no attribute 'DSSKey'.
    "test_exploit_empty_response"
    "test_exploit_error_response"
    "test_exploit_not_found_response"
    "test_exploit_redirect_response"
    "test_exploit_trash_response"

    # Runs substantially slower, making this test flaky
    "test_exploit_timeout_response"
  ]
  ++ lib.optionals stdenv.hostPlatform.isDarwin [
    # port conflict when running simultaneous builds
    "test_http_scenario_service_empty_response"
    "test_http_scenario_service_error"
    "test_http_scenario_service_found"
    "test_http_scenario_service_not_found"
    "test_http_scenario_service_redirect"
    "test_http_scenario_service_trash"
  ];

  meta = {
    description = "Exploitation Framework for Embedded Devices";
    homepage = "https://github.com/threat9/routersploit";