Skip to content

Commit 06cebc2

Browse files
Merge pull request #1021 from rackerlabs/rally-tests
feat: Build integration tests based on OpenStack Rally
2 parents 1586c27 + fd7d8eb commit 06cebc2

File tree

15 files changed

+2572
-2
lines changed

15 files changed

+2572
-2
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./python/understack-tests/.venv/

.github/workflows/code-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
id: set-projects
3131
run: |
3232
# grabs all paths with pyproject.toml, snips the 2nd dir, grabs only unique ones, makes a JSON list
33-
projects=$(find python -mindepth 2 -name pyproject.toml | awk -F/ '{print $2}' | sort -u | jq -R -s -c 'split("\n")[:-1]')
33+
projects=$(find python -mindepth 2 ! -wholename 'python/understack-tests/*' -name pyproject.toml | awk -F/ '{print $2}' | sort -u | jq -R -s -c 'split("\n")[:-1]')
3434
echo "projects=$projects" >> "$GITHUB_OUTPUT"
3535
python:
3636
needs: [discover]

.github/workflows/containers.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ jobs:
126126
- name: ironic-nautobot-client
127127
- name: nova-flavors
128128
- name: ansible
129+
- name: understack-tests
129130

130131
steps:
131132
- name: setup docker buildx
@@ -186,6 +187,7 @@ jobs:
186187
- ironic-nautobot-client
187188
- nova-flavors
188189
- ansible
190+
- understack-tests
189191

190192
steps:
191193
- name: clean up PR container

.pre-commit-config.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ repos:
5353
hooks:
5454
- id: ansible-lint
5555
entry: "sh -c 'cd ansible && python3 -m ansiblelint -v --force-color'"
56+
verbose: true
57+
always_run: false
5658
additional_dependencies:
5759
- ansible
5860
- jmespath
59-
files: '^ansible/.*$'
61+
files: '^ansible/.*'
6062
- repo: https://github.com/python-poetry/poetry
6163
rev: '2.1.3'
6264
hooks:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM python:3.12-slim AS builder
2+
ENV UV_PYTHON_DOWNLOADS=never
3+
ENV UV_COMPILE_BYTECODE=1
4+
ENV PATH="/code/.venv/bin:/code/.bin:$PATH"
5+
6+
WORKDIR /code
7+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
8+
COPY python/understack-tests/uv.lock python/understack-tests/pyproject.toml /code/
9+
RUN --mount=type=cache,target=/root/.cache/uv uv sync --verbose --locked --no-dev
10+
COPY python/understack-tests /code
11+
12+
13+
FROM builder AS prod
14+
WORKDIR /code
15+
COPY --from=builder /code /code
16+
RUN useradd --create-home app
17+
COPY --chown=app:app containers/understack-tests/rally.conf /home/app/.rally/rally.conf
18+
USER app
19+
RUN rally db create
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[openstack]
2+
nova_server_boot_timeout = 900
3+
4+
[database]
5+
connection = sqlite:////home/app/.rally/rally.sqlite
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
set -e
3+
rally db ensure
4+
rally deployment create --fromenv --name=main
5+
rally deployment check
6+
rally task start "$@"

python/understack-tests/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.venv
2+
uc_*.json

python/understack-tests/README.md

Lines changed: 377 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
title: "Create the network, provision a gp2.small Ubuntu server and delete it afterwards."
3+
subtasks:
4+
- title: "Boot and delete"
5+
workloads:
6+
- scenario:
7+
NovaServers.boot_and_delete_server:
8+
flavor:
9+
name: gp2.small
10+
image:
11+
name: ^Ubuntu 24.*$
12+
config_drive: true
13+
force_delete: false
14+
contexts:
15+
network:
16+
start_cidr: 192.168.91.0/24
17+
dns_nameservers: [8.8.8.8]

0 commit comments

Comments
 (0)