From 110453a7f2b0982e5dfcca292664b316439a6bdf Mon Sep 17 00:00:00 2001 From: ttionya Date: Fri, 10 May 2024 19:22:58 +0800 Subject: [PATCH] test: test backup zip file --- tests/Dockerfile | 2 ++ tests/test.sh | 3 +++ tests/units/backup-zip-file/test.sh | 13 +++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 tests/test.sh create mode 100644 tests/units/backup-zip-file/test.sh diff --git a/tests/Dockerfile b/tests/Dockerfile index 3a70de0..8146c9c 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -1,3 +1,5 @@ FROM ttionya/vaultwarden-backup:dev +COPY tests/fixtures/source / + ENTRYPOINT ["/app/entrypoint.sh"] diff --git a/tests/test.sh b/tests/test.sh new file mode 100644 index 0000000..7985c04 --- /dev/null +++ b/tests/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +. units/backup-zip-file/test.sh diff --git a/tests/units/backup-zip-file/test.sh b/tests/units/backup-zip-file/test.sh new file mode 100644 index 0000000..2b64fff --- /dev/null +++ b/tests/units/backup-zip-file/test.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +echo "Test backup-zip-file" + +mkdir -p outputs/backup-zip-file + +docker run --rm \ + --mount type=bind,source=$(pwd)/outputs/backup-zip-file,target=/outputs \ + -e RCLONE_REMOTE_DIR=/outputs \ + ttionya/vaultwarden-backup:test \ + backup + +ls -l outputs/backup-zip-file