mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
output: add more items to mustach tags
Base level printing; localstime, number of ranges and shared networks, project version, and file paths and time stamps. Also print error and stop template processing when unknown tag is encountered. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
d24313d25a
commit
ff3d9523e6
4 changed files with 154 additions and 34 deletions
|
|
@ -114,6 +114,12 @@ Summary:
|
|||
backup_percent: 2
|
||||
status: 0
|
||||
|
||||
|
||||
number_of_ranges: 5
|
||||
number_of_shared_networks: 2
|
||||
|
||||
|
||||
|
||||
--- skip ok ---
|
||||
Subnets:
|
||||
location: example1
|
||||
|
|
@ -189,3 +195,9 @@ Summary:
|
|||
backup_percent: 2
|
||||
status: 0
|
||||
|
||||
|
||||
number_of_ranges: 5
|
||||
number_of_shared_networks: 2
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,14 +8,16 @@ if [ ! -d tests/outputs ]; then
|
|||
mkdir tests/outputs
|
||||
fi
|
||||
|
||||
remove='/gettimeofday:/d; /^localtime:/d; /^conf_file_/d; /lease_file_/d; /^template_file_/d; /^version:/d'
|
||||
|
||||
dhcpd-pools -c $top_srcdir/samples/dhcpd.conf -l $top_srcdir/samples/dhcpd.leases \
|
||||
--mustach $top_srcdir/samples/mustach.template |
|
||||
sed '/gettimeofday:/d; /lease_file_mtime:/d' >| tests/outputs/$IAM
|
||||
sed "$remove" >| tests/outputs/$IAM
|
||||
|
||||
echo "--- skip ok ---" >> tests/outputs/$IAM
|
||||
dhcpd-pools -c $top_srcdir/samples/dhcpd.conf -l $top_srcdir/samples/dhcpd.leases \
|
||||
--mustach $top_srcdir/samples/mustach.template --skip=ok --warning 44 |
|
||||
sed '/gettimeofday:/d; /lease_file_mtime:/d' >> tests/outputs/$IAM
|
||||
sed "$remove" >> tests/outputs/$IAM
|
||||
|
||||
diff -u $top_srcdir/tests/expected/$IAM tests/outputs/$IAM
|
||||
exit $?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue