arachni 1.2.1 → 1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +66 -0
- data/Gemfile +1 -1
- data/README.md +16 -5
- data/components/checks/active/ldap_injection/errors.txt +1 -0
- data/components/checks/active/source_code_disclosure.rb +1 -1
- data/components/checks/active/unvalidated_redirect.rb +6 -6
- data/components/checks/active/unvalidated_redirect_dom.rb +10 -7
- data/components/checks/passive/grep/captcha.rb +14 -5
- data/components/checks/passive/grep/form_upload.rb +7 -3
- data/components/checks/passive/grep/hsts.rb +3 -3
- data/components/checks/passive/grep/html_objects.rb +2 -3
- data/components/checks/passive/grep/http_only_cookies.rb +2 -3
- data/components/checks/passive/grep/insecure_cookies.rb +1 -1
- data/components/checks/passive/grep/password_autocomplete.rb +2 -2
- data/components/checks/passive/grep/unencrypted_password_forms.rb +7 -7
- data/components/checks/passive/grep/x_frame_options.rb +2 -2
- data/components/checks/passive/http_put.rb +2 -3
- data/components/path_extractors/comments.rb +3 -3
- data/components/path_extractors/scripts.rb +10 -1
- data/components/plugins/defaults/autothrottle.rb +27 -18
- data/components/plugins/defaults/meta/remedies/discovery.rb +30 -33
- data/components/plugins/defaults/meta/remedies/timing_attacks.rb +7 -11
- data/components/plugins/login_script.rb +9 -3
- data/components/plugins/proxy.rb +4 -3
- data/components/reporters/html.rb +11 -14
- data/components/reporters/html/default/issue.erb +13 -38
- data/components/reporters/html/default/issue/info.erb +1 -1
- data/components/reporters/html/default/summary/issues/by_name.erb +3 -3
- data/components/reporters/stdout.rb +62 -71
- data/components/reporters/xml.rb +26 -40
- data/components/reporters/xml/schema.xsd +43 -89
- data/lib/arachni/browser.rb +52 -3
- data/lib/arachni/browser/javascript.rb +3 -3
- data/lib/arachni/browser/javascript/scripts/taint_tracer.js +46 -25
- data/lib/arachni/browser_cluster.rb +61 -0
- data/lib/arachni/browser_cluster/job.rb +21 -1
- data/lib/arachni/browser_cluster/jobs/browser_provider.rb +3 -1
- data/lib/arachni/browser_cluster/jobs/resource_exploration.rb +2 -1
- data/lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb +2 -1
- data/lib/arachni/browser_cluster/jobs/taint_trace.rb +3 -2
- data/lib/arachni/browser_cluster/jobs/taint_trace/event_trigger.rb +1 -1
- data/lib/arachni/browser_cluster/worker.rb +5 -0
- data/lib/arachni/check/auditor.rb +22 -12
- data/lib/arachni/data/framework.rb +13 -1
- data/lib/arachni/data/issues.rb +9 -25
- data/lib/arachni/element/base.rb +9 -3
- data/lib/arachni/element/capabilities/analyzable.rb +2 -6
- data/lib/arachni/element/capabilities/analyzable/differential.rb +24 -7
- data/lib/arachni/element/capabilities/analyzable/{taint.rb → signature.rb} +23 -23
- data/lib/arachni/element/capabilities/auditable.rb +0 -6
- data/lib/arachni/element/capabilities/dom_only.rb +61 -0
- data/lib/arachni/element/capabilities/with_dom.rb +3 -1
- data/lib/arachni/element/cookie.rb +35 -5
- data/lib/arachni/element/cookie/dom.rb +13 -4
- data/lib/arachni/element/{capabilities/auditable/dom.rb → dom.rb} +20 -68
- data/lib/arachni/element/dom/capabilities/auditable.rb +29 -0
- data/lib/arachni/element/dom/capabilities/inputtable.rb +27 -0
- data/lib/arachni/element/dom/capabilities/mutable.rb +21 -0
- data/lib/arachni/element/dom/capabilities/submittable.rb +52 -0
- data/lib/arachni/element/form.rb +12 -1
- data/lib/arachni/element/form/capabilities/mutable.rb +2 -1
- data/lib/arachni/element/form/capabilities/with_dom.rb +0 -1
- data/lib/arachni/element/form/dom.rb +9 -3
- data/lib/arachni/element/header.rb +14 -33
- data/lib/arachni/element/header/capabilities/inputtable.rb +29 -0
- data/lib/arachni/element/header/capabilities/mutable.rb +51 -0
- data/lib/arachni/element/input/dom.rb +71 -0
- data/lib/arachni/element/json.rb +2 -0
- data/lib/arachni/element/link.rb +3 -0
- data/lib/arachni/element/link/capabilities/with_dom.rb +0 -1
- data/lib/arachni/element/link/dom.rb +16 -3
- data/lib/arachni/element/link/dom/capabilities/submittable.rb +29 -0
- data/lib/arachni/element/link_template.rb +3 -5
- data/lib/arachni/element/link_template/capabilities/inputtable.rb +5 -0
- data/lib/arachni/element/link_template/capabilities/with_dom.rb +0 -1
- data/lib/arachni/element/link_template/dom.rb +16 -3
- data/lib/arachni/element/link_template/dom/capabilities/submittable.rb +29 -0
- data/lib/arachni/element/server.rb +3 -5
- data/lib/arachni/element/ui_form.rb +106 -0
- data/lib/arachni/element/ui_form/dom.rb +107 -0
- data/lib/arachni/element/ui_input.rb +62 -0
- data/lib/arachni/element/xml.rb +2 -1
- data/lib/arachni/framework.rb +7 -5
- data/lib/arachni/framework/parts/audit.rb +0 -1
- data/lib/arachni/framework/parts/check.rb +1 -0
- data/lib/arachni/framework/parts/data.rb +4 -0
- data/lib/arachni/framework/parts/state.rb +0 -2
- data/lib/arachni/http/client.rb +17 -6
- data/lib/arachni/http/proxy_server.rb +52 -5
- data/lib/arachni/http/request.rb +1 -1
- data/lib/arachni/issue.rb +34 -179
- data/lib/arachni/issue/severity.rb +2 -0
- data/lib/arachni/option_groups/audit.rb +22 -2
- data/lib/arachni/option_groups/browser_cluster.rb +15 -0
- data/lib/arachni/page.rb +3 -2
- data/lib/arachni/parser.rb +24 -5
- data/lib/arachni/platform/manager.rb +1 -2
- data/lib/arachni/rpc/server/framework.rb +3 -4
- data/lib/arachni/rpc/server/framework/multi_instance.rb +2 -1
- data/lib/arachni/session.rb +1 -1
- data/lib/arachni/trainer.rb +4 -7
- data/lib/arachni/watir/element.rb +12 -1
- data/lib/version +1 -1
- data/spec/arachni/browser/element_locator_spec.rb +43 -43
- data/spec/arachni/browser/javascript/dom_monitor_spec.rb +44 -44
- data/spec/arachni/browser/javascript/proxy/stub_spec.rb +17 -14
- data/spec/arachni/browser/javascript/proxy_spec.rb +24 -24
- data/spec/arachni/browser/javascript/taint_tracer/frame/called_function_spec.rb +11 -11
- data/spec/arachni/browser/javascript/taint_tracer/frame_spec.rb +7 -7
- data/spec/arachni/browser/javascript/taint_tracer/sink/data_flow_spec.rb +13 -13
- data/spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb +7 -7
- data/spec/arachni/browser/javascript/taint_tracer_spec.rb +568 -558
- data/spec/arachni/browser/javascript_spec.rb +73 -63
- data/spec/arachni/browser_cluster/job/result_spec.rb +3 -3
- data/spec/arachni/browser_cluster/job_spec.rb +68 -48
- data/spec/arachni/browser_cluster/jobs/resource_exploration/event_trigger/result_spec.rb +2 -2
- data/spec/arachni/browser_cluster/jobs/resource_exploration/event_trigger_spec.rb +5 -4
- data/spec/arachni/browser_cluster/jobs/resource_exploration/result_spec.rb +2 -2
- data/spec/arachni/browser_cluster/jobs/resource_exploration_spec.rb +5 -5
- data/spec/arachni/browser_cluster/worker_spec.rb +87 -70
- data/spec/arachni/browser_cluster_spec.rb +64 -39
- data/spec/arachni/browser_spec.rb +692 -527
- data/spec/arachni/check/auditor_spec.rb +177 -147
- data/spec/arachni/check/base_spec.rb +33 -33
- data/spec/arachni/check/manager_spec.rb +15 -15
- data/spec/arachni/component/base_spec.rb +8 -8
- data/spec/arachni/component/manager_spec.rb +100 -99
- data/spec/arachni/component/options/address_spec.rb +3 -3
- data/spec/arachni/component/options/base_spec.rb +7 -7
- data/spec/arachni/component/options/bool_spec.rb +9 -9
- data/spec/arachni/component/options/float_spec.rb +6 -6
- data/spec/arachni/component/options/int_spec.rb +5 -5
- data/spec/arachni/component/options/multiple_choice_spec.rb +12 -12
- data/spec/arachni/component/options/object_spec.rb +2 -2
- data/spec/arachni/component/options/path_spec.rb +3 -3
- data/spec/arachni/component/options/port_spec.rb +5 -5
- data/spec/arachni/component/options/string_spec.rb +3 -3
- data/spec/arachni/component/options/url_spec.rb +4 -4
- data/spec/arachni/component/utilities_spec.rb +2 -2
- data/spec/arachni/data/framework/rpc_spec.rb +10 -9
- data/spec/arachni/data/framework_spec.rb +65 -46
- data/spec/arachni/data/issues_spec.rb +39 -77
- data/spec/arachni/data/plugins_spec.rb +11 -11
- data/spec/arachni/data/session_spec.rb +6 -6
- data/spec/arachni/data_spec.rb +8 -8
- data/spec/arachni/element/body_spec.rb +10 -10
- data/spec/arachni/element/capabilities/analyzable/differential_spec.rb +39 -21
- data/spec/arachni/element/capabilities/analyzable/{taint_spec.rb → signature_spec.rb} +63 -63
- data/spec/arachni/element/capabilities/analyzable/timeout_spec.rb +51 -51
- data/spec/arachni/element/capabilities/with_scope/scope_spec.rb +5 -5
- data/spec/arachni/element/cookie/dom_spec.rb +37 -18
- data/spec/arachni/element/cookie_spec.rb +206 -139
- data/spec/arachni/element/form/dom_spec.rb +36 -19
- data/spec/arachni/element/form_spec.rb +210 -187
- data/spec/arachni/element/generic_dom_spec.rb +14 -14
- data/spec/arachni/element/header_spec.rb +35 -17
- data/spec/arachni/element/json_spec.rb +53 -31
- data/spec/arachni/element/link/dom_spec.rb +46 -28
- data/spec/arachni/element/link_spec.rb +58 -40
- data/spec/arachni/element/link_template/dom_spec.rb +47 -29
- data/spec/arachni/element/link_template_spec.rb +79 -61
- data/spec/arachni/element/path_spec.rb +1 -1
- data/spec/arachni/element/server_spec.rb +33 -32
- data/spec/arachni/element/ui_form/ui_form_dom_spec.rb +164 -0
- data/spec/arachni/element/ui_form_spec.rb +242 -0
- data/spec/arachni/element/ui_input/dom_spec.rb +157 -0
- data/spec/arachni/element/ui_input_spec.rb +136 -0
- data/spec/arachni/element/xml_spec.rb +42 -24
- data/spec/arachni/element_filter_spec.rb +49 -48
- data/spec/arachni/error_spec.rb +3 -3
- data/spec/arachni/framework/parts/audit_spec.rb +64 -63
- data/spec/arachni/framework/parts/browser_spec.rb +16 -16
- data/spec/arachni/framework/parts/check_spec.rb +3 -3
- data/spec/arachni/framework/parts/data_spec.rb +48 -48
- data/spec/arachni/framework/parts/platform_spec.rb +3 -3
- data/spec/arachni/framework/parts/plugin_spec.rb +7 -6
- data/spec/arachni/framework/parts/report_spec.rb +7 -7
- data/spec/arachni/framework/parts/scope_spec.rb +16 -16
- data/spec/arachni/framework/parts/state_spec.rb +68 -69
- data/spec/arachni/framework_spec.rb +39 -31
- data/spec/arachni/http/client/dynamic_404_handlers_spec.rb +32 -32
- data/spec/arachni/http/client_spec.rb +219 -208
- data/spec/arachni/http/cookie_jar_spec.rb +72 -72
- data/spec/arachni/http/headers_spec.rb +14 -14
- data/spec/arachni/http/proxy_server_spec.rb +43 -42
- data/spec/arachni/http/request_spec.rb +105 -103
- data/spec/arachni/http/response/scope_spec.rb +24 -24
- data/spec/arachni/http/response_spec.rb +50 -49
- data/spec/arachni/issue/severity_spec.rb +10 -9
- data/spec/arachni/issue_spec.rb +71 -369
- data/spec/arachni/option_groups/audit_spec.rb +114 -114
- data/spec/arachni/option_groups/browser_cluster_spec.rb +20 -3
- data/spec/arachni/option_groups/datastore_spec.rb +6 -6
- data/spec/arachni/option_groups/dispatcher_spec.rb +19 -19
- data/spec/arachni/option_groups/http_spec.rb +11 -11
- data/spec/arachni/option_groups/input_spec.rb +31 -27
- data/spec/arachni/option_groups/output_spec.rb +2 -2
- data/spec/arachni/option_groups/paths_spec.rb +17 -17
- data/spec/arachni/option_groups/rpc_spec.rb +2 -2
- data/spec/arachni/option_groups/scope_spec.rb +40 -40
- data/spec/arachni/option_groups/session_spec.rb +6 -5
- data/spec/arachni/option_groups/snapshot_spec.rb +4 -4
- data/spec/arachni/options_spec.rb +46 -45
- data/spec/arachni/page/dom/transition_spec.rb +74 -72
- data/spec/arachni/page/dom_spec.rb +35 -35
- data/spec/arachni/page/scope_spec.rb +15 -15
- data/spec/arachni/page_spec.rb +217 -217
- data/spec/arachni/parser_spec.rb +106 -104
- data/spec/arachni/platform/fingerprinter_spec.rb +17 -14
- data/spec/arachni/platform/list_spec.rb +33 -33
- data/spec/arachni/platform/manager_spec.rb +67 -64
- data/spec/arachni/plugin/base_spec.rb +10 -10
- data/spec/arachni/plugin/manager_spec.rb +38 -37
- data/spec/arachni/report_spec.rb +43 -40
- data/spec/arachni/reporter/base_spec.rb +15 -15
- data/spec/arachni/reporter/manager_spec.rb +4 -4
- data/spec/arachni/reporter/options_spec.rb +6 -6
- data/spec/arachni/rpc/client/base_spec.rb +6 -6
- data/spec/arachni/rpc/client/dispatcher_spec.rb +2 -2
- data/spec/arachni/rpc/client/instance_spec.rb +6 -6
- data/spec/arachni/rpc/server/active_options_spec.rb +11 -8
- data/spec/arachni/rpc/server/base_spec.rb +5 -5
- data/spec/arachni/rpc/server/checks/manager_spec.rb +8 -8
- data/spec/arachni/rpc/server/dispatcher/node_spec.rb +37 -37
- data/spec/arachni/rpc/server/dispatcher/service_spec.rb +15 -14
- data/spec/arachni/rpc/server/dispatcher_spec.rb +36 -35
- data/spec/arachni/rpc/server/framework/distributor_spec.rb +36 -36
- data/spec/arachni/rpc/server/framework_multi_spec.rb +340 -336
- data/spec/arachni/rpc/server/framework_spec.rb +90 -85
- data/spec/arachni/rpc/server/instance_spec.rb +126 -107
- data/spec/arachni/rpc/server/output_spec.rb +1 -1
- data/spec/arachni/rpc/server/plugin/manager_spec.rb +6 -6
- data/spec/arachni/ruby/array_spec.rb +42 -42
- data/spec/arachni/ruby/hash_spec.rb +20 -18
- data/spec/arachni/ruby/io_spec.rb +2 -2
- data/spec/arachni/ruby/object_spec.rb +1 -1
- data/spec/arachni/ruby/set_spec.rb +3 -3
- data/spec/arachni/ruby/string_spec.rb +30 -30
- data/spec/arachni/ruby/webrick_spec.rb +2 -2
- data/spec/arachni/scope_spec.rb +1 -1
- data/spec/arachni/session_spec.rb +67 -64
- data/spec/arachni/snapshot_spec.rb +15 -15
- data/spec/arachni/state/audit_spec.rb +11 -11
- data/spec/arachni/state/element_filter_spec.rb +6 -6
- data/spec/arachni/state/framework/rpc_spec.rb +12 -12
- data/spec/arachni/state/framework_spec.rb +125 -121
- data/spec/arachni/state/http_spec.rb +7 -7
- data/spec/arachni/state/options_spec.rb +7 -7
- data/spec/arachni/state/plugins_spec.rb +8 -8
- data/spec/arachni/state_spec.rb +10 -10
- data/spec/arachni/support/buffer/autoflush_spec.rb +16 -16
- data/spec/arachni/support/buffer/base_spec.rb +39 -39
- data/spec/arachni/support/cache/least_cost_replacement_spec.rb +18 -18
- data/spec/arachni/support/cache/least_recently_pushed_spec.rb +24 -24
- data/spec/arachni/support/cache/least_recently_used_spec.rb +20 -20
- data/spec/arachni/support/cache/preference_spec.rb +4 -4
- data/spec/arachni/support/cache/random_replacement_spec.rb +8 -8
- data/spec/arachni/support/crypto/rsa_aes_cbc_spec.rb +1 -1
- data/spec/arachni/support/database/hash_spec.rb +44 -43
- data/spec/arachni/support/database/queue_spec.rb +27 -27
- data/spec/arachni/support/lookup/hash_set_spec.rb +8 -8
- data/spec/arachni/support/lookup/moolb_spec.rb +3 -3
- data/spec/arachni/support/mixins/observable_spec.rb +6 -6
- data/spec/arachni/support/signature_spec.rb +19 -19
- data/spec/arachni/trainer_spec.rb +39 -39
- data/spec/arachni/typhoeus/hydra_spec.rb +2 -2
- data/spec/arachni/uri/scope_spec.rb +66 -66
- data/spec/arachni/uri_spec.rb +107 -105
- data/spec/arachni/utilities_spec.rb +40 -40
- data/spec/components/checks/active/csrf_spec.rb +8 -8
- data/spec/components/checks/active/no_sql_injection_spec.rb +1 -1
- data/spec/components/checks/active/sql_injection_spec.rb +16 -16
- data/spec/components/checks/active/trainer_spec.rb +4 -4
- data/spec/components/checks/active/unvalidated_redirect_dom_spec.rb +4 -2
- data/spec/components/checks/active/xpath_injection_spec.rb +1 -1
- data/spec/components/checks/active/xss_dom_script_context_spec.rb +51 -21
- data/spec/components/checks/active/xss_dom_spec.rb +46 -24
- data/spec/components/checks/passive/allowed_methods_spec.rb +1 -1
- data/spec/components/checks/passive/grep/cookie_set_for_parent_domain_spec.rb +1 -1
- data/spec/components/checks/passive/grep/hsts_spec.rb +2 -2
- data/spec/components/checks/passive/grep/http_only_cookies_spec.rb +1 -1
- data/spec/components/checks/passive/grep/insecure_cookies_spec.rb +1 -1
- data/spec/components/checks/passive/grep/insecure_cors_policy_spec.rb +2 -2
- data/spec/components/checks/passive/grep/password_autocomplete_spec.rb +1 -1
- data/spec/components/checks/passive/grep/private_ip_spec.rb +3 -3
- data/spec/components/checks/passive/grep/unencrypted_password_forms_spec.rb +1 -1
- data/spec/components/checks/passive/grep/x_frame_options_spec.rb +2 -2
- data/spec/components/checks/passive/interesting_responses_spec.rb +2 -2
- data/spec/components/checks/passive/webdav_spec.rb +1 -1
- data/spec/components/checks/passive/xst_spec.rb +1 -1
- data/spec/components/fingerprinters/servers/apache_spec.rb +2 -2
- data/spec/components/path_extractors/comments_spec.rb +5 -1
- data/spec/components/path_extractors/scripts_spec.rb +5 -2
- data/spec/components/plugins/autologin_spec.rb +22 -22
- data/spec/components/plugins/autothrottle_spec.rb +6 -5
- data/spec/components/plugins/content_types_spec.rb +4 -4
- data/spec/components/plugins/cookie_collector_spec.rb +5 -5
- data/spec/components/plugins/exec_spec.rb +12 -12
- data/spec/components/plugins/form_dicattack_spec.rb +3 -3
- data/spec/components/plugins/headers_collector_spec.rb +8 -8
- data/spec/components/plugins/healthmap_spec.rb +3 -3
- data/spec/components/plugins/http_dicattack_spec.rb +3 -3
- data/spec/components/plugins/login_script_spec.rb +79 -22
- data/spec/components/plugins/meta/remedies/discovery_spec.rb +3 -2
- data/spec/components/plugins/meta/remedies/timing_attacks_spec.rb +3 -3
- data/spec/components/plugins/meta/uniformity_spec.rb +2 -2
- data/spec/components/plugins/restrict_to_dom_state_spec.rb +1 -1
- data/spec/components/plugins/script_spec.rb +1 -1
- data/spec/components/plugins/uncommon_headers_spec.rb +2 -2
- data/spec/components/plugins/vector_collector_spec.rb +2 -2
- data/spec/components/plugins/vector_feed_spec.rb +40 -40
- data/spec/components/plugins/waf_detector_spec.rb +6 -6
- data/spec/components/reporters/json_spec.rb +4 -4
- data/spec/components/reporters/marshal_spec.rb +2 -2
- data/spec/components/reporters/yaml_spec.rb +3 -2
- data/spec/external/wavsep/active/sqli_spec.rb +1 -3
- data/spec/spec_helper.rb +4 -0
- data/spec/support/factories/element/ui_form.rb +14 -0
- data/spec/support/factories/element/ui_input.rb +13 -0
- data/spec/support/factories/issue.rb +0 -13
- data/spec/support/fixtures/report.afr +0 -0
- data/spec/support/fixtures/{taint_check/taint.rb → signature_check/signature.rb} +2 -2
- data/spec/support/helpers/browser_cluster/jobs/taint_tracer.rb +11 -11
- data/spec/support/helpers/framework.rb +1 -1
- data/spec/support/helpers/pages.rb +2 -2
- data/spec/support/servers/arachni/browser.rb +139 -0
- data/spec/support/servers/arachni/browser/javascript/taint_tracer.rb +40 -0
- data/spec/support/servers/arachni/element/capabilities/analyzable/{taint.rb → signature.rb} +0 -0
- data/spec/support/servers/arachni/element/input/input_dom.rb +102 -0
- data/spec/support/servers/arachni/element/ui_form/ui_form_dom.rb +238 -0
- data/spec/support/servers/checks/active/trainer_check.rb +7 -7
- data/spec/support/servers/checks/active/unvalidated_redirect_dom.rb +22 -6
- data/spec/support/servers/checks/active/xss_dom.rb +50 -0
- data/spec/support/servers/checks/active/xss_dom_script_context.rb +53 -0
- data/spec/support/shared/browser/javascript/taint_tracer/sink/base.rb +6 -6
- data/spec/support/shared/check.rb +10 -12
- data/spec/support/shared/component/options/base.rb +24 -24
- data/spec/support/shared/element/base.rb +25 -25
- data/spec/support/shared/element/capabilities/auditable.rb +116 -140
- data/spec/support/shared/element/capabilities/dom_only.rb +65 -0
- data/spec/support/shared/element/capabilities/inputtable.rb +71 -86
- data/spec/support/shared/element/capabilities/mutable.rb +122 -111
- data/spec/support/shared/element/capabilities/refreshable.rb +10 -10
- data/spec/support/shared/element/capabilities/{submitable.rb → submittable.rb} +26 -26
- data/spec/support/shared/element/capabilities/with_auditor.rb +10 -10
- data/spec/support/shared/element/capabilities/with_dom.rb +8 -8
- data/spec/support/shared/element/capabilities/with_node.rb +4 -6
- data/spec/support/shared/element/capabilities/with_scope.rb +2 -2
- data/spec/support/shared/element/capabilities/with_source.rb +6 -8
- data/spec/support/shared/element/dom.rb +144 -0
- data/spec/support/shared/element/dom/auditable.rb +42 -0
- data/spec/support/shared/element/dom/inputtable.rb +5 -0
- data/spec/support/shared/element/dom/mutable.rb +3 -0
- data/spec/support/shared/element/dom/submittable.rb +119 -0
- data/spec/support/shared/external/wavsep.rb +3 -3
- data/spec/support/shared/fingerprinter.rb +2 -2
- data/spec/support/shared/framework.rb +1 -1
- data/spec/support/shared/http/message.rb +9 -9
- data/spec/support/shared/option_group.rb +17 -17
- data/spec/support/shared/path_extractor.rb +1 -1
- data/spec/support/shared/plugin.rb +2 -2
- data/spec/support/shared/support/cache.rb +57 -57
- data/spec/support/shared/support/lookup.rb +25 -25
- data/ui/cli/framework.rb +22 -11
- data/ui/cli/framework/option_parser.rb +15 -0
- data/ui/cli/option_parser.rb +8 -1
- data/ui/cli/output.rb +2 -1
- metadata +54 -20
- data/components/checks/active/xss_dom_inputs.rb +0 -236
- data/spec/components/checks/active/xss_dom_inputs_spec.rb +0 -30
- data/spec/support/servers/checks/active/xss_dom_inputs.rb +0 -59
- data/spec/support/shared/element/capabilities/auditable/dom.rb +0 -322
@@ -13,23 +13,23 @@ describe Arachni::Reporter::Base do
|
|
13
13
|
|
14
14
|
describe '#report' do
|
15
15
|
it 'returns the provided report' do
|
16
|
-
@reporters.run( :with_outfile, report ).report.
|
16
|
+
expect(@reporters.run( :with_outfile, report ).report).to eq(report)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '#outfile' do
|
21
21
|
it 'returns the outfile in options' do
|
22
22
|
outfile = 'blahfile'
|
23
|
-
@reporters.run( :with_outfile, @framework.report,
|
23
|
+
expect(@reporters.run( :with_outfile, @framework.report,
|
24
24
|
'outfile' => outfile
|
25
|
-
).outfile.
|
25
|
+
).outfile).to eq(outfile)
|
26
26
|
end
|
27
27
|
|
28
28
|
context 'when a directory is provided as an outfile option' do
|
29
29
|
it 'returns the path of default outfile filename under that directory' do
|
30
|
-
@reporters.run( :with_outfile, @framework.report,
|
30
|
+
expect(@reporters.run( :with_outfile, @framework.report,
|
31
31
|
'outfile' => '.'
|
32
|
-
).outfile.start_with?( File.expand_path( "." ) ).
|
32
|
+
).outfile.start_with?( File.expand_path( "." ) )).to be_truthy
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -38,25 +38,25 @@ describe Arachni::Reporter::Base do
|
|
38
38
|
context 'when the :skip_responses option is' do
|
39
39
|
context true do
|
40
40
|
it 'returns true' do
|
41
|
-
described_class.new(
|
41
|
+
expect(described_class.new(
|
42
42
|
report,
|
43
43
|
skip_responses: true
|
44
|
-
).skip_responses
|
44
|
+
).skip_responses?).to be_truthy
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
48
|
context false do
|
49
49
|
it 'returns false' do
|
50
|
-
described_class.new(
|
50
|
+
expect(described_class.new(
|
51
51
|
report,
|
52
52
|
skip_responses: false
|
53
|
-
).skip_responses
|
53
|
+
).skip_responses?).to be_falsey
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
57
|
context 'not set' do
|
58
58
|
it 'returns false' do
|
59
|
-
described_class.new( report, {} ).skip_responses
|
59
|
+
expect(described_class.new( report, {} ).skip_responses?).to be_falsey
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -68,7 +68,7 @@ describe Arachni::Reporter::Base do
|
|
68
68
|
store.plugins[:foobar] = { results: 'Blah!' }
|
69
69
|
|
70
70
|
@reporters.run( 'with_formatters', store )
|
71
|
-
IO.read( 'with_formatters' ).
|
71
|
+
expect(IO.read( 'with_formatters' )).to eq({ foobar: 'Blah!' }.to_s)
|
72
72
|
File.delete( 'with_formatters' )
|
73
73
|
end
|
74
74
|
end
|
@@ -76,20 +76,20 @@ describe Arachni::Reporter::Base do
|
|
76
76
|
describe '.has_outfile?' do
|
77
77
|
context 'when the reporter has an outfile option' do
|
78
78
|
it 'returns true' do
|
79
|
-
@reporters[:with_outfile].has_outfile
|
79
|
+
expect(@reporters[:with_outfile].has_outfile?).to be_truthy
|
80
80
|
end
|
81
81
|
end
|
82
82
|
context 'when the reporter does not have an outfile option' do
|
83
83
|
it 'returns false' do
|
84
|
-
@reporters[:without_outfile].has_outfile
|
84
|
+
expect(@reporters[:without_outfile].has_outfile?).to be_falsey
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
89
|
describe '#has_outfile?' do
|
90
90
|
it "delegates to #{described_class}.has_outfile?" do
|
91
|
-
described_class.
|
92
|
-
described_class.new( report, {} ).has_outfile
|
91
|
+
allow(described_class).to receive(:has_outfile?) { :stuff }
|
92
|
+
expect(described_class.new( report, {} ).has_outfile?).to eq(:stuff)
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
@@ -15,7 +15,7 @@ describe Arachni::Reporter::Manager do
|
|
15
15
|
it 'runs a reporter by name' do
|
16
16
|
@reporters.run( 'foo', report )
|
17
17
|
|
18
|
-
File.exist?( 'foo' ).
|
18
|
+
expect(File.exist?( 'foo' )).to be_truthy
|
19
19
|
end
|
20
20
|
|
21
21
|
context 'when options are given' do
|
@@ -23,7 +23,7 @@ describe Arachni::Reporter::Manager do
|
|
23
23
|
options = { 'outfile' => 'stuff' }
|
24
24
|
reporter = @reporters.run( :foo, report, options )
|
25
25
|
|
26
|
-
reporter.options.
|
26
|
+
expect(reporter.options).to eq(options.my_symbolize_keys(false))
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -56,8 +56,8 @@ describe Arachni::Reporter::Manager do
|
|
56
56
|
|
57
57
|
describe '#reset' do
|
58
58
|
it "delegates to #{described_class}.reset" do
|
59
|
-
described_class.
|
60
|
-
@reporters.reset.
|
59
|
+
allow(described_class).to receive(:reset) { :stuff }
|
60
|
+
expect(@reporters.reset).to eq(:stuff)
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -9,11 +9,11 @@ describe Arachni::Reporter::Options do
|
|
9
9
|
|
10
10
|
describe '#outfile' do
|
11
11
|
it 'returns an :outfile reporter option' do
|
12
|
-
subject.outfile.name.
|
12
|
+
expect(subject.outfile.name).to eq(:outfile)
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'has a default value' do
|
16
|
-
subject.outfile.default.
|
16
|
+
expect(subject.outfile.default).to be_truthy
|
17
17
|
end
|
18
18
|
|
19
19
|
context 'when given an extension' do
|
@@ -26,22 +26,22 @@ describe Arachni::Reporter::Options do
|
|
26
26
|
context 'when given a description' do
|
27
27
|
it 'assigns it to the option' do
|
28
28
|
description = 'My description'
|
29
|
-
subject.outfile( '', description ).description.
|
29
|
+
expect(subject.outfile( '', description ).description).to eq(description)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
34
|
describe '#skip_responses' do
|
35
35
|
it 'returns a :skip_responses reporter option' do
|
36
|
-
subject.skip_responses.name.
|
36
|
+
expect(subject.skip_responses.name).to eq(:skip_responses)
|
37
37
|
end
|
38
38
|
|
39
39
|
it "defaults to 'false'" do
|
40
|
-
subject.skip_responses.default.
|
40
|
+
expect(subject.skip_responses.default).to eq(false)
|
41
41
|
end
|
42
42
|
|
43
43
|
it 'has a description' do
|
44
|
-
subject.skip_responses.description.
|
44
|
+
expect(subject.skip_responses.description).to be_truthy
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -54,7 +54,7 @@ describe Arachni::RPC::Client::Base do
|
|
54
54
|
it 'connects to a server' do
|
55
55
|
Server.new( options ) do |server|
|
56
56
|
client = described_class.new( options, server.url )
|
57
|
-
client.call( "foo.bar" ).
|
57
|
+
expect(client.call( "foo.bar" )).to eq(true)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -64,7 +64,7 @@ describe Arachni::RPC::Client::Base do
|
|
64
64
|
it 'connects successfully' do
|
65
65
|
Server.new( ssl_options ) do |server|
|
66
66
|
client = described_class.new( ssl_options, server.url )
|
67
|
-
client.call( "foo.bar" ).
|
67
|
+
expect(client.call( "foo.bar" )).to be_truthy
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
@@ -83,7 +83,7 @@ describe Arachni::RPC::Client::Base do
|
|
83
83
|
raised = true
|
84
84
|
end
|
85
85
|
|
86
|
-
raised.
|
86
|
+
expect(raised).to be_truthy
|
87
87
|
end
|
88
88
|
end
|
89
89
|
end
|
@@ -106,7 +106,7 @@ describe Arachni::RPC::Client::Base do
|
|
106
106
|
raised = true
|
107
107
|
end
|
108
108
|
|
109
|
-
raised.
|
109
|
+
expect(raised).to be_truthy
|
110
110
|
end
|
111
111
|
end
|
112
112
|
end
|
@@ -121,7 +121,7 @@ describe Arachni::RPC::Client::Base do
|
|
121
121
|
|
122
122
|
Server.new( opts, token ) do |server|
|
123
123
|
client = described_class.new( opts, server.url, token )
|
124
|
-
client.call( "foo.bar" ).
|
124
|
+
expect(client.call( "foo.bar" )).to be_truthy
|
125
125
|
end
|
126
126
|
end
|
127
127
|
end
|
@@ -140,7 +140,7 @@ describe Arachni::RPC::Client::Base do
|
|
140
140
|
raised = true
|
141
141
|
end
|
142
142
|
|
143
|
-
raised.
|
143
|
+
expect(raised).to be_truthy
|
144
144
|
end
|
145
145
|
end
|
146
146
|
end
|
@@ -13,12 +13,12 @@ describe Arachni::RPC::Client::Dispatcher do
|
|
13
13
|
|
14
14
|
it 'maps the remote handlers to local objects' do
|
15
15
|
args = [ 'stuff', 'here', { 'blah' => true } ]
|
16
|
-
@dispatcher.echo.echo( *args ).
|
16
|
+
expect(@dispatcher.echo.echo( *args )).to eq(args)
|
17
17
|
end
|
18
18
|
|
19
19
|
describe '#node' do
|
20
20
|
it 'provides access to the node data' do
|
21
|
-
@dispatcher.node.info.is_a?( Hash ).
|
21
|
+
expect(@dispatcher.node.info.is_a?( Hash )).to be_truthy
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -12,7 +12,7 @@ describe Arachni::RPC::Client::Instance do
|
|
12
12
|
context 'which requires a token' do
|
13
13
|
context 'with a valid token' do
|
14
14
|
it 'connects successfully' do
|
15
|
-
@instance.service.alive
|
15
|
+
expect(@instance.service.alive?).to be_truthy
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -35,8 +35,8 @@ describe Arachni::RPC::Client::Instance do
|
|
35
35
|
describe '#set' do
|
36
36
|
it 'allows batch assigning using a hash' do
|
37
37
|
val = @foo_url + '3'
|
38
|
-
@rpc_opts.set( url: val ).
|
39
|
-
@rpc_opts.url.to_s.
|
38
|
+
expect(@rpc_opts.set( url: val )).to be_truthy
|
39
|
+
expect(@rpc_opts.url.to_s).to eq(val)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -44,21 +44,21 @@ describe Arachni::RPC::Client::Instance do
|
|
44
44
|
describe '#framework' do
|
45
45
|
before { @framework = @instance.framework }
|
46
46
|
it 'provides access to framework methods' do
|
47
|
-
@framework.status.
|
47
|
+
expect(@framework.status).to be_truthy
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
describe '#checks' do
|
52
52
|
before { @checks = @instance.checks }
|
53
53
|
it 'provides access to checks manager methods' do
|
54
|
-
@checks.available.
|
54
|
+
expect(@checks.available).to be_truthy
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
58
|
describe '#plugins' do
|
59
59
|
before { @plugins = @instance.plugins }
|
60
60
|
it 'provides access to plugin manager methods' do
|
61
|
-
@plugins.available.
|
61
|
+
expect(@plugins.available).to be_truthy
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
@@ -13,7 +13,7 @@ describe Arachni::RPC::Server::ActiveOptions do
|
|
13
13
|
|
14
14
|
describe '#set' do
|
15
15
|
it 'sets options by hash' do
|
16
|
-
@instance.service.cookies.
|
16
|
+
expect(@instance.service.cookies).to be_empty
|
17
17
|
|
18
18
|
opts = {
|
19
19
|
'url' => 'http://blah.com',
|
@@ -35,23 +35,26 @@ describe Arachni::RPC::Server::ActiveOptions do
|
|
35
35
|
@instance.options.set( opts )
|
36
36
|
h = @instance.options.to_h
|
37
37
|
|
38
|
-
h['url'].to_s.
|
39
|
-
h['scope']['exclude_path_patterns'].
|
38
|
+
expect(h['url'].to_s).to eq(@utils.normalize_url( opts['url'] ))
|
39
|
+
expect(h['scope']['exclude_path_patterns']).to eq(
|
40
40
|
opts['scope']['exclude_path_patterns'].map { |s| Regexp.new(s).to_s }
|
41
|
-
|
41
|
+
)
|
42
|
+
expect(h['scope']['include_path_patterns']).to eq(
|
42
43
|
opts['scope']['include_path_patterns'].map { |s| Regexp.new(s).to_s }
|
43
|
-
|
44
|
+
)
|
45
|
+
expect(h['scope']['redundant_path_patterns']).to eq(
|
44
46
|
opts['scope']['redundant_path_patterns'].
|
45
47
|
inject({}) { |hh, (k, v)| hh[Regexp.new(k).to_s] = v.to_s; hh }
|
48
|
+
)
|
46
49
|
|
47
|
-
h['datastore'].
|
50
|
+
expect(h['datastore']).to eq(opts['datastore'])
|
48
51
|
|
49
|
-
@instance.service.cookies.map { |c| Arachni::Cookie.from_rpc_data c }.
|
52
|
+
expect(@instance.service.cookies.map { |c| Arachni::Cookie.from_rpc_data c }).to eq([
|
50
53
|
Arachni::Cookie.new( url: opts['url'], inputs: { 'name' => 'value' } ),
|
51
54
|
Arachni::Cookie.new( url: opts['url'], inputs: { 'name2' => 'value2' } ),
|
52
55
|
Arachni::Cookie.new( url: opts['url'], inputs: { 'name3' => 'value3' } ),
|
53
56
|
Arachni::Cookie.new( url: opts['url'], inputs: { 'name4' => 'value4' } )
|
54
|
-
]
|
57
|
+
])
|
55
58
|
end
|
56
59
|
end
|
57
60
|
end
|
@@ -29,14 +29,14 @@ describe Arachni::RPC::Server::Base do
|
|
29
29
|
raised = true
|
30
30
|
end
|
31
31
|
|
32
|
-
server.ready
|
33
|
-
raised.
|
32
|
+
expect(server.ready?).to be_truthy
|
33
|
+
expect(raised).to be_falsey
|
34
34
|
end
|
35
35
|
|
36
36
|
describe '#ready?' do
|
37
37
|
context 'when the server is not ready' do
|
38
38
|
it 'returns false' do
|
39
|
-
@server.ready
|
39
|
+
expect(@server.ready?).to be_falsey
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -53,8 +53,8 @@ describe Arachni::RPC::Server::Base do
|
|
53
53
|
raised = true
|
54
54
|
end
|
55
55
|
|
56
|
-
@server.ready
|
57
|
-
raised.
|
56
|
+
expect(@server.ready?).to be_truthy
|
57
|
+
expect(raised).to be_falsey
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -4,23 +4,23 @@ require Arachni::Options.paths.lib + 'rpc/server/framework'
|
|
4
4
|
describe Arachni::RPC::Server::Check::Manager do
|
5
5
|
describe '#available' do
|
6
6
|
it 'returns an array of available checks' do
|
7
|
-
instance_spawn.checks.available.
|
7
|
+
expect(instance_spawn.checks.available).to be_any
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
11
|
describe '#loaded' do
|
12
12
|
context 'when there are loaded checks' do
|
13
13
|
it 'returns an empty array' do
|
14
|
-
instance_spawn.checks.loaded.
|
14
|
+
expect(instance_spawn.checks.loaded).to be_empty
|
15
15
|
end
|
16
16
|
end
|
17
17
|
context 'when there are loaded checks' do
|
18
18
|
it 'returns an array of loaded checks' do
|
19
19
|
checks = instance_spawn.checks
|
20
20
|
|
21
|
-
checks.loaded.
|
21
|
+
expect(checks.loaded).to be_empty
|
22
22
|
checks.load '*'
|
23
|
-
checks.loaded.
|
23
|
+
expect(checks.loaded).to be_any
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -29,9 +29,9 @@ describe Arachni::RPC::Server::Check::Manager do
|
|
29
29
|
it 'loads checks by name' do
|
30
30
|
checks = instance_spawn.checks
|
31
31
|
|
32
|
-
checks.loaded.
|
32
|
+
expect(checks.loaded).to be_empty
|
33
33
|
checks.load 'test'
|
34
|
-
checks.loaded.
|
34
|
+
expect(checks.loaded).to eq(['test'])
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -39,9 +39,9 @@ describe Arachni::RPC::Server::Check::Manager do
|
|
39
39
|
it 'loads all checks' do
|
40
40
|
checks = instance_spawn.checks
|
41
41
|
|
42
|
-
checks.loaded.
|
42
|
+
expect(checks.loaded).to be_empty
|
43
43
|
checks.load_all
|
44
|
-
checks.loaded.
|
44
|
+
expect(checks.loaded).to eq(checks.available)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -44,13 +44,13 @@ describe Arachni::RPC::Server::Dispatcher::Node do
|
|
44
44
|
options.dispatcher.neighbour = nil
|
45
45
|
sleep 4
|
46
46
|
|
47
|
-
c.grid_member
|
47
|
+
expect(c.grid_member?).to be_truthy
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
context 'when the dispatcher is not a grid member' do
|
52
52
|
it 'should return false' do
|
53
|
-
@node.grid_member
|
53
|
+
expect(@node.grid_member?).to be_falsey
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
@@ -71,13 +71,13 @@ describe Arachni::RPC::Server::Dispatcher::Node do
|
|
71
71
|
n.add_neighbour( '127.0.0.1:' + port.to_s )
|
72
72
|
|
73
73
|
sleep 4
|
74
|
-
n.neighbours.
|
74
|
+
expect(n.neighbours).to be_empty
|
75
75
|
|
76
76
|
c = @get_node.call( port )
|
77
77
|
|
78
78
|
sleep 4
|
79
|
-
n.neighbours.
|
80
|
-
c.neighbours.
|
79
|
+
expect(n.neighbours).to eq([c.url])
|
80
|
+
expect(c.neighbours).to eq([n.url])
|
81
81
|
|
82
82
|
options.dispatcher.neighbour = nil
|
83
83
|
end
|
@@ -99,14 +99,14 @@ describe Arachni::RPC::Server::Dispatcher::Node do
|
|
99
99
|
n.add_neighbour( c.url )
|
100
100
|
sleep 1
|
101
101
|
|
102
|
-
c.neighbours.
|
103
|
-
n.neighbours.
|
102
|
+
expect(c.neighbours).to eq([n.url])
|
103
|
+
expect(n.neighbours).to eq([c.url])
|
104
104
|
|
105
105
|
n.shutdown rescue Arachni::RPC::Exceptions::ConnectionError
|
106
106
|
|
107
107
|
sleep 4
|
108
108
|
|
109
|
-
c.neighbours.
|
109
|
+
expect(c.neighbours).to be_empty
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
@@ -117,22 +117,22 @@ describe Arachni::RPC::Server::Dispatcher::Node do
|
|
117
117
|
options.dispatcher.neighbour = n.url
|
118
118
|
c = @get_node.call
|
119
119
|
sleep 4
|
120
|
-
c.neighbours.
|
121
|
-
n.neighbours.
|
120
|
+
expect(c.neighbours).to eq([n.url])
|
121
|
+
expect(n.neighbours).to eq([c.url])
|
122
122
|
|
123
123
|
d = @get_node.call
|
124
124
|
sleep 4
|
125
|
-
d.neighbours.sort.
|
126
|
-
c.neighbours.sort.
|
127
|
-
n.neighbours.sort.
|
125
|
+
expect(d.neighbours.sort).to eq([n.url, c.url].sort)
|
126
|
+
expect(c.neighbours.sort).to eq([n.url, d.url].sort)
|
127
|
+
expect(n.neighbours.sort).to eq([c.url, d.url].sort)
|
128
128
|
|
129
129
|
options.dispatcher.neighbour = d.url
|
130
130
|
e = @get_node.call
|
131
131
|
sleep 4
|
132
|
-
e.neighbours.sort.
|
133
|
-
d.neighbours.sort.
|
134
|
-
c.neighbours.sort.
|
135
|
-
n.neighbours.sort.
|
132
|
+
expect(e.neighbours.sort).to eq([n.url, c.url, d.url].sort)
|
133
|
+
expect(d.neighbours.sort).to eq([n.url, c.url, e.url].sort)
|
134
|
+
expect(c.neighbours.sort).to eq([n.url, d.url, e.url].sort)
|
135
|
+
expect(n.neighbours.sort).to eq([c.url, d.url, e.url].sort)
|
136
136
|
|
137
137
|
options.dispatcher.neighbour = nil
|
138
138
|
end
|
@@ -145,8 +145,8 @@ describe Arachni::RPC::Server::Dispatcher::Node do
|
|
145
145
|
it 'adds a neighbour' do
|
146
146
|
@node.add_neighbour( @n.url )
|
147
147
|
sleep 0.5
|
148
|
-
@node.neighbours.
|
149
|
-
@n.neighbours.
|
148
|
+
expect(@node.neighbours).to eq([@n.url])
|
149
|
+
expect(@n.neighbours).to eq([@node.url])
|
150
150
|
end
|
151
151
|
context 'when propagate is set to true' do
|
152
152
|
it 'announces the new neighbour to the existing neighbours' do
|
@@ -154,32 +154,32 @@ describe Arachni::RPC::Server::Dispatcher::Node do
|
|
154
154
|
@node.add_neighbour( n.url, true )
|
155
155
|
sleep 0.5
|
156
156
|
|
157
|
-
@node.neighbours.sort.
|
158
|
-
@n.neighbours.sort.
|
157
|
+
expect(@node.neighbours.sort).to eq([@n.url, n.url].sort)
|
158
|
+
expect(@n.neighbours.sort).to eq([@node.url, n.url].sort)
|
159
159
|
|
160
160
|
c = @get_node.call
|
161
161
|
n.add_neighbour( c.url, true )
|
162
162
|
sleep 0.5
|
163
163
|
|
164
|
-
@node.neighbours.sort.
|
165
|
-
@n.neighbours.sort.
|
166
|
-
c.neighbours.sort.
|
164
|
+
expect(@node.neighbours.sort).to eq([@n.url, n.url, c.url].sort)
|
165
|
+
expect(@n.neighbours.sort).to eq([@node.url, n.url, c.url].sort)
|
166
|
+
expect(c.neighbours.sort).to eq([@node.url, n.url, @n.url].sort)
|
167
167
|
|
168
168
|
d = @get_node.call
|
169
169
|
d.add_neighbour( c.url, true )
|
170
170
|
sleep 0.5
|
171
171
|
|
172
|
-
@node.neighbours.sort.
|
173
|
-
@n.neighbours.sort.
|
174
|
-
c.neighbours.sort.
|
175
|
-
d.neighbours.sort.
|
172
|
+
expect(@node.neighbours.sort).to eq([d.url, @n.url, n.url, c.url].sort)
|
173
|
+
expect(@n.neighbours.sort).to eq([d.url, @node.url, n.url, c.url].sort)
|
174
|
+
expect(c.neighbours.sort).to eq([d.url, @node.url, n.url, @n.url].sort)
|
175
|
+
expect(d.neighbours.sort).to eq([c.url, @node.url, n.url, @n.url].sort)
|
176
176
|
end
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
180
180
|
describe '#neighbours' do
|
181
181
|
it 'returns an array of neighbours' do
|
182
|
-
@node.neighbours.is_a?( Array ).
|
182
|
+
expect(@node.neighbours.is_a?( Array )).to be_truthy
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
@@ -188,7 +188,7 @@ describe Arachni::RPC::Server::Dispatcher::Node do
|
|
188
188
|
@node.neighbours_with_info.size == @node.neighbours.size
|
189
189
|
keys = @node.info.keys.sort
|
190
190
|
@node.neighbours_with_info.each do |i|
|
191
|
-
i.keys.sort.
|
191
|
+
expect(i.keys.sort).to eq(keys)
|
192
192
|
end
|
193
193
|
end
|
194
194
|
end
|
@@ -203,24 +203,24 @@ describe Arachni::RPC::Server::Dispatcher::Node do
|
|
203
203
|
n = @get_node.call
|
204
204
|
info = n.info
|
205
205
|
|
206
|
-
info['url'].
|
207
|
-
info['pipe_id'].
|
208
|
-
info['weight'].
|
209
|
-
info['nickname'].
|
210
|
-
info['cost'].
|
206
|
+
expect(info['url']).to eq(n.url)
|
207
|
+
expect(info['pipe_id']).to eq(options.dispatcher.node_pipe_id)
|
208
|
+
expect(info['weight']).to eq(options.dispatcher.node_weight)
|
209
|
+
expect(info['nickname']).to eq(options.dispatcher.node_nickname)
|
210
|
+
expect(info['cost']).to eq(options.dispatcher.node_cost)
|
211
211
|
end
|
212
212
|
|
213
213
|
context 'when Options#dispatcher_external_address has been set' do
|
214
214
|
it 'advertises that address' do
|
215
215
|
options.dispatcher.external_address = '9.9.9.9'
|
216
|
-
@get_node.call.info['url'].
|
216
|
+
expect(@get_node.call.info['url']).to start_with options.dispatcher.external_address
|
217
217
|
end
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
221
221
|
describe '#alive?' do
|
222
222
|
it 'returns true' do
|
223
|
-
@get_node.call.alive
|
223
|
+
expect(@get_node.call.alive?).to be_truthy
|
224
224
|
end
|
225
225
|
end
|
226
226
|
end
|