Skip to content

Commit

Permalink
Create bypass user set to False by default
Browse files Browse the repository at this point in the history
Change-Id: I054d153e105a0155e72a6be6168c62173d5d4f01
Reviewed-on: https://review.couchbase.org/c/testrunner/+/180722
Reviewed-by: Hemant Kumar Rajput <Hemant.rajput@couchbase.com>
Tested-by: <pavan.pb@couchbase.com>
  • Loading branch information
pavan-couchbase committed Oct 4, 2022
1 parent 68a8d0c commit d690f7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/tasks/task.py
Expand Up @@ -6684,11 +6684,12 @@ def check(self, task_manager):


class CreateServerlessDatabaseTask(Task):
def __init__(self, api: CapellaAPI, config, databases: Dict[str, ServerlessDatabase]):
def __init__(self, api: CapellaAPI, config, databases: Dict[str, ServerlessDatabase], create_bypass_user=False):
Task.__init__(self, "CreateServerlessDatabaseTask")
self.api = api
self.config = config
self.databases = databases
self.create_bypass_user = create_bypass_user

def execute(self, task_manager):
try:
Expand Down Expand Up @@ -6716,8 +6717,10 @@ def check(self, task_manager):
self.log.info("generating API key for serverless database {}".format(
{"database_id": self.database_id}))
creds = self.api.generate_api_keys(self.database_id)
self.log.info("Obtaining access to the dataplane nodes")
rest_api_info = self.api.get_access_to_serverless_dataplane_nodes(database_id=self.database_id)
rest_api_info = {"srv":"", "couchbaseCreds": {"username":"", "password":""}}
if self.create_bypass_user:
self.log.info("Obtaining access to the dataplane nodes")
rest_api_info = self.api.get_access_to_serverless_dataplane_nodes(database_id=self.database_id)
self.databases[self.database_id].populate(info, creds, rest_api_info)
self.state = FINISHED
self.set_result(self.database_id)
Expand Down
3 changes: 2 additions & 1 deletion pytests/serverless/serverless_basetestcase.py
Expand Up @@ -30,6 +30,7 @@ def setUp(self):
self.multitenant_run = True if self.num_of_tenants > 1 else False
self.use_sdk = self.input.param("use_sdk", False)
self.num_of_indexes_per_tenant = self.input.param("num_of_indexes_per_tenant", 20)
self.create_bypass_user = self.input.param("create_bypass_user", False)

def tearDown(self):
for database_id in self.databases:
Expand All @@ -55,7 +56,7 @@ def create_database(self):

def create_database_async(self):
config = capella_utils.create_serverless_config(self.input)
task = CreateServerlessDatabaseTask(self.api, config, self.databases)
task = CreateServerlessDatabaseTask(self.api, config, self.databases, create_bypass_user=self.create_bypass_user)
self.task_manager.schedule(task)
return task

Expand Down

0 comments on commit d690f7c

Please sign in to comment.