Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion containers/understack-tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
COPY python/understack-tests/uv.lock python/understack-tests/pyproject.toml /code/
RUN --mount=type=cache,target=/root/.cache/uv uv sync --verbose --locked --no-dev
COPY python/understack-tests /code

RUN mkdir -p /opt/rally/plugins
COPY python/understack-tests/rally-plugins /opt/rally/plugins

FROM builder AS prod
WORKDIR /code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ subtasks:
config_drive: true
force_delete: false
contexts:
users_custom:
tenants: 1
users_per_tenant: 1
network:
start_cidr: 192.168.91.0/24
dns_nameservers: [8.8.8.8]
32 changes: 32 additions & 0 deletions python/understack-tests/rally-plugins/users_custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import time

from rally.common import logging
from rally.task import context
from rally_openstack.task.contexts.keystone import users

LOG = logging.getLogger(__name__)


@context.configure(name="users_custom", order=100)
class UsersCustom(users.UserGenerator):
"""Custom users context that sleeps 60s after creating projects."""

def setup(self):
LOG.debug("UsersCustom: setup starting...")

# Call the original setup (creates projects and users normally)
super().setup()

# Add the custom behavior to sleep allowing fofor Nautobot to sync
self.context["users_override_note"] = "Sleep for Nautobot sync"

# After we create a project, sleep for 60 seconds, allowing some
# time for it to sync to Nautobot
LOG.debug("UsersCustom: sleeping for 60 seconds...")
time.sleep(60)

LOG.debug("UsersCustom: completed")

def cleanup(self):
# Run the default cleanup
super().cleanup()
Loading