#NEWLINE# def test_check_ip_conflicts( self ) : #NEWLINE# #INDENT# validator = NetworkConfigurationValidator #NEWLINE# nm = objects . Cluster . get_network_manager ( self . cluster ) #NEWLINE# mgmt = self . find_net_by_name ( consts . NETWORKS . management ) #NEWLINE# mgmt_db = self . db . query ( NetworkGroup ) . get ( mgmt [ 'id' ] ) #NEWLINE# ips = nm . get_assigned_ips_by_network_id ( mgmt [ 'id' ] ) #NEWLINE# self . assertListEqual ( [ '192.168.0.1' , '192.168.0.2' ] , sorted ( ips ) , 'Default IPs were changed for some reason.' ) #NEWLINE# mgmt [ 'cidr' ] = '10.101.0.0/24' #NEWLINE# ranges = validator . _get_network_ip_ranges ( mgmt , mgmt_db , 'cidr' , False ) #NEWLINE# result = validator . _check_ips_out_of_ip_ranges ( mgmt_db , nm , ranges ) #NEWLINE# self . assertTrue ( result ) #NEWLINE# mgmt [ 'cidr' ] = '192.168.0.0/28' #NEWLINE# ranges = validator . _get_network_ip_ranges ( mgmt , mgmt_db , 'cidr' , False ) #NEWLINE# result = validator . _check_ips_out_of_ip_ranges ( mgmt_db , nm , ranges ) #NEWLINE# self . assertFalse ( result ) #NEWLINE# mgmt [ 'ip_ranges' ] = [ [ '192.168.0.1' , '192.168.0.15' ] ] #NEWLINE# ranges = validator . _get_network_ip_ranges ( mgmt , mgmt_db , 'ip_ranges' , False ) #NEWLINE# result = validator . _check_ips_out_of_ip_ranges ( mgmt_db , nm , ranges ) #NEWLINE# self . assertFalse ( result ) #NEWLINE# mgmt [ 'ip_ranges' ] = [ [ '10.101.0.1' , '10.101.0.255' ] ] #NEWLINE# ranges = validator . _get_network_ip_ranges ( mgmt , mgmt_db , 'ip_ranges' , False ) #NEWLINE# result = validator . _check_ips_out_of_ip_ranges ( mgmt_db , nm , nm ) #NEWLINE# self . assertTrue ( result )