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@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
The workaround is to remove the tmp directory /var/lib/koha/kohadev/tmp/cgisess_koha_kohadev/
(In reply to Jonathan Druart from comment #1) > The workaround is to remove the tmp directory > /var/lib/koha/kohadev/tmp/cgisess_koha_kohadev/ I will add the qa alias to the kshell env and discourage running as root.
(In reply to Tomás Cohen Arazi from comment #2) > (In reply to Jonathan Druart from comment #1) > > The workaround is to remove the tmp directory > > /var/lib/koha/kohadev/tmp/cgisess_koha_kohadev/ > > I will add the qa alias to the kshell env and discourage running as root. I believe this has been done in ktd now :) Please reopen if you disagree.