Fix compare volume stats for storage_protocols
The change [1] added to scheduler a list of
storage_protocols upon reception of the stats from
volume. Scheduler can handle a list of storage
protocol variants for NFS, NVMeOF, iSCSI and FC.
The test_backends_capabilities compare volume
stats from list_pools and
show_backend_capabilities without check if the
procotols are in the list. Once change [1]
standardized some storage_protocols
with a default value, list_pools will show the
standard protocol defined by the position zero
from the list, and show_backend_capabilities
will return the protocol defined by user as
backend. Even if, the protocol returned by
show_backend_capabilities are in the list of
allowed protocols the test will fail if this
protocol is not equal the default position
zero from the list.
This patch provide a check if
show_backend_capabilities returns
valid storage_protocols using the list of allowed
variants and set the preferred protocol to it.
This fix is needed for third-party CI systems that
may not be running tempest in a greenfield
environment. So while cinder change [2] fixed
drivers to report the canonical storage protocol
name, we can't assume that the drivers being
tested contain that fix.
[1]https://review.opendev.org/c/openstack/cinder/+/836069
[2]https://review.opendev.org/c/openstack/cinder/+/839063
Change-Id: I04d0eaa1f6dba16bd11052f91a3d1d0967029ea6
1 file changed