diff options
author | Harald Welte <laforge@osmocom.org> | 2020-10-12 21:15:49 +0200 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2022-02-10 19:08:40 +0600 |
commit | a35bc6bdf29f7a1ee92cea8609e6485b65e7f79a (patch) | |
tree | f8fe6528e17bdb4bb3a2a05ed5ea17e0a2079ea7 /ttcn3-bts-test/Makefile | |
parent | edaa9d3033aaeab69014b0b355cfd7511341c9b2 (diff) |
ttcn3-bts-test: use osmo-config-merge to generate config filesfixeria/confmerge
This uses the config files from osmo-ttcn3-hacks.git instead of keeping
local copies around here, which has shown many times will get out of
sync. Extract the original files (*.src.cfg) from the testsuite image
(ttcn3-bts-test) and merge them with the local *.confmerge files using
osmo-config-merge. Use the resulting files (*.gen.cfg).
Unfortunately, osmo-config-merge is not capable of removing text blocks
or substituting specific parts, so we fall-back to using sed where it's
needed. A good example is 'log gsmtap 127.0.0.1', as there is no
command for removing a logging target of such type.
Co-Authored-By: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
Co-Authored-By: Oliver Smith <osmith@sysmocom.de>
Change-Id: If15461240f3037c142c176fc7da745a1701ae3f8
Diffstat (limited to 'ttcn3-bts-test/Makefile')
-rw-r--r-- | ttcn3-bts-test/Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/ttcn3-bts-test/Makefile b/ttcn3-bts-test/Makefile index 0895788..26325f8 100644 --- a/ttcn3-bts-test/Makefile +++ b/ttcn3-bts-test/Makefile @@ -1,2 +1,45 @@ include ../make/Makefile + +CFG_SRC_FILES = \ + osmo-bts.src.cfg \ + osmo-bsc.src.cfg + +CFG_GEN_FILES = \ + generic/osmo-bts.gen.cfg \ + generic/osmo-bsc.gen.cfg \ + virtphy/osmo-bts.gen.cfg \ + oml/osmo-bts.gen.cfg \ + fh/osmo-bsc.gen.cfg + +.PHONY: cfg +cfg: $(CFG_SRC_FILES) $(CFG_GEN_FILES) + +# Ensure that we always fetch up-to-date configuration files. +# See https://www.gnu.org/software/make/manual/make.html#Force-Targets +%src.cfg: FORCE_FETCH + $(MAKE) run \ + RUN_ARGS="-v $(CURDIR):/data --user $(UID)" \ + RUN_CMD="cp /osmo-ttcn3-hacks/bts/$(@:%.src.cfg=%.cfg) /data/$@" +FORCE_FETCH: + +generic/osmo-bts.gen.cfg: osmo-bts.src.cfg generic/osmo-bts.confmerge + osmo-config-merge $^ > $@ + sed -i "s/log gsmtap 127.0.0.1/log gsmtap 172.18.9.10/" $@ + +generic/osmo-bsc.gen.cfg: osmo-bsc.src.cfg generic/osmo-bsc.confmerge + osmo-config-merge $^ > $@ + sed -i "s/log gsmtap 127.0.0.1/log gsmtap 172.18.9.10/" $@ + +virtphy/osmo-bts.gen.cfg: generic/osmo-bts.gen.cfg virtphy/osmo-bts.confmerge + osmo-config-merge $^ > $@ + sed -i "/osmotrx/d" $@ + +oml/osmo-bts.gen.cfg: generic/osmo-bts.gen.cfg oml/osmo-bts.confmerge + osmo-config-merge $^ > $@ + +fh/osmo-bsc.gen.cfg: generic/osmo-bsc.gen.cfg fh/osmo-bsc.confmerge + osmo-config-merge $^ > $@ + +clean: + @rm -f $(CFG_SRC_FILES) $(CFG_GEN_FILES) |