#NEWLINE# def _test__node_resource( self , has_inst_info ) : #NEWLINE# #INDENT# node_uuid = uuidutils . generate_uuid ( ) #NEWLINE# props = _get_properties ( ) #NEWLINE# stats = _get_stats ( ) #NEWLINE# if has_inst_info : #NEWLINE# #INDENT# instance_info = _get_instance_info ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# instance_info = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# node = ironic_utils . get_test_node ( uuid = node_uuid , instance_uuid = self . instance_uuid , instance_info = instance_info , properties = props ) #NEWLINE# result = self . driver . _node_resource ( node ) #NEWLINE# wantkeys = [ 'hypervisor_hostname' , 'hypervisor_type' , 'hypervisor_version' , 'cpu_info' , 'vcpus' , 'vcpus_used' , 'memory_mb' , 'memory_mb_used' , 'local_gb' , 'local_gb_used' , 'disk_available_least' , 'supported_instances' , 'stats' , 'numa_topology' ] #NEWLINE# wantkeys . sort ( ) #NEWLINE# gotkeys = result . keys ( ) #NEWLINE# gotkeys . sort ( ) #NEWLINE# self . assertEqual ( wantkeys , gotkeys ) #NEWLINE# if has_inst_info : #NEWLINE# #INDENT# props_dict = instance_info #NEWLINE# expected_cpus = instance_info [ 'vcpus' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# props_dict = props #NEWLINE# expected_cpus = props [ 'cpus' ] #NEWLINE# #UNINDENT# self . assertEqual ( expected_cpus , result [ 'vcpus' ] ) #NEWLINE# self . assertEqual ( expected_cpus , result [ 'vcpus_used' ] ) #NEWLINE# self . assertEqual ( props_dict [ 'memory_mb' ] , result [ 'memory_mb' ] ) #NEWLINE# self . assertEqual ( props_dict [ 'memory_mb' ] , result [ 'memory_mb_used' ] ) #NEWLINE# self . assertEqual ( props_dict [ 'local_gb' ] , result [ 'local_gb' ] ) #NEWLINE# self . assertEqual ( props_dict [ 'local_gb' ] , result [ 'local_gb_used' ] ) #NEWLINE# self . assertEqual ( node_uuid , result [ 'hypervisor_hostname' ] ) #NEWLINE# self . assertEqual ( stats , result [ 'stats' ] ) #NEWLINE# self . assertIsNone ( result [ 'numa_topology' ] )