74 lines
1.7 KiB
Plaintext
74 lines
1.7 KiB
Plaintext
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
|