-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
dist/tools/desvirt: proper desvirt integration #5030
Merged
OlegHahm
merged 2 commits into
RIOT-OS:master
from
cgundogan:pr/desvirt/proper_integration
Mar 10, 2016
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
TOOL_NAME=desvirt | ||
TOOL_URL=https://github.com/des-testbed/desvirt.git | ||
TOOL_VERSION=master | ||
TOOL_DIR=$(RIOTBASE)/dist/tools/$(TOOL_NAME)/$(TOOL_NAME) | ||
|
||
.PHONY: desvirt-check desvirt-check-topo-file desvirt-check-topo-args desvirt-clean \ | ||
desvirt-distclean desvirt-define desvirt-undefine desvirt-start desvirt-stop desvirt-list | ||
|
||
desvirt-check: | ||
|
||
ifeq ($(wildcard $(TOOL_DIR)),) | ||
git clone $(TOOL_URL) $(TOOL_DIR) | ||
cd $(TOOL_DIR) && git reset --hard $(TOOL_VERSION) | ||
endif | ||
|
||
desvirt-check-topo-file: desvirt-check | ||
|
||
ifndef TOPO | ||
$(error TOPO is not set) | ||
endif | ||
|
||
desvirt-check-topo-args: desvirt-check | ||
|
||
ifndef TOPO_TYPE | ||
$(error TOPO_TYPE is not set) | ||
endif | ||
ifndef TOPO_SIZE | ||
$(error TOPO_SIZE is not set) | ||
endif | ||
|
||
desvirt-define: desvirt-check-topo-file | ||
cd $(TOOL_DIR) && ./vnet -d $(TOOL_DIR)/.desvirt/$(TOPO_FLE) -n $(basename $(TOPO)) | ||
|
||
desvirt-undefine: desvirt-check-topo-file | ||
cd $(TOOL_DIR) && ./vnet -u $(TOOL_DIR)/.desvirt/$(TOPO_FLE) -n $(basename $(TOPO)) | ||
|
||
desvirt-start: desvirt-check-topo-file | ||
cd $(TOOL_DIR) && ./vnet -s -n $(basename $(TOPO)) | ||
|
||
desvirt-stop: desvirt-check-topo-file | ||
cd $(TOOL_DIR) && ./vnet -q -n $(basename $(TOPO)) | ||
|
||
desvirt-topology: desvirt-check-topo-args all | ||
cd $(TOOL_DIR) && \ | ||
./topology_creator -e $(ELFFILE) -n riot_native -r ieee802154 -s$(TOPO_SIZE) -t$(TOPO_TYPE) -f $(TOPO_TYPE)$(TOPO_SIZE) | ||
|
||
desvirt-list: desvirt-check | ||
cd $(TOOL_DIR) && ./vnet -l | ||
|
||
desvirt-clean:: | ||
|
||
ifneq ($(wildcard $(TOOL_DIR)),"") | ||
cd $(TOOL_DIR) && git clean -x -f && git reset --hard $(TOOL_VERSION) | ||
endif | ||
|
||
desvirt-distclean:: | ||
rm -rf $(TOOL_DIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# DESVIRT integration into RIOT | ||
|
||
You can find more information about desvirt at | ||
https://github.com/des-testbed/desvirt | ||
|
||
## Control DESVIRT via Make | ||
|
||
### Variables | ||
|
||
This Makefile introduces some additional variables: | ||
* TOPO (name of the topology to use) | ||
* TOPO_SIZE (size of the topology to use) | ||
* TOPO_TYPE (type of the topology to use [line|grid]) | ||
|
||
### Targets | ||
|
||
It defines the following targets: | ||
* desvirt-topology | ||
* desvirt-define | ||
* desvirt-undefine | ||
* desvirt-list | ||
* desvirt-start | ||
* desvirt-stop | ||
* desvirt-clean | ||
* desvirt-distclean | ||
|
||
#### desvirt-topology | ||
|
||
This target creates a new topology file in `RIOTBASE/dist/tools/desvirt/desvirt/.desvirt` | ||
It is necessary to supply the type and size of the new topology with `TOPO_TYPE` and `TOPO_SIZE`. | ||
The make target will create the topology file with the name `$(TOPO_TYPE)$(TOPO_SIZE)`. | ||
Examples: | ||
``` | ||
TOPO_TYPE=line TOPO_SIZE=4 make desvirt-topology | ||
TOPO_TYPE=grid TOPO_SIZE=9 make desvirt-topology | ||
``` | ||
The names of the files will be: `line4` and `grid9`. | ||
|
||
#### desvirt-define | ||
|
||
This target defines a new topology. This must be done prior to starting desvirt. | ||
``` | ||
TOPO=line4 make desvirt-define | ||
``` | ||
|
||
#### desvirt-undefine | ||
|
||
This target undefines a topology. | ||
``` | ||
TOPO=line4 make desvirt-undefine | ||
``` | ||
|
||
#### desvirt-list | ||
|
||
This target lists all defined topologies. | ||
``` | ||
make desvirt-list | ||
``` | ||
|
||
#### desvirt-start | ||
|
||
This target starts a new virtualization with the given topology name. | ||
The topology must be defined beforehand. | ||
``` | ||
TOPO=line4 make desvirt-start | ||
``` | ||
|
||
You will get an output like this: | ||
``` | ||
cd /home/pschmerzl/RIOT/dist/tools/desvirt/desvirt && ./vnet -s -n line4 | ||
vnet : Loaded statefile .desvirt/lib/line4.macs. | ||
vif : creating line4_0 for pschmerzl | ||
vif : Creating tap: line4_0 | ||
vif : creating line4_1 for pschmerzl | ||
vif : Creating tap: line4_1 | ||
vif : creating line4_2 for pschmerzl | ||
vif : Creating tap: line4_2 | ||
vif : creating line4_3 for pschmerzl | ||
vif : Creating tap: line4_3 | ||
lossnet : line4: New link from line4_0 to line4_1, rate=100mbit, loss=0.0, delay=0.0 | ||
lossnet : line4: New link from line4_1 to line4_0, rate=100mbit, loss=0.0, delay=0.0 | ||
lossnet : line4: New link from line4_1 to line4_2, rate=100mbit, loss=0.0, delay=0.0 | ||
lossnet : line4: New link from line4_2 to line4_1, rate=100mbit, loss=0.0, delay=0.0 | ||
lossnet : line4: New link from line4_2 to line4_3, rate=100mbit, loss=0.0, delay=0.0 | ||
lossnet : line4: New link from line4_3 to line4_2, rate=100mbit, loss=0.0, delay=0.0 | ||
vnet : Network Name: line4 | ||
vm : Defining RIOT native process line4_1 | ||
riotnative : Start the RIOT: socat EXEC:'/home/pschmerzl/RIOT/examples/gnrc_networking/bin/native/gnrc_networking.elf line4_1',end-close,stderr,pty TCP-L:4711,reuseaddr,fork | ||
riotnative : PID: 18235 | ||
vm : Defining RIOT native process line4_0 | ||
riotnative : Start the RIOT: socat EXEC:'/home/pschmerzl/RIOT/examples/gnrc_networking/bin/native/gnrc_networking.elf line4_0',end-close,stderr,pty TCP-L:4712,reuseaddr,fork | ||
riotnative : PID: 18236 | ||
vm : Defining RIOT native process line4_3 | ||
riotnative : Start the RIOT: socat EXEC:'/home/pschmerzl/RIOT/examples/gnrc_networking/bin/native/gnrc_networking.elf line4_3',end-close,stderr,pty TCP-L:4713,reuseaddr,fork | ||
riotnative : PID: 18237 | ||
vm : Defining RIOT native process line4_2 | ||
riotnative : Start the RIOT: socat EXEC:'/home/pschmerzl/RIOT/examples/gnrc_networking/bin/native/gnrc_networking.elf line4_2',end-close,stderr,pty TCP-L:4714,reuseaddr,fork | ||
riotnative : PID: 18238 | ||
|
||
``` | ||
|
||
Once the topology is running, you can use `pyterm` to connect to the various | ||
instances, e.g. calling `pyterm -ts 4712` to connect to node `line4_0` from the | ||
example above. | ||
|
||
#### desvirt-stop | ||
|
||
This target stops a new virtualization with the given topology name. | ||
The topology must be defined beforehand. | ||
``` | ||
TOPO=line4 make desvirt-stop | ||
``` | ||
|
||
#### desvirt-clean | ||
|
||
This target resets the desvirt git-folder. All topologies will be deleted. | ||
``` | ||
make desvirt-clean | ||
``` | ||
|
||
#### desvirt-distclean | ||
|
||
This target deletes the desvirt folder. | ||
``` | ||
make desvirt-distclean | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@OlegHahm should we say that it is also possible to use
netcat
instead ofpyterm
?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.
No objection.
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.
@OlegHahm actually it's not that important .. and travis already built successfully (: