def get_arguments(self) -> str:
        config = '{\n'
        config += NmapCommand.get_arguments(self)
        config += """
    "--allowed-port" = {
      value = "$command_open_ports_allowed_ports$"
      set_if = {{ macro("$command_open_ports_allowed_ports$") != false }}
      repeat_key = true
    }
  }
"""
        return config
 def test_version_trace(self, snapshot):
     instance = NmapCommand('instance', 'command_name', version_trace=False)
     self.__snapshot_match(snapshot, instance)
 def test_sV(self, snapshot):
     instance = NmapCommand('instance', 'command_name', sV=False)
     self.__snapshot_match(snapshot, instance)
 def test_traceroute(self, snapshot):
     instance = NmapCommand('instance', 'command_name', traceroute=False)
     self.__snapshot_match(snapshot, instance)
 def test_single_host(self, snapshot):
     instance = NmapCommand('instance', 'command_name', single_host=False)
     self.__snapshot_match(snapshot, instance)
 def test_default_config(self, snapshot):
     instance = NmapCommand('instance', 'command_name')
     self.__snapshot_match(snapshot, instance)
    def test_create_raise_exception(self):
        self.validate_snapshot = False
        with pytest.raises(Exception) as excinfo:
            NmapCommand.create('instance')

        assert 'NmapCommand' in str(excinfo.value)
 def test_unprivileged(self, snapshot):
     instance = NmapCommand('instance', 'command_name', unprivileged=False)
     self.__snapshot_match(snapshot, instance)
 def test_osscan_guess(self, snapshot):
     instance = NmapCommand('instance', 'command_name', osscan_guess=False)
     self.__snapshot_match(snapshot, instance)
 def __init__(self, id: str):
     NmapCommand.__init__(self, id, 'open_ports')