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.
Closes-Bug: #1424096
Change-Id: Ia6cdf2294562c2a2727350c78eeab155097e0c33
(cherry picked from commit 96ba199d733944e5b8aa3664a04d9204fd66c878)
Reviewed: https:/ /review. openstack. org/296851 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=69a384a9af4 f0fe3112d98b2eb 766a8417359e1c
Committed: https:/
Submitter: Jenkins
Branch: stable/liberty
commit 69a384a9af4f0fe 3112d98b2eb766a 8417359e1c
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 5b8aa3664a04d92 04fd66c878)
Change-Id: Ia6cdf2294562c2
(cherry picked from commit 96ba199d733944e