1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00
webvirtcloud/vrtManager/tests
catborise 0c9a002ef4 fix(networks): a network's addresses are read as libvirt writes them, and its changes keep each other
Reviewed with Codex against libvirt's network format and driver.

- Addresses: wvmNetwork found a network's <ip> by its text, so one
  written as <ip .../> or <ip><dhcp>... without whitespace had none,
  and a second address of a family overwrote the first. ip_networks
  reads every <ip> in order, its index being libvirt's parentIndex:
  family (ipv4 when written), address, subnet, DHCP (a <dhcp>, also
  with fixed addresses only), first range and fixed addresses. The
  parentIndex was guessed from the number of families, wrong when IPv6
  comes first; changes now name the address by its index.
- One read: the page read the network's XML once per getter, ten or
  more round trips; it reads it once (a cached_property of the
  request's wvmNetwork). A change starts from the saved definition
  read anew (VIR_NETWORK_XML_INACTIVE), not the running one: two QoS
  changes on a running network no longer undo the first. The XML
  editor shows and changes the saved definition, and defines this
  network only (its name, and its UUID if given), read for that with
  no entity expanded and handed to libvirt as written; an XML declaring
  its encoding is taken. The actions go back to the network's page by
  its own URL.
- Fixed addresses are found by the address they had (a hidden field),
  not by the editable box: changing it and pressing Delete deleted
  another entry or none. A change deletes the entry and adds it anew
  from a copy, keeping what the page does not show (a client id, a
  lease), and puts it back if the add fails: libvirt's own change
  finds an entry by any of its MAC, address or name, so it could
  replace another entry, and never by an IPv6 DUID. The address must
  be of the subnet, not the host's, and neither it, the MAC or DUID
  nor the name another entry's; an entry gone meanwhile is refused,
  not added anew; an unchanged one writes no audit row. They can be
  added while the network is stopped; a running network saved with
  other addresses than it runs with is not changed live, as
  parentIndex would name another <ip> of it.
- An address without a netmask or prefix takes libvirt's (IPv4 its
  class's, IPv6 /64), for its checks and the overlap check.
- The DHCP range must be in the subnet, in order and not take in the
  host's address.
- The create form takes a known mode only ("bogus" made an isolated
  network, a missing one a server error); NAT and routed networks need
  an IPv4 subnet, an isolated one may have none, a bridge or macvtap
  network needs its bridge or interface and gets no addresses; IPv6
  only with its box (whose value was "false", so never); no name or
  subnet of another network of the host. "Fixed Addresses" at create
  goes: it made a random-MAC entry for every address of the range,
  for no real VM.
- Refusals of a fixed address, the DHCP range, the XML and a QoS
  removal are messages, not server errors.
- The IPv6 forwarding of a bridge or macvtap network is the outside
  network's, not ROUTE.
- get_networks_info reads each network's XML once and gives its
  autostart and addresses too. Unused can_pxe, DHCP lease helpers,
  get_uuid and the per-family range and host getters go.
2026-10-29 10:09:14 +03:00
..
__init__.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_agent_access.py feat(instances): a running VM gets its root password and SSH key through its guest agent 2026-10-25 15:37:37 +03:00
test_change_network.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_clone_nvram.py feat(instances): VM clone runs as a job 2026-10-15 09:28:43 +03:00
test_cloud_init_seed.py feat(instances): a new VM can get a cloud-init seed with its hostname and SSH keys 2026-10-25 19:57:15 +03:00
test_connection.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_connection_threads.py feat(operations): the job worker 2026-10-14 23:27:57 +03:00
test_console_setters.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_device_edits.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_external_snapshots.py feat(instances): a new VM can get a cloud-init seed with its hostname and SSH keys 2026-10-25 19:57:15 +03:00
test_host_reads.py perf(storages): a pool's volumes are read with one libvirt call each 2026-10-28 19:34:34 +03:00
test_instance_getters.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_interface_addresses.py fix(instances): Guest Info says when the agent fails and keeps what it answered 2026-10-26 13:49:37 +03:00
test_iso_media.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_live_clone.py fix(instances): a quiesced snapshot or live clone stops early on a silent guest agent 2026-10-25 17:42:01 +03:00
test_live_connection.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_live_nvram.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_migration.py test: the live suite passes on v3.1.0 again 2026-10-24 09:31:07 +03:00
test_network_ip.py fix(networks): a network's addresses are read as libvirt writes them, and its changes keep each other 2026-10-29 10:09:14 +03:00
test_persistent_edits.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_read_cache.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_remove_nvram.py feat(instances): a shut-off UEFI VM can be migrated 2026-10-16 21:05:23 +03:00
test_resize_disk.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_rwlock.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_usage.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_util.py test: each app keeps its tests in a tests package 2026-10-12 15:17:30 +03:00
test_volume_in_use.py fix(storages): keep volumes a VM still needs 2026-10-13 09:13:02 +03:00
test_xml_safety.py feat(instances): VM clone runs as a job 2026-10-15 09:28:43 +03:00
test_xpath_values.py fix(networks): a network's addresses are read as libvirt writes them, and its changes keep each other 2026-10-29 10:09:14 +03:00