#NEWLINE# def test_security_kerberos( ) : #NEWLINE# #INDENT# tmpdir = tempfile . mkdtemp ( ) #NEWLINE# finish = HBASE_CONF_DIR . set_for_testing ( xml ) #NEWLINE# try : #NEWLINE# #INDENT# xml = hbase_site_xml ( authentication = 'kerberos' ) #NEWLINE# file ( os . path . join ( tmpdir , 'hbase-site.xml' ) , 'w' ) . write ( xml ) #NEWLINE# reset ( ) #NEWLINE# assert_equal ( 'KERBEROS' , get_server_authentication ( ) ) #NEWLINE# assert_equal ( 'test' , get_server_principal ( ) ) #NEWLINE# security = HbaseApi . _get_security ( ) #NEWLINE# assert_equal ( 'test' , security [ 'kerberos_principal_short_name' ] ) #NEWLINE# assert_equal ( True , security [ 'use_sasl' ] ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# reset ( ) #NEWLINE# finish ( ) #NEWLINE# shutil . rmtree ( tmpdir )