@@ -32,17 +32,36 @@ def setUp(self):
3232 self .INT_NET_NAME = self .getUniqueString ()
3333 self .INT_SUB_NAME = self .getUniqueString ()
3434 self .INT_PORT_NAME = self .getUniqueString ()
35+ self .ADDR_SCOPE_NAME = self .getUniqueString ()
36+ self .SUBNET_P_NAME = self .getUniqueString ()
3537 self .created_ndp_proxies = []
3638
39+ json_output = json .loads (
40+ self .openstack (
41+ 'address scope create -f json --ip-version 6 '
42+ '%(address_s_name)s' % {
43+ 'address_s_name' : self .ADDR_SCOPE_NAME }))
44+ self .assertIsNotNone (json_output ['id' ])
45+ self .ADDRESS_SCOPE_ID = json_output ['id' ]
46+ json_output = json .loads (
47+ self .openstack (
48+ 'subnet pool create -f json %(subnet_p_name)s '
49+ '--address-scope %(address_scope)s '
50+ '--pool-prefix 2001:db8::/96 --default-prefix-length 112' % {
51+ 'subnet_p_name' : self .SUBNET_P_NAME ,
52+ 'address_scope' : self .ADDRESS_SCOPE_ID }))
53+ self .assertIsNotNone (json_output ['id' ])
54+ self .SUBNET_POOL_ID = json_output ['id' ]
3755 json_output = json .loads (
3856 self .openstack ('network create -f json '
3957 '--external ' + self .EXT_NET_NAME ))
4058 self .assertIsNotNone (json_output ['id' ])
4159 self .EXT_NET_ID = json_output ['id' ]
4260 json_output = json .loads (
4361 self .openstack (
44- 'subnet create -f json --ip-version 6 --subnet-range '
45- '2002::1:0/112 --network %(net_id)s %(sub_name)s' % {
62+ 'subnet create -f json --ip-version 6 --subnet-pool '
63+ '%(subnet_pool)s --network %(net_id)s %(sub_name)s' % {
64+ 'subnet_pool' : self .SUBNET_POOL_ID ,
4665 'net_id' : self .EXT_NET_ID ,
4766 'sub_name' : self .EXT_SUB_NAME }))
4867 self .assertIsNotNone (json_output ['id' ])
@@ -68,8 +87,9 @@ def setUp(self):
6887 self .INT_NET_ID = json_output ['id' ]
6988 json_output = json .loads (
7089 self .openstack (
71- 'subnet create -f json --ip-version 6 --subnet-range '
72- '2002::2:0/112 --network %(net_id)s %(sub_name)s' % {
90+ 'subnet create -f json --ip-version 6 --subnet-pool '
91+ '%(subnet_pool)s --network %(net_id)s %(sub_name)s' % {
92+ 'subnet_pool' : self .SUBNET_POOL_ID ,
7393 'net_id' : self .INT_NET_ID ,
7494 'sub_name' : self .INT_SUB_NAME }))
7595 self .assertIsNotNone (json_output ['id' ])
@@ -113,6 +133,11 @@ def tearDown(self):
113133 self .assertEqual ('' , output )
114134 output = self .openstack ('network delete ' + self .EXT_NET_ID )
115135 self .assertEqual ('' , output )
136+ output = self .openstack ('subnet pool delete ' + self .SUBNET_POOL_ID )
137+ self .assertEqual ('' , output )
138+ output = self .openstack ('address scope delete ' +
139+ self .ADDRESS_SCOPE_ID )
140+ self .assertEqual ('' , output )
116141 super ().tearDown ()
117142
118143 def _create_ndp_proxies (self , ndp_proxies ):
0 commit comments