• Kirill Smelkov's avatar
    software/ors-amarisoft: test: Preprocess enb.cfg & co on YAML loading · d8b0a558
    Kirill Smelkov authored
    Current enb config is already quite complex and with MultiRU it will be growing
    more - both with added features and with more sections emitted because there
    will be multiple radio units, multiple cells and cross cell interactions. So
    for clarity we will want to annotate with a comment to which cell or ru object
    a section belongs, or to which cell-cell pair a particular interaction belongs.
    
    Amarisoft supports C-style comments and preprocessor directives out of the box,
    but if we use them in the configuration files, yaml.load, that we use in the
    test to load generated configs, will break, because // and /* ... */ is not
    valid YAML. It looks like Amarisoft does preprocessing as a separate step
    before further loading given configuration via yaml.
    
    So to be able to use the comments and still have tests working we need to do
    the same - in the tests preprocess the files before feeding them to yaml loader.
    
    -> Do that with the help of https://pypi.org/project/pcpp/
    
    In my view that library has good quality and in my experience it worked
    flawlessly. Anyway we need it to only handle comments, not sophisticated CPP
    features, and for that it works just ok.
    
    Add some comments to existing enb.cfg and ue.cfg to make sure it really works.
    Those are simple comments, and in current state it they might seem as not 100%
    necessary, but with more upcoming config changes it would be good to have those
    descriptionary anchors present in the generated configs, so I suggest we add them.
    Anyway they should not do any harm at all.
    
    /cc @jhuge, @lu.xu, @tomo, @xavier_thompson, @Daetalus
    /proposed-for-review-on !1526
    /reviewed-by TrustMe
    d8b0a558
test.jinja2.py 17.9 KB