Nowadays goss yml files are generated by ngcpcfg. But their content
depends on whether the node is active or not, which can change
dynamically during the lifetime of the generated files from the
templates. Which will make the goss checks fail when the node state
changes.
Switch the node state into a run-time variable, and use go template
support to parametrize this into the goss checks.
For the Template Toolkit values that get instantiated within the go
template conditionals, we need to make sure we always set a boolean
value, as the Template Toolkit will return undef on false values,
which would be considered a non-existining argument. Even though the
has_role method will always return either 0 or 1, we still force
a boolean value to make the code future-proof in case more logic is
added on the same check, which would then turn it into a Template
Toolkit boolean evaluation and possibly return nothing on false.
Change-Id: I19c3ef48f09c8d2e79613ef118adc362399a6e78
Otherwise we have an error here:
> root@spce:~# /usr/share/ngcp-tests/testrunner
> ...
> Error: yaml: line 3: found unknown escape character
Change-Id: I377a5796754a9310148c8361cb397e54722c8cfa
While we have lua5.1 on Debian/stretch, it's lua5.2 on Debian/buster
and lua5.3 is available as well in buster, so instead of hardcoding
the lua version 5.1, let's support whatever lua5.X version is used.
Fixes:
| not ok 34 - Command: pgrep -c -f '[l]ua5.1 /usr/bin/prosody': stdout: patterns not found: [1]
While at it, drop the unnecessary '[l]' approach, which
is a nice trick to avoid matching the grep process itself
within a `ps aux | grep ...`, but doesn't apply to
pgrep, thanks to Manuel Montecelo for spotting this leftover.
Change-Id: I3c62ddefbaf5a22f623b779426621ebaafec26b2
This simplifies the pseudo-function calls into proper ones.
Reaname the confusing is_li_enabled into the more descriptive name
is_li_dist.
Change-Id: I42b079945c100aafa37eab9f44307fac940f42a8
Unify all templates into a single tree, no more CE vs PRO distinction.
Handle inactive nodes, and CARRIER systems.
Change-Id: Id2800e0cc746233cb69a1b9a09769f26aa9c2a5d