You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
811 B
21 lines
811 B
PARENT_DIR := ..
|
|
include $(PARENT_DIR)/Makefile
|
|
|
|
.PHONY: test
|
|
|
|
test: uninstall clean install
|
|
@run() { echo $$*; "$$@"; }; \
|
|
echo "Running Nextcloud tests..."; \
|
|
set -Eeuo pipefail; \
|
|
source config/config.env; \
|
|
echo "Uploading file..."; \
|
|
run curl -X PUT -sSf -u "$${NEXTCLOUD_ADMIN_USER}:$${NEXTCLOUD_ADMIN_PASSWORD}" --data-binary @tests/witness.txt "$${OVERWRITECLIURL}/remote.php/webdav/witness.txt" -b cookies.txt; \
|
|
echo "Verifying file upload..."; \
|
|
run curl -X GET -sSf -u "$${NEXTCLOUD_ADMIN_USER}:$${NEXTCLOUD_ADMIN_PASSWORD}" "$${OVERWRITECLIURL}/remote.php/webdav/witness.txt" -o /tmp/witness.txt -b cookies.txt; \
|
|
if run cmp -s tests/witness.txt /tmp/witness.txt ; then \
|
|
echo "File upload verified successfully!"; \
|
|
else \
|
|
echo "File upload verification failed!"; \
|
|
exit 1; \
|
|
fi
|
|
|
|
|