func: add pdf test, modify exports

This commit is contained in:
Louis Abel 2023-12-04 02:37:20 -07:00
parent a686f168c3
commit 3b896ae1c2
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36
4 changed files with 35 additions and 2 deletions

View File

@ -113,7 +113,11 @@ function p_getPackageArch() {
}
function p_getDist() {
rpm -q "$(rpm -qf /etc/redhat-release)" --queryformat '%{version}\n' | cut -d'.' -f1
rpm -q --whatprovides redhat-release --queryformat '%{version}\n' | cut -d'.' -f1
}
function p_getMinorVersion() {
rpm -q --whatprovides redhat-release --queryformat '%{version}\n' | cut -d'.' -f2
}
################################################################################
@ -218,8 +222,10 @@ function m_recycleLog() {
rl_ver=$(p_getDist)
rl_arch=$(m_getArch)
rl_minor_ver=$(p_getMinorVersion)
export rl_ver
export rl_arch
export rl_minor_ver
export -f r_log
export -f r_checkExitStatus
@ -234,6 +240,7 @@ export -f p_resetModule
export -f p_getPackageRelease
export -f p_getPackageArch
export -f p_getDist
export -f p_getMinorVersion
export -f m_serviceCycler
export -f m_checkForPort
export -f m_assertCleanExit

View File

@ -0,0 +1,3 @@
#!/bin/bash
r_log "pdf" "Install enscript, ghostscript, and poppler"
p_installPackageNormal fontconfig @fonts enscript ghostscript poppler-utils

View File

@ -0,0 +1,23 @@
#!/bin/bash
r_log "pdf" "Create a PDF from postscript from text, convert it back to text and check"
trap 'rm -rf $PSFILE $PDFFILE $TESTFILE' EXIT
TOFIND="BlueOnyx"
PSFILE="/var/tmp/test.ps"
PDFFILE="/var/tmp/test.pdf"
TESTFILE="/var/tmp/psresult"
encript -q -p $PSFILE /etc/rocky-release
r_log "pdf" "Check created file"
grep -q $TOFIND $PSFILE
pdf_ret_val=$?
r_checkExitStatus $pdf_ret_val
ps2pdf $PSFILE $PDFFILE
pdftotext -q $PDFFILE $TESTFILE
r_log "pdf" "Checking after conversion to text"
grep -q $TOFIND $TESTFILE
text_ret_val=$?
r_checkExitStatus $text_ret_val

View File

@ -62,7 +62,7 @@ fi
# TODO: get some stacks and lib in there
r_processor <(/usr/bin/find ./core -type f | sort -t'/')
#r_processor <(/usr/bin/find ./lib -type f | sort -t'/')
r_processor <(/usr/bin/find ./lib -type f | sort -t'/')
#r_processor <(/usr/bin/find ./stacks -type f | sort -t'/')
r_log "internal" "Core Tests completed"