summaryrefslogtreecommitdiff
path: root/2019
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-04-25 12:32:47 +0200
committerHarald Welte <laforge@gnumonks.org>2019-04-25 12:32:47 +0200
commitb3256853d940da781a8a05ffd716f817962a55ba (patch)
treebcba7c42700ec1243795c3e06e144de16d91c200 /2019
parent3120341481e52871c8d3748e9d0ca5a9de1ea115 (diff)
osmo-config-merge slides
Diffstat (limited to '2019')
-rw-r--r--2019/osmodevcon2019-osmo_config_merge/osmodevcon2019-osmo_config_merge.adoc73
1 files changed, 73 insertions, 0 deletions
diff --git a/2019/osmodevcon2019-osmo_config_merge/osmodevcon2019-osmo_config_merge.adoc b/2019/osmodevcon2019-osmo_config_merge/osmodevcon2019-osmo_config_merge.adoc
new file mode 100644
index 0000000..ccee19c
--- /dev/null
+++ b/2019/osmodevcon2019-osmo_config_merge/osmodevcon2019-osmo_config_merge.adoc
@@ -0,0 +1,73 @@
+osmo-config-merge
+=================
+:author: Harald Welte <laforge@gnumonks.org>
+:copyright: 2019 by Harald Welte (License: CC-BY-SA)
+:backend: slidy
+:max-width: 45em
+
+
+== Problem statement
+
+* in automatic testing, we have tons of copies of config files
+* config file syntax breaks every so often during development
+* manually updating all copies is error-prone and time consuming
+* in many cases, a given test only wants to modify very few settings compared to default/example config
+
+== So why not simply apply a diff?
+
+* the way how unified / context sensitive diff works doesn't match well
+* context above/below the to-be-changed/inserted line breaks as example config evolves
+* vty actually does have structure: Its hierarchy.
+
+== `osmo-config-merge`
+
+* allows to add "diffs" to osmocom VTY-style config files
+* exploits the hierarchical nature to simply add lines to a given node in the tree
+* lines are always appended to the end of node, so last incarnation of any given command will override any
+ earlier incarnations
+
+----
+Usage: osmo-config-merge <config-file> <config-patch>...<config-patch> [--debug]
+----
+
+== Patch Format
+
+* patch format simply follows normal VTY syntax
+* full path of VTY nodes must be specified
+
+----
+network
+ bts 0
+ trx 0
+ max-power-red 12
+----
+
+== Example usage
+
+----
+$ osmo-config-merge osmo-bsc.cfg foo.diff > patched.cfg
+----
+
+renders
+
+----
+$ diff -u osmo-bsc.cfg patched.cfg
+--- osmo-bsc.cfg 2019-01-19 21:30:49.215940012 +0100
++++ patched.cfg 2019-04-25 12:29:48.163401121 +0200
+@@ -71,6 +71,7 @@
+ timeslot 7
+ phys_chan_config TCH/F
+ hopping enabled 0
++ max-power-red 12
+ msc 0
+ no bsc-welcome-text
+ no bsc-msc-lost-text
+----
+
+
+== Demo
+
+
+== EOF
+
+End of File
personal git repositories of Harald Welte. Your mileage may vary