Use admin context when removing DVR router on vm port deletion
In case non-admin tenant removes last VM on a shared network (owned
by admin) connected to a DVR router (also owned by admin) we need
to remove the router from the host where there are no more dvr
serviceable ports. Commit edbade486102a219810137d1c6b916e87475d477
fixed logic that determines routers that should be removed from host.
However in order to actually remove the router we also need admin
context.
This was not caught by unit tests and one reason for that is so called
'mock everything' approach which is evil and generally useless.
This patch replaces unit tests with functional tests that we able
to catch the bug.
Reviewed: https:/ /review. openstack. org/257938 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=96ba199d733 944e5b8aa3664a0 4d9204fd66c878
Committed: https:/
Submitter: Jenkins
Branch: master
commit 96ba199d733944e 5b8aa3664a04d92 04fd66c878
Author: Oleg Bondarev <email address hidden>
Date: Tue Dec 15 17:58:51 2015 +0300
Use admin context when removing DVR router on vm port deletion
In case non-admin tenant removes last VM on a shared network (owned 9810137d1c6b916 e87475d477
by admin) connected to a DVR router (also owned by admin) we need
to remove the router from the host where there are no more dvr
serviceable ports. Commit edbade486102a21
fixed logic that determines routers that should be removed from host.
However in order to actually remove the router we also need admin
context.
This was not caught by unit tests and one reason for that is so called
'mock everything' approach which is evil and generally useless.
This patch replaces unit tests with functional tests that we able
to catch the bug.
Closes-Bug: #1424096 a2727350c78eeab 155097e0c33
Change-Id: Ia6cdf2294562c2