[Git][debian-gis-team/osmosis][master] Add autopkgtest to verify PBF to XML conversion.

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Sun Dec 3 11:59:58 GMT 2023



Bas Couwenberg pushed to branch master at Debian GIS Project / osmosis


Commits:
e43ba088 by Bas Couwenberg at 2023-12-03T12:59:45+01:00
Add autopkgtest to verify PBF to XML conversion.

- - - - -


3 changed files:

- debian/changelog
- + debian/tests/control
- + debian/tests/pbf2osm


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+osmosis (0.49.2-2) UNRELEASED; urgency=medium
+
+  * Add autopkgtest to verify PBF to XML conversion.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sun, 03 Dec 2023 12:59:18 +0100
+
 osmosis (0.49.2-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,6 @@
+Tests: pbf2osm
+Depends: ca-certificates,
+         diffutils,
+         osmosis,
+         wget
+Restrictions: needs-internet, allow-stderr


=====================================
debian/tests/pbf2osm
=====================================
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+PBF_URL="https://download.geofabrik.de/europe/monaco-latest.osm.pbf"
+PBF_FILE="monaco-latest.osm.pbf"
+XML_FILE="monaco-latest.osm"
+PBF_REPORT="pbf-report.txt"
+XML_REPORT="xml-report.txt"
+
+TEMPDIR="$(mktemp -d)"
+
+cd "${TEMPDIR}" || exit 1
+
+echo "Downloading PBF file"
+wget -q "${PBF_URL}" -O "${PBF_FILE}"
+RC=$?
+
+if [ "${RC}" -ne 0 ]; then
+    cd "${OLDPWD}" || exit 1
+    rm -rf "${TEMPDIR}"
+
+    exit "${RC}"
+fi
+
+echo
+echo "Converting PBF to XML"
+osmosis --read-pbf file="${PBF_FILE}" --write-xml file="${XML_FILE}"
+RC=$?
+
+if [ "${RC}" -ne 0 ]; then
+    cd "${OLDPWD}" || exit 1
+    rm -rf "${TEMPDIR}"
+
+    exit "${RC}"
+fi
+
+echo
+echo "Generating PBF report"
+osmosis --read-pbf file="${PBF_FILE}" --report-entity file="${PBF_REPORT}"
+RC=$?
+
+if [ "${RC}" -ne 0 ]; then
+    cd "${OLDPWD}" || exit 1
+    rm -rf "${TEMPDIR}"
+
+    exit "${RC}"
+fi
+
+echo
+echo "Generating XML report"
+osmosis --read-xml file="${XML_FILE}" --report-entity file="${XML_REPORT}"
+RC=$?
+
+if [ "${RC}" -ne 0 ]; then
+    cd "${OLDPWD}" || exit 1
+    rm -rf "${TEMPDIR}"
+
+    exit "${RC}"
+fi
+
+echo
+echo "Comparing PBF and XML reports"
+diff -u "${PBF_REPORT}" "${XML_REPORT}"
+RC=$?
+
+if [ "${RC}" -ne 0 ]; then
+    cd "${OLDPWD}" || exit 1
+    rm -rf "${TEMPDIR}"
+
+    exit "${RC}"
+fi
+
+cd "${OLDPWD}" || exit 1
+rm -rf "${TEMPDIR}"
+
+exit "${RC}"



View it on GitLab: https://salsa.debian.org/debian-gis-team/osmosis/-/commit/e43ba0885ac4310e5e11106567d4d03e8ab69f25

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/osmosis/-/commit/e43ba0885ac4310e5e11106567d4d03e8ab69f25
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20231203/79f0e8bb/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list