@@ -32,28 +32,36 @@ def make_managed_subnet(properties, availability_zones)
3232 end
3333
3434 it 'should create a subnet spec with restricted_ips in cidr format' do
35- allow ( Bosh ::Director ::Config ) . to receive ( :director_ips ) . and_return ( [ to_ipaddr ( '10.0.3.11 ' ) . to_s ] )
35+ allow ( Bosh ::Director ::Config ) . to receive ( :director_ips ) . and_return ( [ to_ipaddr ( '10.0.3.150 ' ) . to_s ] )
3636
3737 subnet = make_subnet (
3838 {
3939 'dns' => [ '10.0.0.2' ] ,
4040 'gateway' => '10.0.3.1' ,
4141 'range' => '10.0.3.0/24' ,
4242 'reserved' => [
43- '10.0.3.0 - 10.0.3.35 ' ,
44- '10.0.3.242 - 10.0.3.255 ' ]
43+ '10.0.3.64 - 10.0.3.99 ' ,
44+ '10.0.3.200 - 10.0.3.215 ' ]
4545 } ,
4646 [ ] ,
4747 )
4848
49- expected_restricted_ips = Set . new ( [ to_ipaddr ( '10.0.3.0/27' ) , to_ipaddr ( '10.0.3.32/30' ) , to_ipaddr ( '10.0.3.242/31' ) , to_ipaddr ( '10.0.3.244/30' ) , to_ipaddr ( '10.0.3.248/29' ) ] )
49+ expected_restricted_ips = Set . new ( [
50+ to_ipaddr ( '10.0.3.0/32' ) ,
51+ to_ipaddr ( '10.0.3.1/32' ) ,
52+ to_ipaddr ( '10.0.3.255/32' ) ,
53+ to_ipaddr ( '10.0.3.150/32' ) ,
54+ to_ipaddr ( '10.0.3.64/27' ) ,
55+ to_ipaddr ( '10.0.3.96/30' ) ,
56+ to_ipaddr ( '10.0.3.200/29' ) ,
57+ to_ipaddr ( '10.0.3.208/29' ) ,
58+ ] )
5059
5160 expect ( subnet . range . to_s ) . to eq ( '10.0.3.0/24' )
5261 expect ( subnet . netmask ) . to eq ( '255.255.255.0' )
5362 expect ( subnet . gateway ) . to eq ( '10.0.3.1' )
5463 expect ( subnet . dns ) . to eq ( [ '10.0.0.2' ] )
5564 expect ( subnet . restricted_ips ) . to eq ( expected_restricted_ips )
56-
5765 end
5866
5967 it 'should create valid subnet spec for managed networks' do
0 commit comments