#NEWLINE# def test_libvirt_volume_driver_iotune( self ) : #NEWLINE# #INDENT# libvirt_driver = volume . LibvirtVolumeDriver ( self . fake_conn ) #NEWLINE# connection_info = { #NEWLINE# #INDENT# 'driver_volume_type' : 'fake' , #NEWLINE# 'data' : { #NEWLINE# #INDENT# 'device_path' : '/foo' , #NEWLINE# 'qos_specs' : 'bar' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# disk_info = { #NEWLINE# #INDENT# 'bus' : 'virtio' , #NEWLINE# 'dev' : 'vde' , #NEWLINE# 'type' : 'disk' , #NEWLINE# #UNINDENT# } #NEWLINE# conf = libvirt_driver . get_config ( connection_info , disk_info ) #NEWLINE# tree = conf . format_dom ( ) #NEWLINE# iotune = tree . find ( './iotune' ) #NEWLINE# self . assertIsNone ( iotune ) #NEWLINE# specs = { #NEWLINE# #INDENT# 'total_bytes_sec' : '102400' , #NEWLINE# 'read_bytes_sec' : '51200' , #NEWLINE# 'write_bytes_sec' : '0' , #NEWLINE# 'total_iops_sec' : '0' , #NEWLINE# 'read_iops_sec' : '200' , #NEWLINE# 'write_iops_sec' : '200' , #NEWLINE# #UNINDENT# } #NEWLINE# del connection_info [ 'data' ] [ 'qos_specs' ] #NEWLINE# connection_info [ 'data' ] . update ( dict ( qos_specs = specs ) ) #NEWLINE# conf = libvirt_driver . get_config ( connection_info , disk_info ) #NEWLINE# tree = conf . format_dom ( ) #NEWLINE# self . assertEqual ( '102400' , tree . find ( './iotune/total_bytes_sec' ) . text ) #NEWLINE# self . assertEqual ( '51200' , tree . find ( './iotune/read_bytes_sec' ) . text ) #NEWLINE# self . assertEqual ( '0' , tree . find ( './iotune/write_bytes_sec' ) . text ) #NEWLINE# self . assertEqual ( '0' , tree . find ( './iotune/total_iops_sec' ) . text ) #NEWLINE# self . assertEqual ( '200' , tree . find ( './iotune/read_iops_sec' ) . text ) #NEWLINE# self . assertEqual ( '200' , tree . find ( './iotune/write_iops_sec' ) . text )