Skip to content

Commit 620325f

Browse files
troubleshooting(rally): add debug to rally tests to assist troubleshooting
1 parent 77dad4a commit 620325f

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

containers/understack-tests/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
88
COPY python/understack-tests/uv.lock python/understack-tests/pyproject.toml /code/
99
RUN --mount=type=cache,target=/root/.cache/uv uv sync --verbose --locked --no-dev
1010
COPY python/understack-tests /code
11-
11+
RUN mkdir -p /opt/rally/plugins
12+
COPY python/understack-tests/rally-plugins /opt/rally/plugins
1213

1314
FROM builder AS prod
1415
WORKDIR /code

python/understack-tests/build_a_single_gp2small_with_network.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ subtasks:
1212
config_drive: true
1313
force_delete: false
1414
contexts:
15+
users_custom:
16+
tenants: 1
17+
users_per_tenant: 1
1518
network:
1619
start_cidr: 192.168.91.0/24
1720
dns_nameservers: [8.8.8.8]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import time
2+
3+
from rally.common import logging
4+
from rally.task import context
5+
from rally_openstack.task.contexts.keystone import users
6+
7+
8+
LOG = logging.getLogger(__name__)
9+
10+
11+
@context.configure(name="users_custom", order=100)
12+
class UsersCustom(users.UserGenerator):
13+
"""Custom users context that sleeps 60s after creating projects."""
14+
15+
def setup(self):
16+
LOG.debug(f"UsersCustom: setup starting...")
17+
18+
# Call the original setup (creates projects and users normally)
19+
super(UsersCustom, self).setup()
20+
21+
# Add the custom behavior to sleep allowing fofor Nautobot to sync
22+
self.context["users_override_note"] = "Sleep for Nautobot sync"
23+
24+
# After we create a project, sleep for 60 seconds, allowing some
25+
# time for it to sync to Nautobot
26+
LOG.debug(f"UsersCustom: sleeping for 60 seconds...")
27+
time.sleep(60)
28+
29+
LOG.debug(f"UsersCustom: completed")
30+
31+
def cleanup(self):
32+
# Nothing special, just run the default cleanup
33+
super(UsersCustom, self).cleanup()

0 commit comments

Comments
 (0)