Validate scheduling fields in basic ops scenario

Currently there is no validation of node scheduling fields - resource
class and traits - in the scenario tests. This change adds validation of
these fields to the bare metal basic ops test.

We query the flavor used to boot the instance, and extract all requested
resources and traits from extra_specs. These are matched against the
resource class and traits set on the bare metal node that was scheduled.

Change-Id: I9ddc895ead61cf02c6967ead094d061cb7f558d8
Depends-On: https://review.openstack.org/545370
Related-Bug: #1722194
diff --git a/ironic_tempest_plugin/common/utils.py b/ironic_tempest_plugin/common/utils.py
index 67c4922..91f2001 100644
--- a/ironic_tempest_plugin/common/utils.py
+++ b/ironic_tempest_plugin/common/utils.py
@@ -11,7 +11,7 @@
 #    under the License.
 
 
-def get_node(client, node_id=None, instance_uuid=None):
+def get_node(client, node_id=None, instance_uuid=None, api_version=None):
     """Get a node by its identifier or instance UUID.
 
     If both node_id and instance_uuid specified, node_id will be used.
@@ -19,15 +19,17 @@
     :param client: an instance of tempest plugin BaremetalClient.
     :param node_id: identifier (UUID or name) of the node.
     :param instance_uuid: UUID of the instance.
+    :param api_version: Ironic API version to use.
     :returns: the requested node.
     :raises: AssertionError, if neither node_id nor instance_uuid was provided
     """
     assert node_id or instance_uuid, ('Either node or instance identifier '
                                       'has to be provided.')
     if node_id:
-        _, body = client.show_node(node_id)
+        _, body = client.show_node(node_id, api_version=api_version)
         return body
     elif instance_uuid:
-        _, body = client.show_node_by_instance_uuid(instance_uuid)
+        _, body = client.show_node_by_instance_uuid(instance_uuid,
+                                                    api_version=api_version)
         if body['nodes']:
             return body['nodes'][0]