<s> from oslo_config import cfg <EOL> from nova . tests . functional . api_sample_tests import api_sample_base <EOL> CONF = cfg . CONF <EOL> CONF . import_opt ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> class FloatingIpDNSTest ( api_sample_base . ApiSampleTestBaseV21 ) : <EOL> ADMIN_API = True <EOL> extension_name = "<STR_LIT>" <EOL> domain = '<STR_LIT>' <EOL> name = '<STR_LIT>' <EOL> scope = '<STR_LIT>' <EOL> project = '<STR_LIT>' <EOL> dns_type = '<STR_LIT:A>' <EOL> ip = '<STR_LIT>' <EOL> def _get_flags ( self ) : <EOL> f = super ( FloatingIpDNSTest , self ) . _get_flags ( ) <EOL> f [ '<STR_LIT>' ] = CONF . osapi_compute_extension [ : ] <EOL> f [ '<STR_LIT>' ] . append ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> return f <EOL> def _create_or_update ( self ) : <EOL> subs = { '<STR_LIT>' : self . project , <EOL> '<STR_LIT>' : self . scope } <EOL> response = self . _do_put ( '<STR_LIT>' % self . domain , <EOL> '<STR_LIT>' , subs ) <EOL> subs . update ( { '<STR_LIT>' : self . domain } ) <EOL> self . _verify_response ( '<STR_LIT>' , subs , <EOL> response , <NUM_LIT:200> ) <EOL> def _create_or_update_entry ( self ) : <EOL> subs = { '<STR_LIT>' : self . ip , '<STR_LIT>' : self . dns_type } <EOL> response = self . _do_put ( '<STR_LIT>' <EOL> % ( self . domain , self . name ) , <EOL> '<STR_LIT>' , <EOL> subs ) <EOL> subs . update ( { '<STR_LIT:name>' : self . name , '<STR_LIT>' : self . domain } ) <EOL> self . _verify_response ( '<STR_LIT>' , <EOL> subs , response , <NUM_LIT:200> ) <EOL> def test_floating_ip_dns_list ( self ) : <EOL> self . _create_or_update ( ) <EOL> response = self . _do_get ( '<STR_LIT>' ) <EOL> subs = { '<STR_LIT>' : self . domain , <EOL> '<STR_LIT>' : self . project , <EOL> '<STR_LIT>' : self . scope } <EOL> self . _verify_response ( '<STR_LIT>' , subs , <EOL> response , <NUM_LIT:200> ) <EOL> def test_floating_ip_dns_create_or_update ( self ) : <EOL> self . _create_or_update ( ) <EOL> def test_floating_ip_dns_delete ( self ) : <EOL> self . _create_or_update ( ) <EOL> response = self . _do_delete ( '<STR_LIT>' % self . domain ) <EOL> self . assertEqual ( <NUM_LIT> , response . status_code ) <EOL> def test_floating_ip_dns_create_or_update_entry ( self ) : <EOL> self . _create_or_update_entry ( ) <EOL> def test_floating_ip_dns_entry_get ( self ) : <EOL> self . _create_or_update_entry ( ) <EOL> response = self . _do_get ( '<STR_LIT>' <EOL> % ( self . domain , self . name ) ) <EOL> subs = { '<STR_LIT>' : self . domain , <EOL> '<STR_LIT>' : self . ip , <EOL> '<STR_LIT:name>' : self . name } <EOL> self . _verify_response ( '<STR_LIT>' , subs , <EOL> response , <NUM_LIT:200> ) <EOL> def test_floating_ip_dns_entry_delete ( self ) : <EOL> self . _create_or_update_entry ( ) <EOL> response = self . _do_delete ( '<STR_LIT>' <EOL> % ( self . domain , self . name ) ) <EOL> self . assertEqual ( <NUM_LIT> , response . status_code ) <EOL> def test_floating_ip_dns_entry_list ( self ) : <EOL> self . _create_or_update_entry ( ) <EOL> response = self . _do_get ( '<STR_LIT>' <EOL> % ( self . domain , self . ip ) ) <EOL> subs = { '<STR_LIT>' : self . domain , <EOL> '<STR_LIT>' : self . ip , <EOL> '<STR_LIT:name>' : self . name } <EOL> self . _verify_response ( '<STR_LIT>' , subs , <EOL> response , <NUM_LIT:200> ) </s>
