run curl -X GET -sSf -u "$${NEXTCLOUD_ADMIN_USER}:$${NEXTCLOUD_ADMIN_PASSWORD}""$${OVERWRITECLIURL}/remote.php/webdav/witness.txt" -o /tmp/witness.txt;\
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\
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;\
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\
if run cmp -s tests/witness.txt /tmp/witness.txt ;then\
echo"File upload verified successfully after upgrade!";\
echo"File upload verified successfully after upgrade!";\
rm -f /tmp/witness.txt;\
else\
else\
echo"File upload verification failed after upgrade!";\
echo"File upload verification failed after upgrade!";\
echo"Creating a test database and a witness table...";\
echo"Creating a test database and a witness table...";\
podman exec postgresql-server su postgres -c "createdb test";\
podman exec postgresql-server 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 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 psql -U postgres -d test -c "SELECT * FROM witness;";\