[S-RBAC] adapt nova-next for port's binding:profile field change
The binding:profile now requires the service user token to be sent when modifying the binding:profile see I5c0094ff21439fe8977cfc623789a09067e6a895 This is not currently supported intentionally by the openstack client as humans and users of the openstack client should not be making requests with a service token. the nova next post hook had some addtioanl assertions where we injected a fake key in the binding:profile just to assert it was not deleted. This cant work anymore so it has been removed. Related-Bug: #2052937 Change-Id: I5c155f0613107ccee63b502ae1fed7a865e67829
This commit is contained in:
parent
3209f65516
commit
2dff0f1c76
@ -140,12 +140,6 @@ openstack port create port-normal-qos \
|
|||||||
--vnic-type normal \
|
--vnic-type normal \
|
||||||
--qos-policy qp0
|
--qos-policy qp0
|
||||||
|
|
||||||
# Let's make the binding:profile for this port contain some
|
|
||||||
# (non-allocation-y) stuff and then later assert that this stuff is still
|
|
||||||
# there after the heal.
|
|
||||||
# Cf. https://review.opendev.org/#/c/637955/35/nova/cmd/manage.py@1896
|
|
||||||
openstack port set port-normal-qos --binding-profile my_key=my_value
|
|
||||||
|
|
||||||
image_id=$(openstack image list -f value -c ID | awk 'NR==1{print $1}')
|
image_id=$(openstack image list -f value -c ID | awk 'NR==1{print $1}')
|
||||||
flavor_id=$(openstack flavor list -f value -c ID | awk 'NR==1{print $1}')
|
flavor_id=$(openstack flavor list -f value -c ID | awk 'NR==1{print $1}')
|
||||||
network_id=$(openstack network list --no-share -f value -c ID | awk 'NR==1{print $1}')
|
network_id=$(openstack network list --no-share -f value -c ID | awk 'NR==1{print $1}')
|
||||||
@ -166,26 +160,9 @@ if [[ "$allocations" == "" ]]; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure that the binding:profile.allocation key is updated
|
|
||||||
rp_uuid=$(get_binding_profile_value port-normal-qos "allocation")
|
|
||||||
if [[ "$rp_uuid" == "" ]]; then
|
|
||||||
echo "No allocation found for the bandwidth aware port."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure our extra key in the binding:profile is still there
|
|
||||||
my_key=$(get_binding_profile_value port-normal-qos "my_key")
|
|
||||||
if [[ "$my_key" == "" ]]; then
|
|
||||||
echo "During port binding the binding:profile was overwritten."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Deleting allocations in placement for the server"
|
echo "Deleting allocations in placement for the server"
|
||||||
openstack resource provider allocation delete ${server_id}
|
openstack resource provider allocation delete ${server_id}
|
||||||
|
|
||||||
echo "Deleting allocation key from the binding:profile of the bandwidth aware port"
|
|
||||||
openstack port unset --binding-profile allocation port-normal-qos
|
|
||||||
|
|
||||||
# Make sure the allocations are gone.
|
# Make sure the allocations are gone.
|
||||||
allocations=$(openstack resource provider allocation show ${server_id} \
|
allocations=$(openstack resource provider allocation show ${server_id} \
|
||||||
-c resources -f value)
|
-c resources -f value)
|
||||||
@ -194,20 +171,6 @@ if [[ "$allocations" != "" ]]; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure that the binding:profile.allocation key is gone
|
|
||||||
null_rp_uuid=$(get_binding_profile_value port-normal-qos "allocation")
|
|
||||||
if [[ "$null_rp_uuid" != "" ]]; then
|
|
||||||
echo "Binding profile not updated for the bandwidth aware port."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure our extra key in the binding:profile is still there
|
|
||||||
my_key=$(get_binding_profile_value port-normal-qos "my_key")
|
|
||||||
if [[ "$my_key" == "" ]]; then
|
|
||||||
echo "During deletion of allocation key our extra key was also deleted from the binding:profile."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Healing allocations"
|
echo "Healing allocations"
|
||||||
# First test with the --dry-run over all instances in all cells.
|
# First test with the --dry-run over all instances in all cells.
|
||||||
set +e
|
set +e
|
||||||
@ -230,28 +193,6 @@ if [[ "$allocations" == "" ]]; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure that the allocations contains bandwidth as well
|
|
||||||
bandwidth_allocations=$(echo "$allocations" | grep NET_BW_EGR_KILOBIT_PER_SEC)
|
|
||||||
if [[ "$bandwidth_allocations" == "" ]]; then
|
|
||||||
echo "Failed to heal port allocations."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure that the binding:profile.allocation key healed back
|
|
||||||
healed_rp_uuid=$(get_binding_profile_value port-normal-qos "allocation")
|
|
||||||
if [[ "$rp_uuid" != "$healed_rp_uuid" ]]; then
|
|
||||||
echo "The value of the allocation key of the bandwidth aware port does not match."
|
|
||||||
echo "expected: $rp_uuid; actual: $healed_rp_uuid."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure our extra key in the binding:profile is still there
|
|
||||||
my_key=$(get_binding_profile_value port-normal-qos "allocation")
|
|
||||||
if [[ "$my_key" == "" ]]; then
|
|
||||||
echo "During heal port allocation our extra key in the binding:profile was deleted."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Verifying online_data_migrations idempotence"
|
echo "Verifying online_data_migrations idempotence"
|
||||||
# We will reuse the server created earlier for this test. (A server needs to
|
# We will reuse the server created earlier for this test. (A server needs to
|
||||||
# be present during the run of online_data_migrations and archiving).
|
# be present during the run of online_data_migrations and archiving).
|
||||||
|
Loading…
Reference in New Issue
Block a user