mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 17:36:05 +00:00
fix(instances): a VM of an architecture without firmware choices or PCI cards can be created
The create page shows no firmware choice for an architecture whose host offers none, yet the form required one, so such a VM could never be created from the page. The firmware is now optional there: the machine's own is used, as the job and the API already did. s390x machines have no PCI bus for the emulated network cards (e1000, e1000e, rtl8139), yet the create page and the VM's network tab offered them for every architecture. They now offer default and virtio there, and a create job refuses a card model the VM's architecture cannot have.
This commit is contained in:
parent
3bd519c935
commit
159049736d
12 changed files with 107 additions and 80 deletions
|
|
@ -181,15 +181,15 @@ class CreateFormValuesTests(TestCase):
|
|||
page = self.page(networks="")
|
||||
self.assertIn("Networks: This field is required.", self.summary(page))
|
||||
|
||||
def test_a_firmware_error_without_a_firmware_choice_is_in_the_summary(self):
|
||||
# an architecture with no firmware choice renders no firmware select
|
||||
def test_an_architecture_without_a_firmware_choice_needs_none(self):
|
||||
# its page renders no firmware select: the machine's own firmware is used
|
||||
with patch("vrtManager.connection.wvmConnect.get_firmwares", return_value=[]):
|
||||
fields = valid()
|
||||
del fields["firmware"]
|
||||
_, response = render_create_page(self, fields)
|
||||
page = html.fromstring(response.content)
|
||||
self.assertEqual(page.xpath("//select[@name='firmware']"), [])
|
||||
self.assertIn("Firmware: This field is required.", self.summary(page))
|
||||
self.assertNotIn("Firmware", self.summary(page))
|
||||
|
||||
|
||||
class FlavorPresetTests(TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue