|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFC XEN PATCH 12/13] pytest: Add example .env for options for the tests
From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
All thees could be instead pass to the environment of a gitlab-runner
job instead. But that can make developing easier.
Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
automation/pytest/.env | 19 +++++++++++++++++++
automation/pytest/pyproject.toml | 1 +
automation/pytest/pytest.toml | 4 ++++
3 files changed, 24 insertions(+)
create mode 100644 automation/pytest/.env
diff --git a/automation/pytest/.env b/automation/pytest/.env
new file mode 100644
index 000000000000..6ac8b6158de8
--- /dev/null
+++ b/automation/pytest/.env
@@ -0,0 +1,19 @@
+# Test machine
+HOST_MAC="ff:ff:ff:ff:ff:ff"
+HOST_IP_GATEWAY="203.0.113.1"
+HOST_IP_VLANID=42
+HOST_IP4="203.0.113.42/24"
+HOST_IP6="2001:db8::1:42/32"
+
+# IPMI
+IPMI_HOSTNAME='moonshot.example.org'
+IPMI_BLADE_NODE="c42n1"
+
+# Network environment
+# XXX default value probably not needed with env_files_skip_if_set
+PXE_HOST=${PXE_HOST:-pxe.example.org}
+PXE_HTTP_PATH="configs/custom/${HOST_MAC}"
+PXE_SSH_USER=pxe
+PXE_SSH_PATH="pxe/moonshot-c42"
+
+SSH_PUB_KEYS="ssh-algo AAAArandomstring Not a real key\n"
diff --git a/automation/pytest/pyproject.toml b/automation/pytest/pyproject.toml
index c54c1338f656..b62befaa07d3 100644
--- a/automation/pytest/pyproject.toml
+++ b/automation/pytest/pyproject.toml
@@ -7,6 +7,7 @@ dependencies = [
"paramiko<5.0.0",
"pip>=26.0.1",
"pytest>=9.0.2",
+ "pytest-env>=1.6.0",
"pytest-timeout>=2.4.0",
"types-paramiko>=4.0.0.20260322",
]
diff --git a/automation/pytest/pytest.toml b/automation/pytest/pytest.toml
index ef61ff74ab47..405a56a83301 100644
--- a/automation/pytest/pytest.toml
+++ b/automation/pytest/pytest.toml
@@ -7,3 +7,7 @@ log_cli_format = "%(asctime)s %(levelname)s %(message)s"
log_cli_date_format = "%H:%M:%S"
log_cli_level = "DEBUG"
log_cli = true
+
+[pytest_env]
+env_files = [".env"]
+env_files_skip_if_set = true
--
Anthony PERARD
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |