run curl -X GET -sSf -u "$${NEXTCLOUD_ADMIN_USER}:$${NEXTCLOUD_ADMIN_PASSWORD}""$${OVERWRITECLIURL}/remote.php/webdav/witness.txt" -o /tmp/witness.txt;\
if run cmp -s tests/witness.txt /tmp/witness.txt ;then\
run curl -X GET -sSf -u "$${NEXTCLOUD_ADMIN_USER}:$${NEXTCLOUD_ADMIN_PASSWORD}""$${OVERWRITECLIURL}/remote.php/webdav/witness.txt" -o /tmp/witness.txt;\
if run cmp -s tests/witness.txt /tmp/witness.txt ;then\
echo"File upload verified successfully after upgrade!";\
rm -f /tmp/witness.txt;\
else\
echo"File upload verification failed after upgrade!";\
# Integration tests for PostgreSQL quadlet: backup, restore + major version upgrade (14 to 18)
test:uninstallcleantest-set-pgmajorinstall
@echo "Running PostgreSQL integration tests...";\
set -Eeuo pipefail;\
sleep 2;\
echo"Creating a test database and a witness table...";\
podman exec postgresql-server su postgres -c "createdb test";\
podman exec postgresql-server su postgres -c "psql -U postgres -d test -c \"CREATE TABLE witness (id SERIAL PRIMARY KEY, version VARCHAR); INSERT INTO witness (version) SELECT version();\"";\
podman exec postgresql-server su postgres -c "psql -U postgres -d test -c \"SELECT * FROM witness;\"";\
podman exec postgresql-server createdb test;\
podman exec postgresql-server psql -U postgres -d test -c "CREATE TABLE witness (id SERIAL PRIMARY KEY, version VARCHAR); INSERT INTO witness (version) SELECT version();";\
podman exec postgresql-server psql -U postgres -d test -c "SELECT * FROM witness;";\