mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-09 19:56:48 +00:00
fix(instances): a running VM's QoS edit keeps the pending QoS changes
The QoS table showed the running VM's bandwidth while an edit changes the definition for the next start. Each row posts average, peak and burst, so an edit wrote the running values back over a pending change, and a direction added while the VM ran had no row. The table shows the persistent definition now. An edit also kept only the posted values and dropped an inbound floor; it now updates them and keeps the rest.
This commit is contained in:
parent
8d2c9b1217
commit
ea9424ee1f
8 changed files with 62 additions and 22 deletions
|
|
@ -1027,7 +1027,7 @@ class InstancesTestCase(TestCase):
|
|||
self.assertEqual(self.instance.networks[0]["state"], "down")
|
||||
|
||||
def test_set_unset_qos(self):
|
||||
self.assertEqual(len(self.instance.qos.keys()), 0)
|
||||
self.assertEqual(len(self.instance.config_qos.keys()), 0)
|
||||
net_mac = self.instance.networks[0]["mac"]
|
||||
response = self.client.post(
|
||||
reverse("instances:set_qos", args=[self.instance.id]),
|
||||
|
|
@ -1042,8 +1042,8 @@ class InstancesTestCase(TestCase):
|
|||
)
|
||||
self.assertEqual(response.status_code, 302)
|
||||
|
||||
del self.instance.qos
|
||||
self.assertEqual(len(self.instance.qos.keys()), 1)
|
||||
del self.instance.config_qos
|
||||
self.assertEqual(len(self.instance.config_qos.keys()), 1)
|
||||
|
||||
response = self.client.post(
|
||||
reverse("instances:unset_qos", args=[self.instance.id]),
|
||||
|
|
@ -1054,8 +1054,8 @@ class InstancesTestCase(TestCase):
|
|||
HTTP_REFERER=reverse("index"),
|
||||
)
|
||||
self.assertEqual(response.status_code, 302)
|
||||
del self.instance.qos
|
||||
self.assertEqual(len(self.instance.qos.keys()), 0)
|
||||
del self.instance.config_qos
|
||||
self.assertEqual(len(self.instance.config_qos.keys()), 0)
|
||||
|
||||
# test on running instance
|
||||
# self.instance.proxy.start()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue