X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fexp-tool%2FMakefile;h=e54d35b6115c0baa49632cf397d14ac1a0c15044;hb=31ce74a9f05312e3d68e55034b23ff2690a91ce7;hp=f6e85fba08456ce11d31b02fbc3129d1619283fc;hpb=a5b656245597a8aa2fff2a3cf71e13cdd3bd2785;p=sliver-openvswitch.git diff --git a/planetlab/exp-tool/Makefile b/planetlab/exp-tool/Makefile index f6e85fba0..e54d35b61 100644 --- a/planetlab/exp-tool/Makefile +++ b/planetlab/exp-tool/Makefile @@ -155,18 +155,20 @@ cache/db.%: @echo "Starting db server on $(call display,$*) - logs in $(call log,$@)" @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs start-db &> $(call log,$@) && touch $@ -cache/switch.%: cache/db.% +cache/switch.%: | cache/db.% @echo "Starting vswitchd on $(call display,$*) - logs in $(call log,$@)" @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs start-switch &> $(call log,$@) && touch $@ -cache/bridge.%: cache/switch.% +cache/bridge.%: | cache/db.% @echo "Creating bridge on $(call display,$*) - logs in $(call log,$@)" - @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs create-bridge $(BRIDGE) $(IP_$*) > $@ 2> $(call log,$@) || { rm $@; exit 1; } - @echo Created bridge with tap $$(cat $@) on $(call display,$*) + @$(SSH) $(HOST_$*) $(SUDO) \ + sliver-ovs create-bridge $(BRIDGE) $(IP_$*) $(call default,BROPTIONS,$*) &> $(call log,$@) \ + && touch $@ cache/controller.%: cache/bridge.% @echo "Setting controller $(call default,CONTROLLER,$*) on $(call display,$*) - logs in $(call log,$@)" - @$(SSH) $(HOST_$*) $(SUDO) ovs-vsctl set-controller $(BRIDGE) $(call default,CONTROLLER,$*) &> $(call log,$@) || { rm $@; exit 1; } + @$(SSH) $(HOST_$*) $(SUDO) ovs-vsctl set-controller $(BRIDGE) $(call default,CONTROLLER,$*) &> $(call log,$@) \ + && touch $@ # xxx this probably needs a more thorough cleanup in cache/ cache/stop.%: del-bridge.% @@ -175,42 +177,46 @@ cache/stop.%: del-bridge.% ### link-oriented targets # L/- -L/%: cache/link.%@1 cache/link.%@2 +L/%: cache/endpoint.%@1 cache/endpoint.%@2 @touch $@ - @echo "Created link $*" + @echo "Link $* is up" U/%: del-iface.%@1 del-iface.%@2 @rm -f L/$* @echo "Deleted link $*" -del-bridge.%: cache/db.% +del-bridge.%: | cache/db.% @echo "Deleting bridge on $(call display,$*)" @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs del-bridge $(BRIDGE); @rm -f cache/bridge.$* \ cache/iface.$*$(SEP)*@1 cache/iface.*$(SEP)$*@2 \ - cache/link.$*$(SEP)*@? cache/link.*$(SEP)$*@? \ + cache/port.$*$(SEP)*@1 cache/port.*$(SEP)$*@2 \ + cache/endpoint.$*$(SEP)*@? cache/endpoint.*$(SEP)$*@? \ L/$*$(SEP)* L/*$(SEP)$* -del-switch.%: del-bridge.% +del-switch.%: @echo "Shutting down switch on $(call display,$*)" @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop-switch - @rm -f cache/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)$* del-db.%: @echo "Shutting down db on $(call display,$*)" @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs stop-db @rm -f cache/db.$* -del-controller-%: +del-controller-%: | cache/db.% @echo "Removing controller for $(call display,$*)" @$(SSH) $(HOST_$*) $(SUDO) sliver-ovs del-controller $(BRIDGE) @rm -f cache/controller.$* -del-links: $(addprefix U/,$(notdir $(filter-out %.log,$(wildcard L/*)))) +del-links: $(addprefix U/,$(notdir $(wildcard L/*))) -del-switchs: $(addprefix del-,$(notdir $(filter-out %.log,$(wildcard cache/switch.*)))) +del-switchs: $(addprefix del-,$(notdir $(wildcard cache/switch.*))) -del-dbs: $(addprefix del-,$(notdir $(filter-out %.log,$(wildcard cache/db.*)))) +del-dbs: $(addprefix del-,$(notdir $(wildcard cache/db.*))) shutdown: del-switchs del-dbs @@ -253,11 +259,11 @@ cache/rsnap.links.%: .SECONDEXPANSION: -del-iface.%: cache/db.$$(call get,%) +del-iface.%: @echo "Removing interface for link $(call linkpart,$*) from $(call get,$*)" @$(SSH) $(HOST_$(call get,$*)) \ $(SUDO) sliver-ovs del-port L$(call linkpart,$*) - @rm -f cache/iface.$* cache/link.$* cache/link.$(call opp,$*) + @rm -f cache/iface.$* cache/port.$* cache/endpoint.$* cache/endpoint.$(call opp,$*) ### '%' here is leftid-rightid@{1,2} @@ -265,25 +271,32 @@ del-iface.%: cache/db.$$(call get,%) #linkid=$(call linkpart,%) #nodeid=$(call get,%) #bridgefile=cache/bridge.$(nodeid) -cache/iface.%: cache/bridge.$$(call get,%) +cache/iface.%: cache/bridge.$$(call get,%) | cache/switch.$$(call get,%) @echo "Creating interface for link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $(call log,$@)" @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) sliver-ovs create-port $(BRIDGE) \ - L$(call linkpart,$(*F)) > $@ 2> $(call log,$@) || { rm $@; exit 1; } + L$(call linkpart,$(*F)) &> $(call log,$@) \ + && touch $@ + +cache/port.%: cache/iface.% cache/switch.$$(call get,%) + @echo "Getting port number for link $(call linkpart,$(*F)) on $(call display,$(call get,$(*F))) - logs in $(call log,$@)" + @$(SSH) $(call solve,$(call get,$(*F))) $(SUDO) \ + ovs-appctl netdev-tunnel/get-port L$(call linkpart,$(*F)) > $@ 2> $(call log,$@) \ + || { rm $@; exit 1; } # linkid=$(call linkpart,%) # nodeid=$(call get,%) # iface1=cache/iface.% # iface2=cache/iface.$(call opp,%) -cache/link.%: cache/host.$$(call rget,%) cache/iface.% cache/iface.$$(call opp,%) +cache/endpoint.%: cache/host.$$(call rget,%) cache/port.$$(call opp,%) cache/iface.% @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/iface.$(call opp,$(*F))) 2> $(call log,$@) \ + $$(cat cache/port.$(call opp,$(*F))) 2> $(call log,$@) \ && touch $@ #################### -CLEANTARGETS=$(addprefix del-,$(notdir $(filter-out %.log,$(wildcard cache/bridge.*)))) +CLEANTARGETS=$(addprefix del-,$(notdir $(wildcard cache/bridge.*))) clean: $(CLEANTARGETS) distclean: rm -rf L log cache @@ -332,7 +345,7 @@ $(foreach id,$(ALL_NODE_IDS), $(eval $(call node_shortcuts,$(id)))) define link_shortcuts iface.%: cache/iface.% -link.%: cache/link.% +endpoint.%: cache/endpoint.% endef $(foreach id,$(ALL_LINK_IDS), $(eval $(call link_shortcuts,$(id))))