Skip to content

Commit

Permalink
Merge "If auth parameter is missing or not set to 'keystone', turn of…
Browse files Browse the repository at this point in the history
…f keystone authentication"
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jan 30, 2017
2 parents d1223c2 + b5488d2 commit fc6ea06
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions src/config/api-server/tests/test_rbac.py
Expand Up @@ -370,6 +370,34 @@ def tearDown(self):
super(TestRbacAaaModeInvalid, self).tearDown()
# end tearDown

class TestAuthModeInvalid(test_case.ApiServerTestCase):

@classmethod
def setUpClass(cls):
cls.console_handler = logging.StreamHandler()
cls.console_handler.setLevel(logging.DEBUG)
logger.addHandler(cls.console_handler)
extra_config_knobs = [
('DEFAULTS', 'auth', 'no-auth'),
]
super(TestAuthModeInvalid, cls).setUpClass(extra_config_knobs=extra_config_knobs)

@classmethod
def tearDownClass(cls, *args, **kwargs):
logger.removeHandler(cls.console_handler)
super(TestAuthModeInvalid, cls).tearDownClass(*args, **kwargs)

def setUp(self):
super(TestAuthModeInvalid, self).setUp()

def test_aaa_mode(self):
rv = self._api_server.is_auth_disabled()
self.assertEquals(rv, True)

def tearDown(self):
super(TestAuthModeInvalid, self).tearDown()
# end tearDown

class TestRbac(test_case.ApiServerTestCase):

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion src/config/api-server/vnc_cfg_api_server.py
Expand Up @@ -1766,7 +1766,7 @@ def get_rabbit_health_check_interval(self):
# end get_rabbit_health_check_interval

def is_auth_disabled(self):
return self._args.auth is None
return self._args.auth is None or self._args.auth.lower() != 'keystone'

def is_admin_request(self):
if not self.is_multi_tenancy_set():
Expand Down

0 comments on commit fc6ea06

Please sign in to comment.