Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OC-Checksum header not checked when uploading file #1315

Closed
individual-it opened this issue Feb 24, 2020 · 2 comments
Closed

OC-Checksum header not checked when uploading file #1315

individual-it opened this issue Feb 24, 2020 · 2 comments

Comments

@individual-it
Copy link
Member

No description provided.

@PVince81
Copy link
Contributor

PVince81 commented May 5, 2020

make test-acceptance-api \
TEST_SERVER_URL=http://localhost:9140 \
TEST_EXTERNAL_USER_BACKENDS=true \
TEST_OCIS=true \
OCIS_REVA_DATA_ROOT=/var/tmp/reva/ \
BEHAT_FILTER_TAGS='~@skipOnOcV10&&~@skipOnLDAP&&@TestAlsoOnExternalUserBackend&&~@local_storage&&@issue-ocis-reva-99'
composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package guzzlehttp/ringphp is abandoned, you should avoid using it. No replacement was suggested.
Package guzzlehttp/streams is abandoned, you should avoid using it. No replacement was suggested.
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.                                                                                                                                 
Generating optimized autoload files
Composer cleaner: Removed 5 files or directories.
composer bin behat install --no-progress
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package zendframework/zend-ldap is abandoned, you should avoid using it. Use laminas/laminas-ldap instead.
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
./tests/acceptance/run.sh --type api
Script path: /srv/www/htdocs/owncloud/tests/acceptance
Not using php inbuilt server for running scenario ...
Updating .htaccess for proper rewrites
PHP Warning:  fopen(/srv/www/htdocs/owncloud/config/config.php): failed to open stream: Permission denied in /srv/www/htdocs/owncloud/lib/private/Config.php on line 239
PHP Warning:  flock() expects parameter 1 to be resource, bool given in /srv/www/htdocs/owncloud/lib/private/Config.php on line 249


Running all API tests tagged ~@skipOnOcV&&~@skipOnOcV&&~@skipOnOcV&&~@skipOnOcV10&&~@skipOnLDAP&&@TestAlsoOnExternalUserBackend&&~@local_storage&&@issue-ocis-reva-99&&@api&&~@skip 
@api @TestAlsoOnExternalUserBackend
Feature: checksums

  Background:                                                                      # /srv/www/htdocs/owncloud/tests/acceptance/features/apiMain/checksums.feature:4                                                                                                           
    Given user "user0" has been created with default attributes and skeleton files # FeatureContext::userHasBeenCreatedWithDefaultAttributes()                                                                                                                                

  @skipOnOcis @issue-ocis-reva-99
  Scenario Outline: Upload a file where checksum does not match                                                                   # /srv/www/htdocs/owncloud/tests/acceptance/features/apiMain/checksums.feature:234                                                          
    Given using <dav_version> DAV path                                                                                            # FeatureContext::usingOldOrNewDavPath()                                                                                                    
    When user "user0" uploads file with checksum "SHA1:f005ba11" and content "Some Text" to "/chksumtst.txt" using the WebDAV API # FeatureContext::userUploadsAFileWithChecksumAndContentTo()                                                                                
    Then the HTTP status code should be "400"                                                                                     # FeatureContext::thenTheHTTPStatusCodeShouldBe()                                                                                           
    And user "user0" should not see the following elements                                                                        # FeatureContext::userShouldSeeTheElements()                                                                                                
      | /chksumtst.txt |

    Examples:
      | dav_version |
      | old         |
        HTTP status code 201 is not the expected value 400
        Failed asserting that 201 matches expected '400'.                                                                              
      | new         |
        HTTP status code 201 is not the expected value 400
        Failed asserting that 201 matches expected '400'.                                                                              

  @skipOnOcis @issue-ocis-reva-99
  Scenario Outline: Uploaded file should have the same checksum when downloaded                                                                  # /srv/www/htdocs/owncloud/tests/acceptance/features/apiMain/checksums.feature:268
    Given using <dav_version> DAV path                                                                                                           # FeatureContext::usingOldOrNewDavPath()
    And user "user0" has uploaded file with checksum "SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399" and content "Some Text" to "/chksumtst.txt" # FeatureContext::userHasUploadedAFileWithChecksumAndContentTo()
    When user "user0" downloads file "/chksumtst.txt" using the WebDAV API                                                                       # FeatureContext::userDownloadsFileUsingTheAPI()
    Then the following headers should be set                                                                                                     # FeatureContext::theFollowingHeadersShouldBeSet()
      | header      | value                                         |
      | OC-Checksum | SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399 |

    Examples:
      | dav_version |
      | old         |
        Missing expected header 'OC-Checksum' (Exception)
      | new         |
        Missing expected header 'OC-Checksum' (Exception)

--- Failed scenarios:

    /srv/www/htdocs/owncloud/tests/acceptance/features/apiMain/checksums.feature:242
    /srv/www/htdocs/owncloud/tests/acceptance/features/apiMain/checksums.feature:243
    /srv/www/htdocs/owncloud/tests/acceptance/features/apiMain/checksums.feature:277
    /srv/www/htdocs/owncloud/tests/acceptance/features/apiMain/checksums.feature:278

4 scenarios (4 failed)
20 steps (14 passed, 4 failed, 2 skipped)
0m5.14s (19.76Mb)

@butonic butonic transferred this issue from owncloud/ocis-reva Jan 18, 2021
@refs
Copy link
Member

refs commented Jan 19, 2021

closing in favor of #1316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants