#NEWLINE# def test_delete_by_network( self ) : #NEWLINE# #INDENT# node = self . env . nodes [ 0 ] #NEWLINE# self . env . network_manager . assign_ips ( self . cluster , [ node ] , consts . NETWORKS . management ) #NEWLINE# ips = list ( objects . IPAddr . get_ips_except_admin ( ) ) #NEWLINE# self . assertEqual ( len ( ips ) , 1 ) #NEWLINE# mgmt_ng = self . env . network_manager . get_network_by_netname ( consts . NETWORKS . management , self . cluster . network_groups ) #NEWLINE# storage_ng = self . env . network_manager . get_network_by_netname ( consts . NETWORKS . storage , self . cluster . network_groups ) #NEWLINE# node_ip = node . ip_addrs [ 0 ] . ip_addr #NEWLINE# new_ip = { #NEWLINE# #INDENT# 'network_data' : storage_ng , #NEWLINE# 'ip_addr' : node_ip , #NEWLINE# 'node' : node . id , #NEWLINE# #UNINDENT# } #NEWLINE# objects . IPAddr . create ( new_ip ) #NEWLINE# ips = list ( objects . IPAddr . get_ips_except_admin ( ) ) #NEWLINE# self . assertEqual ( len ( ips ) , 2 ) #NEWLINE# objects . IPAddr . delete_by_network ( node_ip , storage_ng . id ) #NEWLINE# ips = list ( objects . IPAddr . get_ips_except_admin ( ) ) #NEWLINE# self . assertEqual ( len ( ips ) , 1 ) #NEWLINE# self . assertEqual ( ips [ 0 ] . network , mgmt_ng . id )