summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rwxr-xr-xlavalab-gen.py11
2 files changed, 6 insertions, 7 deletions
diff --git a/README.md b/README.md
index 9ebee19..942fc99 100644
--- a/README.md
+++ b/README.md
@@ -267,6 +267,7 @@ slaves:
default_slave: Does this slave is the default slave where to add boards (default: lab-slave-0)
bind_dev: Bind /dev from host to slave. This is needed when using some HID PDU
use_nfs: Does the LAVA dispatcher will run NFS jobs
+ use_tap: Does TAP netdevices could be used
arch: The arch of the worker (if not x86_64), only accept arm64
lava-coordinator: Does the slave should ran a lava-coordinator
expose_ser2net: Do ser2net ports need to be available on host
@@ -289,7 +290,6 @@ boards:
type: the LAVA device-type of this device
slave: (optional) Name of the slave managing this device. Default to first slave found or default_slave if set.
kvm: (For qemu only) Does the qemu could use KVM (default: no)
- tap: (For qemu only) Does the qemu could use TAP devices (default: no)
uboot_ipaddr: (optional) a static IP to set in uboot
uboot_macaddr: (Optional) the MAC address to set in uboot
custom_option: (optional) All following strings will be directly append to devicefile
diff --git a/lavalab-gen.py b/lavalab-gen.py
index e51b891..13639d2 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -292,7 +292,7 @@ def main():
else:
slaves = workers["slaves"]
for slave in slaves:
- keywords_slaves = [ "name", "host", "dispatcher_ip", "remote_user", "remote_master", "remote_address", "remote_rpc_port", "remote_proto", "extra_actions", "zmq_auth_key", "zmq_auth_key_secret", "default_slave", "export_ser2net", "expose_ser2net", "remote_user_token", "zmq_auth_master_key", "expose_ports", "env", "bind_dev", "loglevel", "use_nfs", "arch", "devices", "lava-coordinator" ]
+ keywords_slaves = [ "name", "host", "dispatcher_ip", "remote_user", "remote_master", "remote_address", "remote_rpc_port", "remote_proto", "extra_actions", "zmq_auth_key", "zmq_auth_key_secret", "default_slave", "export_ser2net", "expose_ser2net", "remote_user_token", "zmq_auth_master_key", "expose_ports", "env", "bind_dev", "loglevel", "use_nfs", "arch", "devices", "lava-coordinator", "use_tap" ]
for keyword in slave:
if not keyword in keywords_slaves:
print("WARNING: unknown keyword %s" % keyword)
@@ -429,6 +429,10 @@ def main():
if "bind_dev" in worker:
dockcomp["services"][worker_name]["volumes"].append("/dev:/dev")
dockcomp["services"][worker_name]["privileged"] = True
+ if "use_tap" in worker and worker["use_tap"]:
+ dockcomp_add_device(dockcomp, worker_name, "/dev/net/tun:/dev/net/tun")
+ dockcomp["services"][worker_name]["cap_add"] = []
+ dockcomp["services"][worker_name]["cap_add"].append("NET_ADMIN")
with open(dockcomposeymlpath, 'w') as f:
yaml.dump(dockcomp, f)
if "extra_actions" in worker:
@@ -519,11 +523,6 @@ def main():
if use_kvm:
dockcomp_add_device(dockcomp, worker_name, "/dev/kvm:/dev/kvm")
# board specific hacks
- use_tap = False
- if "tap" in board:
- use_tap = board["tap"]
- if use_tap:
- dockcomp_add_device(dockcomp, worker_name, "/dev/net/tun:/dev/net/tun")
if devicetype == "qemu" and not use_kvm:
device_line += "{% set no_kvm = True %}\n"
if "uart" in board: