Beispiel #1
0
    def test_set_min_rate(self):
        args = NmapArgs(min_rate='foo')
        assert 'foo' == args.get_min_rate()
        assert not args.is_locked()

        args.set_min_rate('value')
        assert 'value' == args.get_min_rate()

        args.lock()

        assert args.is_locked()
        args.set_min_rate('new_value')
        assert 'value' == args.get_min_rate()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_min_rate()
Beispiel #2
0
    def test_set_datadir(self):
        args = NmapArgs(datadir='foo')
        assert 'foo' == args.get_datadir()
        assert not args.is_locked()

        args.set_datadir('value')
        assert 'value' == args.get_datadir()

        args.lock()

        assert args.is_locked()
        args.set_datadir('new_value')
        assert 'value' == args.get_datadir()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_datadir()
Beispiel #3
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()
Beispiel #4
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()
Beispiel #5
0
    def test_set_top_ports(self):
        args = NmapArgs(top_ports='foo')
        assert 'foo' == args.get_top_ports()
        assert not args.is_locked()

        args.set_top_ports('value')
        assert 'value' == args.get_top_ports()

        args.lock()

        assert args.is_locked()
        args.set_top_ports('new_value')
        assert 'value' == args.get_top_ports()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_top_ports()
Beispiel #6
0
    def test_set_scan_delay(self):
        args = NmapArgs(scan_delay='foo')
        assert 'foo' == args.get_scan_delay()
        assert not args.is_locked()

        args.set_scan_delay('value')
        assert 'value' == args.get_scan_delay()

        args.lock()

        assert args.is_locked()
        args.set_scan_delay('new_value')
        assert 'value' == args.get_scan_delay()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_scan_delay()
Beispiel #7
0
    def test_set_privileged(self):
        args = NmapArgs(privileged='foo')
        assert 'foo' == args.get_privileged()
        assert not args.is_locked()

        args.set_privileged('value')
        assert 'value' == args.get_privileged()

        args.lock()

        assert args.is_locked()
        args.set_privileged('new_value')
        assert 'value' == args.get_privileged()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_privileged()
Beispiel #8
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()
Beispiel #9
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()
Beispiel #10
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()
Beispiel #11
0
    def test_set_max_parallelism(self):
        args = NmapArgs(max_parallelism='foo')
        assert 'foo' == args.get_max_parallelism()
        assert not args.is_locked()

        args.set_max_parallelism('value')
        assert 'value' == args.get_max_parallelism()

        args.lock()

        assert args.is_locked()
        args.set_max_parallelism('new_value')
        assert 'value' == args.get_max_parallelism()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_max_parallelism()
Beispiel #12
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()
Beispiel #13
0
    def test_set_version_trace(self):
        args = NmapArgs(version_trace='foo')
        assert 'foo' == args.get_version_trace()
        assert not args.is_locked()

        args.set_version_trace('value')
        assert 'value' == args.get_version_trace()

        args.lock()

        assert args.is_locked()
        args.set_version_trace('new_value')
        assert 'value' == args.get_version_trace()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_version_trace()
Beispiel #14
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()
Beispiel #15
0
    def test_set_never_dns_resolution(self):
        args = NmapArgs(never_dns_resolution='foo')
        assert 'foo' == args.get_never_dns_resolution()
        assert not args.is_locked()

        args.set_never_dns_resolution('value')
        assert 'value' == args.get_never_dns_resolution()

        args.lock()

        assert args.is_locked()
        args.set_never_dns_resolution('new_value')
        assert 'value' == args.get_never_dns_resolution()

        cloned_args = args.clone()
        assert not cloned_args.is_locked()
        assert 'value' == cloned_args.get_never_dns_resolution()
Beispiel #16
0
    def test_set_spoof_mac(self):
        args = NmapArgs(spoof_mac='foo')
        assert 'foo' == args.get_spoof_mac()
        assert not args.is_locked()

        args.set_spoof_mac('value')
        assert 'value' == args.get_spoof_mac()

        args.lock()

        assert args.is_locked()
        args.set_spoof_mac('new_value')
        assert 'value' == args.get_spoof_mac()

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