From b3256853d940da781a8a05ffd716f817962a55ba Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 25 Apr 2019 12:32:47 +0200 Subject: osmo-config-merge slides --- .../osmodevcon2019-osmo_config_merge.adoc | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 2019/osmodevcon2019-osmo_config_merge/osmodevcon2019-osmo_config_merge.adoc 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 +: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 ... [--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 -- cgit v1.2.3