'Test volume retype with QoS
This test conatins following test-cases:
1)  should fail if changing qos enforced by front-end for in-use volume
2)  should NOT fail for in-use if changing qos enforced by back-end
3)  should NOT fail if changing qos enforced by FE for available
volumes
4)  should NOT fail if changing qos enforced by back-end for available
volumes
5)  should NOT fail if changing qos enforced by front-end for in-use
volumes if the qos is the same
6)  should NOT fail if changing qos enforced by back-end for in-use
volumes if the qos is the same
7)  should NOT fail if changing qos enforced by front-end for available
volumes if the qos is the same
8)  should NOT fail if changing qos enforced by back-end for available
volumes if the qos is the same
9)  should fail if changing qos enforced by front-end on the new type
and volume originally had no qos and was in-use
10) should NOT fail if changing qos enforced by back-end on the
new type and volume originally had no qos and was in-use
11) should NOT fail if original and destinal types had no qos for
in-use volumes
12) should NOT fail if changing qos enforced by front-end on the
new type and volume originally had no qos and was available
13) should NOT fail if changing qos enforced by back-end on the
new type and volume originally had no qos and was available
14) should NOT fail if original and destinal types had no qos for
available volumes
15) should fail if changing volume had no type, was in-use and
destination type qos was enforced by front-end
16) should NOT fail if changing volume had no type, was in-use and
destination type had no qos
and volume originally had no type and was in-use
17) should NOT fail if changing volume had no type, was in-use and
destination type qos was enforced by back-end
18) should NOT fail if changing volume had no type, was in-use and
destination type qos was enforced by front-end
19) should NOT fail if changing volume had no type, was available and
destination type had no qos
and volume originally had no type and was in-use
20) should NOT fail if changing volume had no type, was available and
destination type qos was enforced by back-end'

@ddt.data(('in-use', 'front-end', http_client.BAD_REQUEST), ('in-use', 'back-end', http_client.ACCEPTED), ('available', 'front-end', http_client.ACCEPTED), ('available', 'back-end', http_client.ACCEPTED), ('in-use', 'front-end', http_client.ACCEPTED, True), ('in-use', 'back-end', http_client.ACCEPTED, True), ('available', 'front-end', http_client.ACCEPTED, True), ('available', 'back-end', http_client.ACCEPTED, True), ('in-use', 'front-end', http_client.BAD_REQUEST, False, False), ('in-use', 'back-end', http_client.ACCEPTED, False, False), ('in-use', '', http_client.ACCEPTED, True, False), ('available', 'front-end', http_client.ACCEPTED, False, False), ('available', 'back-end', http_client.ACCEPTED, False, False), ('available', '', http_client.ACCEPTED, True, False), ('in-use', 'front-end', http_client.BAD_REQUEST, False, False, False), ('in-use', '', http_client.ACCEPTED, True, False, False), ('in-use', 'back-end', http_client.ACCEPTED, False, False, False), ('available', 'front-end', http_client.ACCEPTED, False, False, False), ('in-use', '', http_client.ACCEPTED, True, False, False), ('in-use', 'back-end', http_client.ACCEPTED, False, False, False))
@ddt.unpack
def test_retype_volume_qos(self, vol_status, consumer_pass, expected_status, same_qos=False, has_qos=True, has_type=True):

    admin_ctxt = context.get_admin_context()
    if has_qos:
        qos_old = utils.create_qos(admin_ctxt, self, name='old', consumer=consumer_pass)['id']
    else:
        qos_old = None
    if same_qos:
        qos_new = qos_old
    else:
        qos_new = utils.create_qos(admin_ctxt, self, name='new', consumer=consumer_pass)['id']
    if has_type:
        vol_type_old = utils.create_volume_type(admin_ctxt, self, name='old', qos_specs_id=qos_old).id
    else:
        vol_type_old = None
    vol_type_new = utils.create_volume_type(admin_ctxt, self, name='new', qos_specs_id=qos_new).id
    vol = utils.create_volume(self.context, status=vol_status, volume_type_id=vol_type_old, testcase_instance=self)
    self._retype_volume_exec(expected_status, vol_type_new, vol.id)
