Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add fake-ipa #14

Merged
merged 2 commits into from
Sep 12, 2024
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
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
__pycache__/
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
8 changes: 8 additions & 0 deletions fake-ipa/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ARG BASE_IMAGE=python:3.9-slim
FROM $BASE_IMAGE
ENV PBR_VERSION=6.0.0
COPY . /app/
WORKDIR /app/
ENV CONFIG ${CONFIG:-/app/conf.py}
RUN python3 -m pip install . -r requirements.txt
CMD fake-ipa --config "${CONFIG}"
19 changes: 19 additions & 0 deletions fake-ipa/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Fake Ironic Python Agent

FakeIPA is a tool to help test ironic communication with IPA.

FakeIPA simulate the IPA by:

- Running an API server with the needed real IPA endpoint.
- Send back fake inspection data when requested.
- Lookup the node and save tokens.
- Heartbeating to Ironic API with several threads looping over
a queue of fake agents.
- Faking the sync/async commands needed by ironic to inspect,
mboukhalfa marked this conversation as resolved.
Show resolved Hide resolved
clean and provision a node.

## Run FakeIPA

Dev-env provide an environment where we can test FakeIPA
Check WIP PR for more details:
<https://github.com/metal3-io/metal3-dev-env/pull/1450>
37 changes: 37 additions & 0 deletions fake-ipa/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
SUSHY_EMULATOR_LIBVIRT_URI = "qemu+ssh://[email protected]/system?&keyfile=/root/ssh/id_rsa_virt_power&no_verify=1&no_tty=1"
SUSHY_EMULATOR_IGNORE_BOOT_DEVICE = False
SUSHY_EMULATOR_VMEDIA_VERIFY_SSL = False
SUSHY_EMULATOR_AUTH_FILE = "/root/sushy/htpasswd"
SUSHY_EMULATOR_FAKE_DRIVER = True
SUSHY_EMULATOR_FAKE_IPA = True
FAKE_IPA_API_URL = "https://172.22.0.2:6385"
FAKE_IPA_INSPECTION_CALLBACK_URL = "https://172.22.0.2:6385/v1/continue_inspection"
FAKE_IPA_ADVERTISE_ADDRESS_IP = "192.168.111.1"
FAKE_IPA_INSECURE = False
FAKE_IPA_CAFILE = "/root/cert/ironic-ca.crt"
SUSHY_EMULATOR_FAKE_SYSTEMS = [
{
'uuid': '27946b59-9e44-4fa7-8e91-f3527a1ef094',
'name': 'fake1',
'power_state': 'Off',
'external_notifier': True,
mboukhalfa marked this conversation as resolved.
Show resolved Hide resolved
'nics': [
{
'mac': '00:5c:52:31:3a:9c',
'ip': '172.22.0.100'
}
]
},
{
'uuid': '27946b59-9e44-4fa7-8e91-f3527a1ef095',
'name': 'fake2',
'power_state': 'Off',
'external_notifier': True,
'nics': [
{
'mac': '00:5c:52:31:3a:9d',
'ip': '172.22.0.101'
}
]
}
]
Empty file added fake-ipa/fake_ipa/__init__.py
Empty file.
Loading