コード例 #1
0
    def test_set_source_port(self):
        args = NmapArgs(source_port='foo')
        assert 'foo' == args.get_source_port()
        assert not args.is_locked()

        args.set_source_port('value')
        assert 'value' == args.get_source_port()

        args.lock()

        assert args.is_locked()
        args.set_source_port('new_value')
        assert 'value' == args.get_source_port()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_source_port()
コード例 #2
0
    def test_set_unprivileged(self):
        args = NmapArgs(unprivileged='foo')
        assert 'foo' == args.get_unprivileged()
        assert not args.is_locked()

        args.set_unprivileged('value')
        assert 'value' == args.get_unprivileged()

        args.lock()

        assert args.is_locked()
        args.set_unprivileged('new_value')
        assert 'value' == args.get_unprivileged()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_unprivileged()
コード例 #3
0
    def test_set_data(self):
        args = NmapArgs(data='foo')
        assert 'foo' == args.get_data()
        assert not args.is_locked()

        args.set_data('value')
        assert 'value' == args.get_data()

        args.lock()

        assert args.is_locked()
        args.set_data('new_value')
        assert 'value' == args.get_data()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_data()
コード例 #4
0
    def test_set_proxies(self):
        args = NmapArgs(proxies='foo')
        assert 'foo' == args.get_proxies()
        assert not args.is_locked()

        args.set_proxies('value')
        assert 'value' == args.get_proxies()

        args.lock()

        assert args.is_locked()
        args.set_proxies('new_value')
        assert 'value' == args.get_proxies()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_proxies()
コード例 #5
0
    def test_set_spoof_ip(self):
        args = NmapArgs(spoof_ip='foo')
        assert 'foo' == args.get_spoof_ip()
        assert not args.is_locked()

        args.set_spoof_ip('value')
        assert 'value' == args.get_spoof_ip()

        args.lock()

        assert args.is_locked()
        args.set_spoof_ip('new_value')
        assert 'value' == args.get_spoof_ip()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_spoof_ip()
コード例 #6
0
    def test_set_version_intensity(self):
        args = NmapArgs(version_intensity='foo')
        assert 'foo' == args.get_version_intensity()
        assert not args.is_locked()

        args.set_version_intensity('value')
        assert 'value' == args.get_version_intensity()

        args.lock()

        assert args.is_locked()
        args.set_version_intensity('new_value')
        assert 'value' == args.get_version_intensity()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_version_intensity()
コード例 #7
0
    def test_set_port_ratio(self):
        args = NmapArgs(port_ratio='foo')
        assert 'foo' == args.get_port_ratio()
        assert not args.is_locked()

        args.set_port_ratio('value')
        assert 'value' == args.get_port_ratio()

        args.lock()

        assert args.is_locked()
        args.set_port_ratio('new_value')
        assert 'value' == args.get_port_ratio()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_port_ratio()
コード例 #8
0
    def test_set_max_scan_delay(self):
        args = NmapArgs(max_scan_delay='foo')
        assert 'foo' == args.get_max_scan_delay()
        assert not args.is_locked()

        args.set_max_scan_delay('value')
        assert 'value' == args.get_max_scan_delay()

        args.lock()

        assert args.is_locked()
        args.set_max_scan_delay('new_value')
        assert 'value' == args.get_max_scan_delay()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_max_scan_delay()
コード例 #9
0
    def test_set_os_detection(self):
        args = NmapArgs(os_detection='foo')
        assert 'foo' == args.get_os_detection()
        assert not args.is_locked()

        args.set_os_detection('value')
        assert 'value' == args.get_os_detection()

        args.lock()

        assert args.is_locked()
        args.set_os_detection('new_value')
        assert 'value' == args.get_os_detection()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_os_detection()
コード例 #10
0
    def test_set_min_parallelism(self):
        args = NmapArgs(min_parallelism='foo')
        assert 'foo' == args.get_min_parallelism()
        assert not args.is_locked()

        args.set_min_parallelism('value')
        assert 'value' == args.get_min_parallelism()

        args.lock()

        assert args.is_locked()
        args.set_min_parallelism('new_value')
        assert 'value' == args.get_min_parallelism()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_min_parallelism()
コード例 #11
0
    def test_set_os_scan_limit(self):
        args = NmapArgs(os_scan_limit='foo')
        assert 'foo' == args.get_os_scan_limit()
        assert not args.is_locked()

        args.set_os_scan_limit('value')
        assert 'value' == args.get_os_scan_limit()

        args.lock()

        assert args.is_locked()
        args.set_os_scan_limit('new_value')
        assert 'value' == args.get_os_scan_limit()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_os_scan_limit()
コード例 #12
0
    def test_set_default_script(self):
        args = NmapArgs(default_script='foo')
        assert 'foo' == args.get_default_script()
        assert not args.is_locked()

        args.set_default_script('value')
        assert 'value' == args.get_default_script()

        args.lock()

        assert args.is_locked()
        args.set_default_script('new_value')
        assert 'value' == args.get_default_script()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_default_script()
コード例 #13
0
    def test_set_service_discovery(self):
        args = NmapArgs(service_discovery='foo')
        assert 'foo' == args.get_service_discovery()
        assert not args.is_locked()

        args.set_service_discovery('value')
        assert 'value' == args.get_service_discovery()

        args.lock()

        assert args.is_locked()
        args.set_service_discovery('new_value')
        assert 'value' == args.get_service_discovery()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_service_discovery()
コード例 #14
0
    def test_set_scan_consecutively(self):
        args = NmapArgs(scan_consecutively='foo')
        assert 'foo' == args.get_scan_consecutively()
        assert not args.is_locked()

        args.set_scan_consecutively('value')
        assert 'value' == args.get_scan_consecutively()

        args.lock()

        assert args.is_locked()
        args.set_scan_consecutively('new_value')
        assert 'value' == args.get_scan_consecutively()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_scan_consecutively()
コード例 #15
0
    def test_set_max_hostgroup(self):
        args = NmapArgs(max_hostgroup='foo')
        assert 'foo' == args.get_max_hostgroup()
        assert not args.is_locked()

        args.set_max_hostgroup('value')
        assert 'value' == args.get_max_hostgroup()

        args.lock()

        assert args.is_locked()
        args.set_max_hostgroup('new_value')
        assert 'value' == args.get_max_hostgroup()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_max_hostgroup()
コード例 #16
0
    def test_set_always_dns_resolution(self):
        args = NmapArgs(always_dns_resolution='foo')
        assert 'foo' == args.get_always_dns_resolution()
        assert not args.is_locked()

        args.set_always_dns_resolution('value')
        assert 'value' == args.get_always_dns_resolution()

        args.lock()

        assert args.is_locked()
        args.set_always_dns_resolution('new_value')
        assert 'value' == args.get_always_dns_resolution()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_always_dns_resolution()
コード例 #17
0
    def test_set_max_rtt_timeout(self):
        args = NmapArgs(max_rtt_timeout='foo')
        assert 'foo' == args.get_max_rtt_timeout()
        assert not args.is_locked()

        args.set_max_rtt_timeout('value')
        assert 'value' == args.get_max_rtt_timeout()

        args.lock()

        assert args.is_locked()
        args.set_max_rtt_timeout('new_value')
        assert 'value' == args.get_max_rtt_timeout()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_max_rtt_timeout()
コード例 #18
0
    def test_set_interface(self):
        args = NmapArgs(interface='foo')
        assert 'foo' == args.get_interface()
        assert not args.is_locked()

        args.set_interface('value')
        assert 'value' == args.get_interface()

        args.lock()

        assert args.is_locked()
        args.set_interface('new_value')
        assert 'value' == args.get_interface()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_interface()
コード例 #19
0
    def test_set_ipv6_scan(self):
        args = NmapArgs(ipv6_scan='foo')
        assert 'foo' == args.get_ipv6_scan()
        assert not args.is_locked()

        args.set_ipv6_scan('value')
        assert 'value' == args.get_ipv6_scan()

        args.lock()

        assert args.is_locked()
        args.set_ipv6_scan('new_value')
        assert 'value' == args.get_ipv6_scan()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_ipv6_scan()
コード例 #20
0
    def test_set_bad_sum(self):
        args = NmapArgs(bad_sum='foo')
        assert 'foo' == args.get_bad_sum()
        assert not args.is_locked()

        args.set_bad_sum('value')
        assert 'value' == args.get_bad_sum()

        args.lock()

        assert args.is_locked()
        args.set_bad_sum('new_value')
        assert 'value' == args.get_bad_sum()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_bad_sum()
コード例 #21
0
    def test_set_exclude_ports(self):
        args = NmapArgs(exclude_ports='foo')
        assert 'foo' == args.get_exclude_ports()
        assert not args.is_locked()

        args.set_exclude_ports('value')
        assert 'value' == args.get_exclude_ports()

        args.lock()

        assert args.is_locked()
        args.set_exclude_ports('new_value')
        assert 'value' == args.get_exclude_ports()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_exclude_ports()