-
Notifications
You must be signed in to change notification settings - Fork 3
Add device-dict mode runtime support #38
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
base: master
Are you sure you want to change the base?
Conversation
bhcopeland
commented
Dec 23, 2025
Add --device-dict argument to specify an external device dictionary file for device-dict mode. Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
When --device-dict is used: use host network, skip HTTP service, bind device control binaries, bind dispatcher download dir for NFS/TFTP. Pass device_dict to tuxlava. Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
Modify runtime bind() to allow same source dir to be mounted at multiple destinations. Required for device-dict mode where dispatcher_download_dir maps to both /srv/sftp and /var/lib/lava/dispatcher/tmp Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
Add dispatcher_ip variable to dispatcher_ip.yaml.jinja2, defaulting to 198.18.0.1 in device-dict mode. This ip is used by DUT's to reach TFTP/NFS on the host. Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
Add unit tests for device-dict mode runtime bindings, host network mode, and multiple mount destinations. Signed-off-by: Ben Copeland <ben.copeland@linaro.org>
0c6143b to
1509751
Compare
| # <dispatcher_download_dir>/<job_id> | ||
| prefix: "{{ prefix }}-" | ||
|
|
||
| {% if d_dict_mode %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message for this commit mentions dispatcher_ip.yaml.jinja2, but it should be dispatcher.yaml.jinaj2
| @@ -0,0 +1,50 @@ | |||
| # bash completion for tuxrun | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the commit message we can remove the extra blank line before your Signed-off-by.
Instead of our own bash-completion, can't we use argcomplete?
diff --git a/tuxrun/argparse.py b/tuxrun/argparse.py
index fc7375472173..0d4dab64b5e7 100644
--- a/tuxrun/argparse.py
+++ b/tuxrun/argparse.py
@@ -5,6 +5,7 @@
#
# SPDX-License-Identifier: MIT
+import argcomplete
import argparse
import sys
from pathlib import Path
@@ -17,6 +18,18 @@ from tuxlava.devices import Device # type: ignore
from tuxlava.tests import Test # type: ignore
+##############
+# Completers #
+##############
+def device_completer(**kwargs):
+ devices = [d.name for d in Device.list(virtual_device=True)]
+ return sorted(set(devices))
+
+
+def test_completer(**kwargs):
+ return Test.list(virtual_device=True)
+
+
###########
# Helpers #
###########
@@ -327,12 +340,13 @@ def setup_parser() -> argparse.ArgumentParser:
)
group = parser.add_argument_group("run options")
- group.add_argument(
+ device_arg = group.add_argument(
"--device",
default=None,
metavar="NAME",
help="Device type",
)
+ device_arg.completer = device_completer
group.add_argument(
"--device-dict",
default=None,
| popen.assert_called_once() | ||
|
|
||
| # Test duplicated source bindings | ||
| # Test duplicated destination bindings (duplicated sources are allowed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit messages mentions /srv/sftp do you mean sftp or tftp?