forked from sig_core/toolkit
func: add pdf test, modify exports
This commit is contained in:
parent
a686f168c3
commit
3b896ae1c2
@ -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
|
||||
|
3
func/lib/pdf/00-install-pdf-utils.sh
Normal file
3
func/lib/pdf/00-install-pdf-utils.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
r_log "pdf" "Install enscript, ghostscript, and poppler"
|
||||
p_installPackageNormal fontconfig @fonts enscript ghostscript poppler-utils
|
23
func/lib/pdf/10-test-pdf.sh
Normal file
23
func/lib/pdf/10-test-pdf.sh
Normal 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
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user