Count volumes vs partitions and remove hard-coded expected result

The initial patch fixes Mismatch error returned by attach/detach
shelved_or_offload_server Tempest tests because of counting disk
partitions instead of volumes.

Along with counting volumes instead of partitions, the current patch
proposes to remove hard-coded expected result from tests mentioned
above, since it may lead to another Mismatch errors. It may happen,
if an Openstack environment is configured with force_config_drive=True
(at least, this option is enabled in devstack at the moment), and if
it's configured to use block device for config drive instead of
loopback disk file, which is not expected by mentioned tests.
The proposed fix makes these tests more flexible and independent from
environments with specific configurations.
Also, the _create_and_attach() helper function has been splitted onto
smaller pieces to move some of them where they are really used and
to make the whole logic of the test suit cleaner.

Co-Authored-By: Anna Babich <ababich@mirantis.com>

Change-Id: I4736dc9292affa7374e72cba4e3309c1330ebabd
Closes-Bug: #1595503
1 file changed