[Koha-bugs] [Bug 29353] New: Auth API tests can fail

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 28 16:15:22 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29353

            Bug ID: 29353
           Summary: Auth API tests can fail
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Test Suite
          Assignee: chris at bigballofwax.co.nz
          Reporter: jonathan.druart+koha at gmail.com
        QA Contact: testopia at bugs.koha-community.org

I usually run `qa` with --run-tests as root.

Tests are setting SessionStorage=tmp so you end up with root only permissions
on the tmp directory:

root at kohadevbox:koha(master)$ ls -l /var/lib/koha/kohadev/tmp/
drwxr-xr-x 2 root root 4096 Oct 28 12:02 cgisess_koha_kohadev

And some REST API auth tests fail:

t/db_dependent/api/v1/auth.t ...........................   
    #   Failed test '403 Forbidden'                        
    #   at t/db_dependent/api/v1/auth.t line 75.           
    #          got: '401'                                  
    #     expected: '403'                                  

    #   Failed test 'exact match for JSON Pointer "/error"'
    #   at t/db_dependent/api/v1/auth.t line 75.           
    #          got: 'Session has been expired.'            
    #     expected: 'Authorization failure. Missing required permission(s).'
    # Looks like you failed 2 tests of 20.                 
t/db_dependent/api/v1/auth.t ........................... 1/3 
#   Failed test 'under() tests'                            
#   at t/db_dependent/api/v1/auth.t line 108.              
t/db_dependent/api/v1/auth.t ........................... 3/3 # Looks like you
failed 1 test of 3.
t/db_dependent/api/v1/auth.t ........................... Dubious, test returned
1 (wstat 256, 0x100)
Failed 1/3 subtests 
t/db_dependent/api/v1/auth_authenticate_api_request.t .. 1/5
    #   Failed test '200 OK'
    #   at t/db_dependent/api/v1/auth_authenticate_api_request.t line 131.      
    #          got: '401'
    #     expected: '200'

    #   Failed test 'The 'koha.user' object is defined in the stash'
    #   at t/db_dependent/api/v1/auth_authenticate_api_request.t line 134.

    #   Failed test 'userenv set correctly'
    #   at t/db_dependent/api/v1/auth_authenticate_api_request.t line 137.
    #          got: undef                                                       
    #     expected: '141'

        #   Failed test 'exact match for JSON Pointer ""'
        #   at t/db_dependent/api/v1/auth_authenticate_api_request.t line 154.
        #     Structures begin differing at:
        #          $got->{error} = 'Session has been expired.'
        #     $expected->{error} = 'Authentication failure.'
        # Looks like you failed 1 test of 3.

    #   Failed test 'logged-out tests'
    #   at t/db_dependent/api/v1/auth_authenticate_api_request.t line 157.
    # Looks like you planned 8 tests but ran 6.
    # Looks like you failed 4 tests of 6 run.

#   Failed test 'cookie-based tests'
#   at t/db_dependent/api/v1/auth_authenticate_api_request.t line 160.
t/db_dependent/api/v1/auth_authenticate_api_request.t .. 4/5 # Looks like you
failed 1 test of 5.
t/db_dependent/api/v1/auth_authenticate_api_request.t .. Dubious, test returned
1 (wstat 256, 0x100)
Failed 1/5 subtests

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list