X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=blobdiff_plain;f=planetlab%2Fexp-tool%2FMakefile;h=ad56acc0fc0ee77a51b9185e6c83991fa5285e97;hp=3ab27090bd604e338f0b8967dc4211bd63cafd38;hb=HEAD;hpb=780325b5b8d4c0552b4b7719e0a38200d99f6b08 diff --git a/planetlab/exp-tool/Makefile b/planetlab/exp-tool/Makefile index 3ab27090b..ad56acc0f 100644 --- a/planetlab/exp-tool/Makefile +++ b/planetlab/exp-tool/Makefile @@ -160,7 +160,7 @@ showdpid-%: FORCE @echo $*_DPID=0x$$( $(SSH) $(HOST_$*) $(SUDO) ovs-vsctl get bridge $(BRIDGE) datapath_id | sed -e 's,",,g') showmac-%: FORCE - @echo $*_MAC=\"$$( $(SSH) $(HOST_$*) $(SUDO) sliver-ovs show-mac)\" + @echo $*_MAC=\"$$( $(SSH) $(HOST_$*) $(SUDO) sliver-ovs get-mac $(BRIDGE))\" showports-%: FORCE @$(SSH) $(HOST_$*) $(SUDO) ovs-ofctl show $(BRIDGE) \ @@ -172,8 +172,8 @@ cache/status.%: FORCE @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs status ||: cache/host.%: - @echo "IP lookup for $(call display,$*)" - @host $(HOST_$*) | sed -n 's/^.*has address *//p' > $@ + @echo "IP lookup for $(call display,$*) - logs in $(call log,$@)" + @host $(HOST_$*) | sed -n 's/^.*has address *//p' > $@ 2> $(call log,$@) 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) @@ -471,7 +486,7 @@ cache/geocode.%: cache/loc.% $(CONF) cache/loc.%: $(CONF) @wget -O - 'http://freegeoip.net/csv/$(HOST_$*)' | \ - awk -F, '{ printf "%s, %s\n", $$8, $$9 }' > $@ + awk -F'", *"' '{ printf "\"%s\", \"%s\"\n", $$8, $$9 }' > $@ #################### # 'virtual' targets in that there's no real file attached @@ -524,22 +539,78 @@ $(foreach host,$(EXTERNAL_HOSTS),showports-$(host)): ; $(foreach host,$(EXTERNAL_HOSTS),update-$(host)): ; $(foreach host,$(EXTERNAL_HOSTS),del-controller-$(host)): ; $(foreach host,$(EXTERNAL_HOSTS),cache/status.$(host)): ; -$(foreach host,$(EXTERNAL_HOSTS),cache/db.$(host)): ; -$(foreach host,$(EXTERNAL_HOSTS),cache/bridge.$(host)): ; -$(foreach host,$(EXTERNAL_HOSTS),cache/switch.$(host)): ; $(foreach host,$(EXTERNAL_HOSTS),cache/controller.$(host)): ; -$(foreach link,$(EXTERNAL_LINKS),cache/iface.$(link)@2): ; -$(foreach link,$(EXTERNAL_LINKS),cache/port.$(link)@2): ; -$(foreach link,$(EXTERNAL_LINKS),del-iface.$(link)@2): ; -# we assume that a program called tunproxy is available on the -# external nodes. +$(foreach host,$(EXTERNAL_HOSTS),cache/rsnap.ip.$(host)): ; + @touch $@ + +$(foreach host,$(EXTERNAL_HOSTS),cache/rsnap.links.$(host)): ; + @touch $@ + +$(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: + +$(foreach host,$(EXTERNAL_HOSTS),cache/bridge.$(host)): cache/bridge.%: | cache/db.% + @echo "Creating fake bridge on external host $(call display,$*)" + @touch $@ + +$(foreach link,$(EXTERNAL_LINKS),cache/iface.$(link)@2): cache/iface.%: cache/bridge.$$(call get,%) | cache/db.$$(call get,%) + @echo "Creating fake interface for link $(call linkpart,$*) on external host $(call get,$*)" + @touch $@ + +$(foreach link,$(EXTERNAL_LINKS),cache/port.$(link)@2): cache/port.%: cache/iface.% cache/switch.$$(call get,%) + @echo "Getting port number for link $(call linkpart,$(*F)) on external host $(call display,$(call get,$(*F)))" + @echo $(call default,EXTERNAL_PORT,$(call rightnode,$*)) > $@ + + +$(foreach link,$(EXTERNAL_LINKS),del-iface.$(link)@2): del-iface.%: | cache/db.$$(call get,%) + @echo "Removing fake interface for link $(call linkpart,$*) from external host $(call get,$*)" + @rm -f cache/iface.$* \ + cache/port.$* cache/endpoint.$* cache/endpoint.$(call opp,$*) \ + L/$(call linkpart,$*) + +$(foreach host,$(EXTERNAL_HOSTS),del-bridge.$(host)): del-bridge.%: | cache/db.% + @echo "Deleting fake bridge on external host $(call display,$*)" + @rm -f cache/bridge.$* \ + cache/iface.$*$(SEP)*@1 cache/iface.*$(SEP)$*@2 \ + cache/port.$*$(SEP)*@1 cache/port.*$(SEP)$*@2 \ + cache/endpoint.$*$(SEP)*@? cache/endpoint.*$(SEP)$*@? \ + 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,%) @#echo $* [$<] [$^] $(call rightnode,$*) - @echo $(call default,EXTERNAL_PORT,$(call rightnode,$*)) > $@ @echo "===>" $(call rightnode,$*): \ ./tunproxy -t $$(cat cache/host.$(call leftnode,$*)):$$(cat cache/port.$*@1) \ -p $(call default,EXTERNAL_PORT,$(call rightnode,$*)) -e -d +# reporting +.PHONY: report +report: + @echo SHELL=$(SHELL) + @echo "===> Configuration ($(CONF)):" + @cat $(CONF) + @for f in log/*; do \ + echo "===> Log file $$(basename $$f):"; \ + cat $$f; \ + done