Skip to content

Commit 7d08577

Browse files
committed
add tests for force-overwrite and continue flags
1 parent 857c781 commit 7d08577

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/integration/tests/20_upload.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ user=test_dummy.org
88

99

1010
# Create folder with subfolder structure and add some encrypted files
11-
mkdir data_files_enc/dir1 data_files_enc/dir1/dir2
11+
mkdir -p data_files_enc/dir1 data_files_enc/dir1/dir2
1212
cp data_files_enc/data_file.c4gh data_files_enc/data_file3.c4gh
1313
cp data_files_enc/data_file.c4gh data_files_enc/dir1/data_file.c4gh
1414
cp data_files_enc/data_file.c4gh data_files_enc/dir1/dir2/data_file.c4gh
@@ -19,10 +19,19 @@ cp data_files_enc/data_file.c4gh data_files_enc/dir1/dir2/data_file2.c4gh
1919
./sda-cli -config testing/s3cmd.conf upload data_file.c4gh
2020
check_uploaded_file "test/$user/data_file.c4gh" data_file.c4gh
2121

22+
# Upload the file twice check that this returns an error
23+
msg=$(./sda-cli -config testing/s3cmd.conf upload data_file.c4gh 2>&1 | tail -1 || true)
24+
if ! grep -q "Error:" <<< "$msg"
25+
then
26+
echo "wrong error message: $msg"
27+
exit 1
28+
fi
2229

23-
# Try to upload a file twice with the --force-overwrite flag
30+
# Upload a file twice with the --force-overwrite flag
2431
./sda-cli -config testing/s3cmd.conf upload --force-overwrite data_file.c4gh
2532

33+
# Upload an already uploaded file and a new one using the --continue flag (useful for resuming uploads)
34+
./sda-cli -config testing/s3cmd.conf upload data_file.c4gh data_files_enc/data_file1.c4gh --continue
2635

2736
# Test upload all files from a folder, one by one
2837
for k in data_file.c4gh data_file1.c4gh
@@ -32,8 +41,6 @@ do
3241
check_uploaded_file "test/$user/$k" "$k"
3342
done
3443

35-
36-
3744
# Upload a folder recursively and a single file
3845
./sda-cli -config testing/s3cmd.conf upload -r data_files_enc/dir1 data_files_enc/data_file3.c4gh
3946

0 commit comments

Comments
 (0)