/
checksums.feature
174 lines (151 loc) · 10.8 KB
/
checksums.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
Feature: checksums
Scenario: Uploading a file with checksum should work
Given using old dav path
And user "user0" exists
When user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
Then The webdav response should have a status code "201"
Scenario: Uploading a file with checksum should return the checksum in the propfind
Given using old dav path
And user "user0" exists
And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When user "user0" request the checksum of "/myChecksumFile.txt" via propfind
Then The webdav checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f MD5:d70b40f177b14b470d1756a3c12b963a ADLER32:8ae90960"
Scenario: Uploading a file with checksum should return the checksum in the download header
Given using old dav path
And user "user0" exists
And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When user "user0" downloads the file "/myChecksumFile.txt"
Then The header checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f"
Scenario: Moving a file with checksum should return the checksum in the propfind
Given using old dav path
And user "user0" exists
And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When User "user0" moves file "/myChecksumFile.txt" to "/myMovedChecksumFile.txt"
And user "user0" request the checksum of "/myMovedChecksumFile.txt" via propfind
Then The webdav checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f MD5:d70b40f177b14b470d1756a3c12b963a ADLER32:8ae90960"
Scenario: Moving file with checksum should return the checksum in the download header
Given using old dav path
And user "user0" exists
And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When User "user0" moves file "/myChecksumFile.txt" to "/myMovedChecksumFile.txt"
And user "user0" downloads the file "/myMovedChecksumFile.txt"
Then The header checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f"
Scenario: Uploading a chunked file with checksum should return the checksum in the propfind
Given using old dav path
And user "user0" exists
And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChecksumFile.txt" with checksum "MD5:45a72715acdd5019c5be30bdbb75233e"
And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChecksumFile.txt" with checksum "MD5:45a72715acdd5019c5be30bdbb75233e"
And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChecksumFile.txt" with checksum "MD5:45a72715acdd5019c5be30bdbb75233e"
When user "user0" request the checksum of "/myChecksumFile.txt" via propfind
Then The webdav checksum should match "SHA1:acfa6b1565f9710d4d497c6035d5c069bd35a8e8 MD5:45a72715acdd5019c5be30bdbb75233e ADLER32:1ecd03df"
Scenario: Uploading a chunked file with checksum should return the checksum in the download header
Given using old dav path
And user "user0" exists
And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChecksumFile.txt" with checksum "MD5:45a72715acdd5019c5be30bdbb75233e"
And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChecksumFile.txt" with checksum "MD5:45a72715acdd5019c5be30bdbb75233e"
And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChecksumFile.txt" with checksum "MD5:45a72715acdd5019c5be30bdbb75233e"
When user "user0" downloads the file "/myChecksumFile.txt"
Then The header checksum should match "SHA1:acfa6b1565f9710d4d497c6035d5c069bd35a8e8"
@local_storage
Scenario: Downloading a file from local storage has correct checksum
Given using old dav path
And user "user0" exists
And file "prueba_cksum.txt" with text "Test file for checksums" is created in local storage
When user "user0" downloads the file "/local_storage/prueba_cksum.txt"
When user "user0" downloads the file "/local_storage/prueba_cksum.txt"
Then The header checksum should match "SHA1:a35b7605c8f586d735435535c337adc066c2ccb6"
Scenario: Uploading a file with checksum should work using new dav path
Given using new dav path
And user "user0" exists
When user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
Then The webdav response should have a status code "201"
Scenario: Uploading a file with checksum should return the checksum in the propfind using new dav path
Given using new dav path
And user "user0" exists
And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When user "user0" request the checksum of "/myChecksumFile.txt" via propfind
Then The webdav checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f MD5:d70b40f177b14b470d1756a3c12b963a ADLER32:8ae90960"
Scenario: Uploading a file with checksum should return the checksum in the download header using new dav path
Given using new dav path
And user "user0" exists
And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When user "user0" downloads the file "/myChecksumFile.txt"
Then The header checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f"
Scenario: Moving a file with checksum should return the checksum in the propfind using new dav path
Given using new dav path
And user "user0" exists
And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When User "user0" moved file "/myChecksumFile.txt" to "/myMovedChecksumFile.txt"
And user "user0" request the checksum of "/myMovedChecksumFile.txt" via propfind
Then The webdav checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f MD5:d70b40f177b14b470d1756a3c12b963a ADLER32:8ae90960"
Scenario: Moving file with checksum should return the checksum in the download header using new dav path
Given using new dav path
And user "user0" exists
And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When User "user0" moved file "/myChecksumFile.txt" to "/myMovedChecksumFile.txt"
And user "user0" downloads the file "/myMovedChecksumFile.txt"
Then The header checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f"
Scenario: Copying a file with checksum should return the checksum in the propfind using new dav path
Given using new dav path
And user "user0" exists
And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When User "user0" copies file "/myChecksumFile.txt" to "/myChecksumFileCopy.txt"
And user "user0" request the checksum of "/myChecksumFileCopy.txt" via propfind
Then The webdav checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f MD5:d70b40f177b14b470d1756a3c12b963a ADLER32:8ae90960"
Scenario: Copying file with checksum should return the checksum in the download header using new dav path
Given using new dav path
And user "user0" exists
And user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When User "user0" copies file "/myChecksumFile.txt" to "/myChecksumFileCopy.txt"
And user "user0" downloads the file "/myChecksumFileCopy.txt"
Then The header checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f"
@local_storage
Scenario: Downloading a file from local storage has correct checksum using new dav path
Given using new dav path
And user "user0" exists
And file "prueba_cksum.txt" with text "Test file for checksums" is created in local storage
When user "user0" downloads the file "/local_storage/prueba_cksum.txt"
When user "user0" downloads the file "/local_storage/prueba_cksum.txt"
Then The header checksum should match "SHA1:a35b7605c8f586d735435535c337adc066c2ccb6"
Scenario: Upload chunked file where checksum does not match
Given using new dav path
And user "user0" exists
And user "user0" creates a new chunking upload with id "chunking-42"
And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42" with checksum "SHA1:f005ba11"
Then the HTTP status code should be "400"
Scenario: Upload a file where checksum does not match
Given using old dav path
Given user "user0" exists
And file "/chksumtst.txt" does not exist for user "user0"
And user "user0" uploads file with checksum "SHA1:f005ba11" and content "Some Text" to "/chksumtst.txt"
Then the HTTP status code should be "400"
Scenario: Upload a file where checksum does match
Given using old dav path
Given user "user0" exists
And file "/chksumtst.txt" does not exist for user "user0"
And user "user0" uploads file with checksum "SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399" and content "Some Text" to "/chksumtst.txt"
Then the HTTP status code should be "201"
Scenario: Uploaded file should have the same checksum when downloaded
Given using old dav path
Given user "user0" exists
And file "/chksumtst.txt" does not exist for user "user0"
And user "user0" uploads file with checksum "SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399" and content "Some Text" to "/chksumtst.txt"
When Downloading file "/chksumtst.txt" as "user0"
Then The following headers should be set
| OC-Checksum | SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399 |
@local_storage
Scenario: Uploaded file to external storage should have the same checksum when downloaded
Given using old dav path
Given user "user0" exists
And file "/local_storage/chksumtst.txt" does not exist for user "user0"
And user "user0" uploads file with checksum "SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399" and content "Some Text" to "/local_storage/chksumtst.txt"
When Downloading file "/local_storage/chksumtst.txt" as "user0"
Then The following headers should be set
| OC-Checksum | SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399 |
## Validation Plugin or Old Endpoint Specific
Scenario: Uploading a old method chunked file with checksum should fail using new dav path
Given using new dav path
And user "user0" exists
When user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChecksumFile.txt" with checksum "MD5:45a72715acdd5019c5be30bdbb75233e"
Then the HTTP status code should be "503"