X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fexp-tool%2FMakefile;h=9b36471ea6371ed4504c92a14b51eed4069bd7ee;hb=f6af8723d0dd9f4118c7d4c650e8ecb427c5d723;hp=d0712c58cb17317f9d1641f186173b8ffc70352d;hpb=485e2766d816a18e1a51ddf5e12e55f38aeedf89;p=sliver-openvswitch.git diff --git a/planetlab/exp-tool/Makefile b/planetlab/exp-tool/Makefile index d0712c58c..9b36471ea 100644 --- a/planetlab/exp-tool/Makefile +++ b/planetlab/exp-tool/Makefile @@ -173,7 +173,7 @@ cache/status.%: FORCE cache/host.%: @echo "IP lookup for $(call display,$*)" - @host $(HOST_$*) | sed -n 's/^.*has address *//p' > $@ + @host $(HOST_$*) | sed -n '/^.*has address */{s///p;q}' > $@ cache/db.%: @echo "Starting db server on $(call display,$*) - logs in $(call log,$@)" @@ -388,13 +388,28 @@ cache/port.%: cache/iface.% cache/switch.$$(call get,%) # # We need the IP address and the UDP port of the other side and the interace of this side. # We need to set the info again if any of these change. -cache/endpoint.%: cache/host.$$(call rget,%) cache/port.$$(call opp,%) cache/iface.% +cache/endpoint.%: cache/host.$$(call rget,%) cache/port.$$(call opp,%) cache/iface.% | cache/db.$$(call get,%) @echo "Setting port number of link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $(call log,$@)" @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) sliver-ovs set-remote-endpoint L$(call linkpart,$(*F)) \ $$(cat cache/host.$(call rget,$(*F))) \ $$(cat cache/port.$(call opp,$(*F))) 2> $(call log,$@) @touch $@ + +###################### +# testing +###################### + +test: $(foreach l,$(LINKS),test-$(l)) + +test-%: ping-% ping-$$(call get,$$*@2)$(SEP)$$(call get,$$*@1) + @true + +ping-%: FORCE + @echo "Testing connectivity $(call get,$*@1) ===> $(call get,$*@2) - logs in $(call log,$@)" + @$(SSH) $(call solve,$(call get,$*@1)) ping -c 1 $(call solve_ip_addr,$(call get,$*@2)) > $(call log,$@) 2>&1 + @echo "Connectivity $(call get,$*@1) ===> $(call get,$*@2) OK" + #################### CLEANTARGETS=$(addprefix del-,$(notdir $(wildcard cache/bridge.*))) clean: $(CLEANTARGETS) @@ -535,9 +550,18 @@ $(foreach host,$(EXTERNAL_HOSTS),cache/rsnap.links.$(host)): ; $(foreach host,$(EXTERNAL_HOSTS),cache/db.$(host)): @touch $@ +$(foreach host,$(EXTERNAL_HOSTS),del-db.$(host)): del-db.%: + @rm cache/db.$* + $(foreach host,$(EXTERNAL_HOSTS),cache/switch.$(host)): ; @touch $@ +$(foreach host,$(EXTERNAL_HOSTS),del-switch.$(host)): del-switch.%: + @rm -f cache/switch.$* \ + cache/port.$*$(SEP)*@1 cache/port.*$(SEP)$*@2 \ + cache/endpoint.$*$(SEP)*@2 cache/endpoint.*$(SEP)$*@1 \ + L/$*$(SEP)* L/*$(SEP)$* \ + cache/controller.$* .SECONDEXPANSION: @@ -569,6 +593,9 @@ $(foreach host,$(EXTERNAL_HOSTS),del-bridge.$(host)): del-bridge.%: | cache/db.% L/$*$(SEP)* L/*$(SEP)$* \ cache/controller.$* +$(foreach link,$(EXTERNAL_LINKS),ping-$(call get,$(link)@2)$(SEP)$(call get,$(link)@1)): ping-%: FORCE + @echo "Test from external host $(call get,$*@1) to $(call get,$*@2) skipped" + # we assume that a program called tunproxy is available on the # external nodes. $(foreach link,$(EXTERNAL_LINKS),cache/endpoint.$(link)@2): cache/endpoint.%@2: cache/port.%@1 cache/host.$$(call leftnode,%)