labnconsulting / munet Goto Github PK
View Code? Open in Web Editor NEWCreate network topologies, running programs and containers, using namepsaces, podman containers and qemu virtual machines.
License: GNU General Public License v2.0
Create network topologies, running programs and containers, using namepsaces, podman containers and qemu virtual machines.
License: GNU General Public License v2.0
running cmd
or anything else that needs to use the returned pid from an async_popen
doesn't currently work with unshare_inline=True
. The get_proc_child_pid()
cannot use the root level pid value to do the lookup since pgrep
is in the munet namespace now.
minor nit: last line in cmd: yaml is missing new line
Any environment variables configured through env
in the munet
schema do not seem to be actually configured within a Linux namespace node.
For example, configuring munet.yaml
as follows:
topology:
nodes:
- name: temp
cmd: echo $foo
env:
- name: foo
value: bar
and entering the node temp
through the command term temp
, it can be observed that "bar" is missing from cmd.log
. Similarly, echo $foo
does not print "bar"
for usage with containers would like the PID of process which can be used to reference the net namespace, e.g, /proc/${MUNSPID}/ns/net
When using the short form of connections
(i.e., a list of connection names), the validation fails as it expects the long form (a list of objects with to
keys).
Fix the validation. json schema has anyOf
and oneOf
our YANG to json schema conversion should use that.
In order to retry async functions, a new decorator is needed @async_retry
so that the retry awaits the function.
Could use normal directory volume mount to mount parent somewhere in the guest, then inside the guest bind mount the file to the requested file destination.
Defining new kinds might mean new/more cli options that are custom to these kinds. Would be nice if cli commands could be read from the kinds file too. Currently, any cli commands in kinds.yaml
are ignored.
It would be useful if there were an option to have munet partially launch a topology where instead of trying to actually fully "launch" a VM it wires it up, runs the qemu command but hands the user an interactive console to the qemu instance. This way the user can determine what the correct send/expect sequences are to actually boot the image.
rhel8.9, clean install, server no GUI, python9
[dude@test ~]$ sudo pip3 install munet
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting munet
Downloading munet-0.14.0-py3-none-any.whl (133 kB)
|████████████████████████████████| 133 kB 9.6 MB/s
Collecting pexpect<5.0.0,>=4.8.0
Downloading pexpect-4.9.0-py2.py3-none-any.whl (63 kB)
|████████████████████████████████| 63 kB 669 kB/s
Collecting toml<0.11.0,>=0.10.2
Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting jsonschema<5.0.0,>=4.17.1
Downloading jsonschema-4.21.1-py3-none-any.whl (85 kB)
|████████████████████████████████| 85 kB 831 kB/s
Collecting pyyaml<7.0,>=6.0
Downloading PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (738 kB)
|████████████████████████████████| 738 kB 25.0 MB/s
Collecting ptyprocess>=0.5
Downloading ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
Collecting referencing>=0.28.4
Downloading referencing-0.35.0-py3-none-any.whl (26 kB)
Collecting attrs>=22.2.0
Downloading attrs-23.2.0-py3-none-any.whl (60 kB)
|████████████████████████████████| 60 kB 2.5 MB/s
Collecting jsonschema-specifications>=2023.03.6
Downloading jsonschema_specifications-2023.12.1-py3-none-any.whl (18 kB)
Collecting rpds-py>=0.7.1
Downloading rpds_py-0.18.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
|████████████████████████████████| 1.1 MB 20.1 MB/s
Installing collected packages: ptyprocess, pexpect, toml, attrs, rpds-py, referencing, jsonschema-specifications, jsonschema, pyyaml, munet
WARNING: The script jsonschema is installed in '/usr/local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts mucmd, munet, mushare, mutest and mutini are installed in '/usr/local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed attrs-23.2.0 jsonschema-4.21.1 jsonschema-specifications-2023.12.1 munet-0.14.0 pexpect-4.9.0 ptyprocess-0.7.0 pyyaml-6.0.1 referencing-0.35.0 rpds-py-0.18.0 toml-0.10.2
[dude@test ~]$ munet -V
0.14.0
[dude@test ~]$
Hi, I want an automated network environment for my tests and Munet look reasonably good! But I can't see a way to automate commands send to environment. Should I use popen for that, or is there an e.g. munetcli tool?
Perhaps add some form of DNS support for nodes when NAT is configured on one of the networks.
Is there a switch or a parameter to enable IPC separation? I've explicitly modified base.py and it worked, but is there a way to pass this param from CLI?
e.g,
shutcmd: |
# these are shutdown commands
skill my_process
allow mutest_ script to start/stop pcap on a PCAP (maybe, same semantics as munet command line)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.