Skip to content
Snippets Groups Projects
Commit 6fc32e90 authored by Alexandre Abadie's avatar Alexandre Abadie
Browse files

dist/testbed-support: use new cli-tools command names

parent 4b1e48cd
Branches
No related tags found
No related merge requests found
.PHONY: iotlab-auth iotlab-exp iotlab-flash iotlab-reset iotlab-term iotlab-check-exp .PHONY: iotlab-exp iotlab-flash iotlab-reset iotlab-term iotlab-check-exp
IOTLAB_NODES ?= 5 IOTLAB_NODES ?= 5
IOTLAB_DURATION ?= 30 IOTLAB_DURATION ?= 30
IOTLAB_TYPE ?= m3:at86rf231 IOTLAB_TYPE ?= m3:at86rf231
IOTLAB_AUTH ?= $(HOME)/.iotlabrc IOTLAB_AUTH ?= $(HOME)/.iotlabrc
IOTLAB_USER ?= $(shell cut -f1 -d: $(IOTLAB_AUTH)) IOTLAB_USER ?= $(shell cut -f1 -d: $(IOTLAB_AUTH))
IOTLAB_EXP_ID ?= $(shell experiment-cli get -l --state Running | grep -m 1 '"id"' | grep -Eo '[[:digit:]]+') IOTLAB_EXP_ID ?= $(shell iotlab-experiment get -l --state Running | grep -m 1 '"id"' | grep -Eo '[[:digit:]]+')
IOTLAB_EXP_NAME ?= RIOT_EXP IOTLAB_EXP_NAME ?= RIOT_EXP
IOTLAB_DEBUG_PORT ?= 3333 IOTLAB_DEBUG_PORT ?= 3333
IOTLAB_DEBUG_NODE ?= $(shell experiment-cli get -i $(IOTLAB_EXP_ID) --resources | \ IOTLAB_DEBUG_NODE ?= $(shell iotlab-experiment get -i $(IOTLAB_EXP_ID) --resources | \
grep -m 1 "network_address" | sed 's/.*-\([0-9]*\)\..*/\1/') grep -m 1 "network_address" | sed 's/.*-\([0-9]*\)\..*/\1/')
IOTLAB_AUTHORITY = "$(IOTLAB_USER)@$(IOTLAB_SITE).iot-lab.info" IOTLAB_AUTHORITY = "$(IOTLAB_USER)@$(IOTLAB_SITE).iot-lab.info"
...@@ -29,7 +29,7 @@ ifdef IOTLAB_EXCLUDE_NODES ...@@ -29,7 +29,7 @@ ifdef IOTLAB_EXCLUDE_NODES
endif endif
$(IOTLAB_AUTH): $(IOTLAB_AUTH):
auth-cli -u $(IOTLAB_USER) iotlab-auth -u $(IOTLAB_USER)
iotlab-exp: $(IOTLAB_AUTH) all iotlab-exp: $(IOTLAB_AUTH) all
$(eval IOTLAB_SITE ?= grenoble) $(eval IOTLAB_SITE ?= grenoble)
...@@ -43,10 +43,10 @@ iotlab-exp: $(IOTLAB_AUTH) all ...@@ -43,10 +43,10 @@ iotlab-exp: $(IOTLAB_AUTH) all
endif endif
ifeq (,$(Q)) ifeq (,$(Q))
@echo "experiment-cli submit -d $(IOTLAB_DURATION) $(NODES_PARAM) -n $(IOTLAB_EXP_NAME)" @echo "iotlab-experiment submit -d $(IOTLAB_DURATION) $(NODES_PARAM) -n $(IOTLAB_EXP_NAME)"
endif endif
$(eval NEW_ID := $(shell experiment-cli submit -d $(IOTLAB_DURATION) $(NODES_PARAM) -n $(IOTLAB_EXP_NAME) | grep -Eo '[[:digit:]]+')) $(eval NEW_ID := $(shell iotlab-experiment submit -d $(IOTLAB_DURATION) $(NODES_PARAM) -n $(IOTLAB_EXP_NAME) | grep -Eo '[[:digit:]]+'))
$(Q)experiment-cli wait -i $(NEW_ID) $(Q)iotlab-experiment wait -i $(NEW_ID)
ifdef IOTLAB_LOGGING ifdef IOTLAB_LOGGING
$(Q)ssh -t $(IOTLAB_AUTHORITY) "tmux new -d -s riot-$(NEW_ID)\ $(Q)ssh -t $(IOTLAB_AUTHORITY) "tmux new -d -s riot-$(NEW_ID)\
...@@ -55,24 +55,24 @@ iotlab-exp: $(IOTLAB_AUTH) all ...@@ -55,24 +55,24 @@ iotlab-exp: $(IOTLAB_AUTH) all
endif endif
iotlab-flash: $(IOTLAB_AUTH) iotlab-check-exp all iotlab-flash: $(IOTLAB_AUTH) iotlab-check-exp all
$(Q)node-cli --update $(BINARY) -i $(IOTLAB_EXP_ID) $(NODES_PARAM_BASE) $(EXCLUDE_PARAM) $(Q)iotlab-node --update $(BINARY) -i $(IOTLAB_EXP_ID) $(NODES_PARAM_BASE) $(EXCLUDE_PARAM)
iotlab-reset: $(IOTLAB_AUTH) iotlab-check-exp iotlab-reset: $(IOTLAB_AUTH) iotlab-check-exp
$(Q)node-cli --reset -i $(IOTLAB_EXP_ID) $(NODES_PARAM_BASE) $(EXCLUDE_PARAM) $(Q)iotlab-node --reset -i $(IOTLAB_EXP_ID) $(NODES_PARAM_BASE) $(EXCLUDE_PARAM)
iotlab-debug-server: $(IOTLAB_AUTH) iotlab-check-exp iotlab-debug-server: $(IOTLAB_AUTH) iotlab-check-exp
$(eval DEBUG_TYPE := $(shell echo $(IOTLAB_TYPE) | cut -d: -f1)) $(eval DEBUG_TYPE := $(shell echo $(IOTLAB_TYPE) | cut -d: -f1))
$(eval DEBUG_NODE := $(shell echo $(IOTLAB_DEBUG_NODE) | sed 's/$(DEBUG_TYPE)-\([0-9]*\)/\1/')) $(eval DEBUG_NODE := $(shell echo $(IOTLAB_DEBUG_NODE) | sed 's/$(DEBUG_TYPE)-\([0-9]*\)/\1/'))
$(Q)node-cli --debug-start -i $(IOTLAB_EXP_ID) -l $(IOTLAB_SITE),$(DEBUG_TYPE),$(DEBUG_NODE) $(Q)iotlab-node --debug-start -i $(IOTLAB_EXP_ID) -l $(IOTLAB_SITE),$(DEBUG_TYPE),$(DEBUG_NODE)
@echo "Debug on node $(IOTLAB_DEBUG_NODE)" @echo "Debug on node $(IOTLAB_DEBUG_NODE)"
$(Q)ssh -N -L $(IOTLAB_DEBUG_PORT):$(IOTLAB_DEBUG_NODE):3333 $(IOTLAB_AUTHORITY) $(Q)ssh -N -L $(IOTLAB_DEBUG_PORT):$(IOTLAB_DEBUG_NODE):3333 $(IOTLAB_AUTHORITY)
iotlab-stop: $(IOTLAB_AUTH) iotlab-check-exp iotlab-stop: $(IOTLAB_AUTH) iotlab-check-exp
$(Q)experiment-cli stop -i $(IOTLAB_EXP_ID) $(Q)iotlab-experiment stop -i $(IOTLAB_EXP_ID)
iotlab-term: iotlab-check-exp iotlab-term: iotlab-check-exp
$(Q)ssh -t $(IOTLAB_AUTHORITY) "test -f ~/.iotlabrc || auth-cli -u $(IOTLAB_USER)" $(Q)ssh -t $(IOTLAB_AUTHORITY) "test -f ~/.iotlabrc || iotlab-auth -u $(IOTLAB_USER)"
$(Q)ssh -t $(IOTLAB_AUTHORITY) \ $(Q)ssh -t $(IOTLAB_AUTHORITY) \
"tmux attach -t riot-$(IOTLAB_EXP_ID) || tmux new -s riot-$(IOTLAB_EXP_ID) \ "tmux attach -t riot-$(IOTLAB_EXP_ID) || tmux new -s riot-$(IOTLAB_EXP_ID) \
...@@ -81,4 +81,4 @@ iotlab-term: iotlab-check-exp ...@@ -81,4 +81,4 @@ iotlab-term: iotlab-check-exp
RIOT_LOG-$(IOTLAB_EXP_NAME)-$(IOTLAB_EXP_ID), \ RIOT_LOG-$(IOTLAB_EXP_NAME)-$(IOTLAB_EXP_ID), \
serial_aggregator -i $(IOTLAB_EXP_ID) $(NODES_PARAM_BASE))'" serial_aggregator -i $(IOTLAB_EXP_ID) $(NODES_PARAM_BASE))'"
iotlab-check-exp: IOTLAB_SITE ?= $(shell experiment-cli get -ri -i $(IOTLAB_EXP_ID) | sed -n 4p | cut -d\" -f2) iotlab-check-exp: IOTLAB_SITE ?= $(shell iotlab-experiment get -ri -i $(IOTLAB_EXP_ID) | sed -n 4p | cut -d\" -f2)
...@@ -39,7 +39,7 @@ brackets): ...@@ -39,7 +39,7 @@ brackets):
### Format of a Resource ID ### Format of a Resource ID
Both variables `IOTLAB_PHY_NODES` and `IOTLAB_EXCLUDE_NODES` use the resource id Both variables `IOTLAB_PHY_NODES` and `IOTLAB_EXCLUDE_NODES` use the resource id
string format as specified in the output of `experiment-cli submit --help`. string format as specified in the output of `iotlab-experiment submit --help`.
An example would be: 1-3+7+10-13 An example would be: 1-3+7+10-13
### Targets ### Targets
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment