Skip to content

Commit

Permalink
docker test: Re-create automation user if it exists already
Browse files Browse the repository at this point in the history
To avoid errors when reusing the containerized site, the automation
user is re-created if it exists already.

Change-Id: I70217e59b95478d130fb154dc121751206989706
  • Loading branch information
rene-slowenski-checkmk committed Jan 14, 2025
1 parent 3023bde commit 7a23c32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/testlib/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,10 @@ def __exit__(self, exc_type, exc_value, traceback):
self._teardown()

def _create_automation_user(self) -> None:
if self.openapi.users.get(self.api_user):
logger.info("Dropping existing test-user: '%s'", self.api_user)
self.openapi.users.delete(self.api_user)
logger.info("Creating automation user: '%s'.", self.api_user)
self.openapi.users.create(
username=self.api_user,
fullname="Automation user for tests",
Expand Down

0 comments on commit 7a23c32

Please sign in to comment.