Skip to content
Snippets Groups Projects
Commit b409d7b1 authored by Simon McVittie's avatar Simon McVittie
Browse files

libreoffice: work in a directory that LibreOffice can legitimately write


This means we don't have to worry about whether the ${TESTDIR}
is allowed by its AppArmor profile (it shouldn't really be).

Reviewed-by: default avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D3632
parent 61fd9f95
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,11 @@ UNOCONV="${TESTLIBDIR}/unoconv.py"
check_not_root
# Chosen to be something that the AppArmor profile for LibreOffice
# should normally allow
docsdir="$(mktemp -d ~/Documents/apertis-tests-libreoffice.XXXXXX)"
cp -a "${MEDIA_RESOURCE_DIR}/documents/"*.od[pst] "${docsdir}/"
setup_success
###########
......@@ -34,15 +39,15 @@ _to_pdf() {
}
ods_to_pdf() {
_to_pdf "${MEDIA_RESOURCE_DIR}/documents/"*.ods "${WORKDIR}/test-$RANDOM.pdf"
_to_pdf "${docsdir}/"*.ods "${docsdir}/test-$RANDOM.pdf"
}
odp_to_pdf() {
_to_pdf "${MEDIA_RESOURCE_DIR}/documents/"*.odp "${WORKDIR}/test-$RANDOM.pdf"
_to_pdf "${docsdir}/"*.odp "${docsdir}/test-$RANDOM.pdf"
}
odt_to_pdf() {
_to_pdf "${MEDIA_RESOURCE_DIR}/documents/"*.odt "${WORKDIR}/test-$RANDOM.pdf"
_to_pdf "${docsdir}/"*.odt "${docsdir}/test-$RANDOM.pdf"
}
trap "test_failure" ERR
......@@ -53,4 +58,5 @@ odp_to_pdf
odt_to_pdf
EOF
rm -fr "${docsdir}"
test_success
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment