aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-10-24 14:31:13 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-10-24 15:51:07 +0200
commit38b7cff16cee2fb787ca26e2e892dc93e6c9e06c (patch)
tree78a154db92dad300dd851e1a8cc1b1b65bda6f7d
parent68a9801c88b20f717cee3ccab29d57ec07be91d5 (diff)
OsmoHLR: add make target to update the example ctrl and vty files
-rw-r--r--OsmoHLR/Makefile41
1 files changed, 41 insertions, 0 deletions
diff --git a/OsmoHLR/Makefile b/OsmoHLR/Makefile
index a9dc393..234a48c 100644
--- a/OsmoHLR/Makefile
+++ b/OsmoHLR/Makefile
@@ -8,3 +8,44 @@ VTY_REFERENCE = osmohlr-vty-reference.xml
include $(TOPDIR)/build/Makefile.vty-reference.inc
include $(TOPDIR)/build/Makefile.common.inc
+
+OSMO_HLR_PATH ?= ../../osmo-hlr
+TMP_DB = generated/hlr.db
+
+update-examples: update-examples-ctrl update-examples-vty
+
+.PHONY: found-update-deps
+found-update-deps:
+ @if [ ! -f "$(OSMO_HLR_PATH)/sql/hlr.sql" ]; then \
+ echo "You need to define OSMO_HLR_PATH to point at an osmo-hlr.git"; \
+ exit 1; \
+ fi
+ @if [ -z "$(shell which osmo-hlr)" ]; then \
+ echo "osmo-hlr needs to be installed / available in the PATH"; \
+ exit 1; \
+ fi
+ @if [ -z "$(shell which osmo_verify_transcript_ctrl.py)" ]; then \
+ echo "You need to install git.osmocom.org/python/osmo-python-tests.git"; \
+ exit 1; \
+ fi
+ @if [ -z "$(shell which osmo_verify_transcript_vty.py)" ]; then \
+ echo "You need to install git.osmocom.org/python/osmo-python-tests.git"; \
+ exit 1; \
+ fi
+
+update-examples-ctrl: found-update-deps
+ mkdir -p generated
+ rm -f "$(TMP_DB)"
+ sqlite3 "$(TMP_DB)" < "$(OSMO_HLR_PATH)/sql/hlr.sql"
+ sqlite3 "$(TMP_DB)" < "$(OSMO_HLR_PATH)/tests/test_subscriber.sql"
+ osmo_verify_transcript_ctrl.py \
+ -r "osmo-hlr -l $(TMP_DB) -c /n/s/osmo/src/osmo-hlr/doc/examples/osmo-hlr.cfg" \
+ -p 4259 --update *.ctrl
+
+update-examples-vty: found-update-deps
+ mkdir -p generated
+ rm -f "$(TMP_DB)"
+ sqlite3 "$(TMP_DB)" < "$(OSMO_HLR_PATH)/sql/hlr.sql"
+ osmo_verify_transcript_vty.py \
+ -r "osmo-hlr -l $(TMP_DB) -c /n/s/osmo/src/osmo-hlr/doc/examples/osmo-hlr.cfg" \
+ -p 4258 --update *.vty