3535# YOU MUST RUN KINIT BEFORE RUNNING GSSAPI TESTS.
3636GSSAPI_HOST = os .environ .get ('GSSAPI_HOST' )
3737GSSAPI_PORT = int (os .environ .get ('GSSAPI_PORT' , '27017' ))
38- PRINCIPLE = os .environ .get ('PRINCIPLE ' )
38+ PRINCIPAL = os .environ .get ('PRINCIPAL ' )
3939
4040class TestGSSAPI (unittest .TestCase ):
4141
4242 def setUp (self ):
4343 if not HAVE_KERBEROS :
4444 raise SkipTest ('Kerberos module not available.' )
4545 if not GSSAPI_HOST :
46- raise SkipTest ('Must set GSSAPI_HOST and PRINCIPLE to test GSSAPI' )
46+ raise SkipTest ('Must set GSSAPI_HOST and PRINCIPAL to test GSSAPI' )
4747
4848 def test_gssapi_simple (self ):
4949
5050 client = MongoClient (GSSAPI_HOST , GSSAPI_PORT )
51- self .assertTrue (client .test .authenticate (PRINCIPLE ,
51+ self .assertTrue (client .test .authenticate (PRINCIPAL ,
5252 mechanism = 'GSSAPI' ))
5353 # Just test that we can run a simple command.
5454 self .assertTrue (client .database_names ())
5555
5656 uri = ('mongodb://%s@%s:%d/?authMechanism='
57- 'GSSAPI' % (quote_plus (PRINCIPLE ), GSSAPI_HOST , GSSAPI_PORT ))
57+ 'GSSAPI' % (quote_plus (PRINCIPAL ), GSSAPI_HOST , GSSAPI_PORT ))
5858 client = MongoClient (uri )
5959 self .assertTrue (client .database_names ())
6060
@@ -63,11 +63,11 @@ def test_gssapi_simple(self):
6363 client = MongoReplicaSetClient (GSSAPI_HOST ,
6464 port = GSSAPI_PORT ,
6565 replicaSet = set_name )
66- self .assertTrue (client .test .authenticate (PRINCIPLE ,
66+ self .assertTrue (client .test .authenticate (PRINCIPAL ,
6767 mechanism = 'GSSAPI' ))
6868 self .assertTrue (client .database_names ())
6969 uri = ('mongodb://%s@%s:%d/?authMechanism=GSSAPI;replicaSet'
70- '=%s' % (quote_plus (PRINCIPLE ),
70+ '=%s' % (quote_plus (PRINCIPAL ),
7171 GSSAPI_HOST , GSSAPI_PORT , set_name ))
7272 client = MongoReplicaSetClient (uri )
7373 self .assertTrue (client .database_names ())
@@ -77,7 +77,7 @@ def test_gssapi_threaded(self):
7777 # Use auto_start_request=True to make sure each thread
7878 # uses a different socket.
7979 client = MongoClient (GSSAPI_HOST , auto_start_request = True )
80- self .assertTrue (client .test .authenticate (PRINCIPLE ,
80+ self .assertTrue (client .test .authenticate (PRINCIPAL ,
8181 mechanism = 'GSSAPI' ))
8282
8383 result = True
@@ -103,7 +103,7 @@ def try_command():
103103 client = MongoReplicaSetClient (GSSAPI_HOST ,
104104 replicaSet = set_name ,
105105 read_preference = preference )
106- self .assertTrue (client .test .authenticate (PRINCIPLE ,
106+ self .assertTrue (client .test .authenticate (PRINCIPAL ,
107107 mechanism = 'GSSAPI' ))
108108 self .assertTrue (client .foo .command ('dbstats' ))
109109
0 commit comments