# bgp/2suns

GENCONFIG=	$(GATED_TOOLS_PATH)/scripts/gen_config
TESTG=		$(GATED_TOOLS_PATH)/scripts/testg
THEHOST=	`hostname | sed -e 's/\([^.]\)\..*/\1/'`
TEST_FLAGS=	-a -q -M
AUTO=		2suns.auto

CONFIG=		2suns.cfg
TESTFILES=	gated.conf.2suns.mole.1.1 \
		expected.2suns.mole.1.1 \
 		gated.conf.2suns.mole.1.2 \
 		expected.2suns.mole.1.2 \
 		gated.conf.2suns.cannes.1.1 \
 		expected.2suns.cannes.1.1 \
		gated.conf.2suns.cannes.1.2 \
 		expected.2suns.cannes.1.2 \
 		gated.conf.2suns.mole.2.1 \
		expected.2suns.mole.2.1 \
		gated.conf.2suns.mole.2.2 \
 		expected.2suns.mole.2.2 \
		gated.conf.2suns.cannes.2.1 \
 		expected.2suns.cannes.2.1 \
 		gated.conf.2suns.cannes.2.2 \
 		expected.2suns.cannes.2.2


$(TESTFILES):	$(CONFIG)
	$(GENCONFIG) $(CONFIG)

config: $(TESTFILES)

test: test_done

test_done: config $(AUTO) 
	@rm -f test_done
	@( THEHOST=$(THEHOST); export THEHOST; \
		if [ "$$THEHOST" = "cannes" -o "$$THEHOST" = "mole" ]; \
			then $(TESTG) $(TEST_FLAGS) < $(AUTO); \
		else echo "Skipping, $$THEHOST not a part of test."; \
		fi )
	@touch test_done

clean:
	rm -f expected.* gated.conf.* test_done

cleantest:
	rm -f test_done
