#NEWLINE# @ pytest . mark . xfail ( reason = 'need libvirtd >= 1.2.12' ) #NEWLINE# def test_child( self ) : #NEWLINE# #INDENT# volume = self . node . add_volume ( name = 'test_volume' , capacity = 512 ) #NEWLINE# volume . define ( ) #NEWLINE# child = volume . create_child ( 'test_child' ) #NEWLINE# child . define ( ) #NEWLINE# assert ( child . get_capacity ( ) == 512 ) #NEWLINE# assert ( child . get_path ( ) == '/default-pool/test_env_test_node_test_child' ) #NEWLINE# assert ( child . get_allocation ( ) == 512 ) #NEWLINE# xml = child . _libvirt_volume . XMLDesc ( 0 ) #NEWLINE# assert ( xml == "<volume type='file'>\n  <name>test_env_test_node_test_child</name>\n  <key>/default-pool/test_env_test_node_test_child</key>\n  <source>\n  </source>\n  <capacity unit='bytes'>512</capacity>\n  <allocation unit='bytes'>512</allocation>\n  <target>\n    <path>/default-pool/test_env_test_node_test_child</path>\n    <format type='qcow2'/>\n    <permissions>\n      <mode>0644</mode>\n      <owner>-1</owner>\n      <group>-1</group>\n    </permissions>\n  </target>\n  <backingStore>\n    <path>/default-pool/test_env_test_node_test_volume</path>\n    <format type='qcow2'/>\n    <permissions>\n      <mode>0644</mode>\n      <owner>-1</owner>\n      <group>-1</group>\n    </permissions>\n  </backingStore>\n</volume>\n" )