X-Git-Url: https://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/2f0e47fcf78aeae3bcd0e8126f2f33b98bd285e8..d4c47ce48c5de8bd1066ae3996f6e34cd790cd7c:/tests/util/test-init.sh diff --git a/tests/util/test-init.sh b/tests/util/test-init.sh index e8a53da..5cd161a 100644 --- a/tests/util/test-init.sh +++ b/tests/util/test-init.sh @@ -105,6 +105,15 @@ dx_create_testdir() cd "$dx_testdir" } +dx_pam_header() +{ + awk 'BEGIN { ret=1 } + NR==1 { if (!/^P7$/) exit 1 } + /^P7$/,/^ENDHDR$/ { ret=0; if ($2) print $1"="$2 } + /^ENDHDR$/ { print $1"="NR+1; exit } + END { exit ret }' ${1+"$@"} +} + # Variables to run the LBX tools. Default to the build tree, but can also be # set explicitly to test installed tools. : "${LBXTOOL=$builddir/lbxtool$EXEEXT}"