@@ -278,13 +278,230 @@ Feature: federated
278278
279279
280280
281+ Scenario : List federated share from another server not accepted yet
282+ Given Using server "LOCAL"
283+ And user "user0" exists
284+ Given Using server "REMOTE"
285+ And user "user1" exists
286+ # Rename file so it has a unique name in the target server (as the target
287+ # server may have its own /textfile0.txt" file)
288+ And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
289+ And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
290+ And Using server "LOCAL"
291+ When As an "user0"
292+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
293+ Then the list of returned shares has 0 shares
281294
295+ Scenario : List federated share from another server
296+ Given Using server "LOCAL"
297+ And user "user0" exists
298+ Given Using server "REMOTE"
299+ And user "user1" exists
300+ # Rename file so it has a unique name in the target server (as the target
301+ # server may have its own /textfile0.txt" file)
302+ And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
303+ And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
304+ And Using server "LOCAL"
305+ And User "user0" from server "LOCAL" accepts last pending share
306+ When As an "user0"
307+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
308+ Then the list of returned shares has 1 shares
309+ And remote share 0 is returned with
310+ | remote | http ://localhost :8180 / |
311+ | name | /remote -share .txt |
312+ | owner | user1 |
313+ | user | user0 |
314+ | mountpoint | /remote -share .txt |
315+ | mimetype | text /plain |
316+ | mtime | A_NUMBER |
317+ | permissions | 27 |
318+ | type | file |
319+ | file_id | A_NUMBER |
282320
321+ Scenario : List federated share from another server no longer reachable
322+ Given Using server "LOCAL"
323+ And user "user0" exists
324+ Given Using server "REMOTE"
325+ And user "user1" exists
326+ # Rename file so it has a unique name in the target server (as the target
327+ # server may have its own /textfile0.txt" file)
328+ And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
329+ And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
330+ And Using server "LOCAL"
331+ And User "user0" from server "LOCAL" accepts last pending share
332+ And remote server is stopped
333+ When As an "user0"
334+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
335+ Then the list of returned shares has 1 shares
336+ And remote share 0 is returned with
337+ | remote | http ://localhost :8180 / |
338+ | name | /remote -share .txt |
339+ | owner | user1 |
340+ | user | user0 |
341+ | mountpoint | /remote -share .txt |
283342
343+ Scenario : List federated share from another server no longer reachable after caching the file entry
344+ Given Using server "LOCAL"
345+ And user "user0" exists
346+ Given Using server "REMOTE"
347+ And user "user1" exists
348+ # Rename file so it has a unique name in the target server (as the target
349+ # server may have its own /textfile0.txt" file)
350+ And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
351+ And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
352+ And Using server "LOCAL"
353+ And User "user0" from server "LOCAL" accepts last pending share
354+ # Checking that the file exists caches the file entry, which causes an
355+ # exception to be thrown when getting the file info if the remote server is
356+ # unreachable.
357+ And as "user0" the file "/remote-share.txt" exists
358+ And remote server is stopped
359+ When As an "user0"
360+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
361+ Then the list of returned shares has 1 shares
362+ And remote share 0 is returned with
363+ | remote | http ://localhost :8180 / |
364+ | name | /remote -share .txt |
365+ | owner | user1 |
366+ | user | user0 |
367+ | mountpoint | /remote -share .txt |
284368
285369
286370
371+ Scenario : Delete federated share with another server
372+ Given Using server "LOCAL"
373+ And user "user0" exists
374+ Given Using server "REMOTE"
375+ And user "user1" exists
376+ # Rename file so it has a unique name in the target server (as the target
377+ # server may have its own /textfile0.txt" file)
378+ And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
379+ And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
380+ And As an "user1"
381+ And sending "GET" to "/apps/files_sharing/api/v1/shares"
382+ And the list of returned shares has 1 shares
383+ And Using server "LOCAL"
384+ And User "user0" from server "LOCAL" accepts last pending share
385+ And as "user0" the file "/remote-share.txt" exists
386+ And As an "user0"
387+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
388+ And the list of returned shares has 1 shares
389+ And Using server "REMOTE"
390+ When As an "user1"
391+ And Deleting last share
392+ Then the OCS status code should be "100"
393+ And the HTTP status code should be "200"
394+ And As an "user1"
395+ And sending "GET" to "/apps/files_sharing/api/v1/shares"
396+ And the list of returned shares has 0 shares
397+ And Using server "LOCAL"
398+ And as "user0" the file "/remote-share.txt" does not exist
399+ And As an "user0"
400+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
401+ And the list of returned shares has 0 shares
287402
403+ Scenario : Delete federated share from another server
404+ Given Using server "LOCAL"
405+ And user "user0" exists
406+ Given Using server "REMOTE"
407+ And user "user1" exists
408+ # Rename file so it has a unique name in the target server (as the target
409+ # server may have its own /textfile0.txt" file)
410+ And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
411+ And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
412+ And As an "user1"
413+ And sending "GET" to "/apps/files_sharing/api/v1/shares"
414+ And the list of returned shares has 1 shares
415+ And Using server "LOCAL"
416+ And User "user0" from server "LOCAL" accepts last pending share
417+ And as "user0" the file "/remote-share.txt" exists
418+ And As an "user0"
419+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
420+ And the list of returned shares has 1 shares
421+ When user "user0" deletes last accepted remote share
422+ Then the OCS status code should be "100"
423+ And the HTTP status code should be "200"
424+ And as "user0" the file "/remote-share.txt" does not exist
425+ And As an "user0"
426+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
427+ And the list of returned shares has 0 shares
428+ And Using server "REMOTE"
429+ And As an "user1"
430+ And sending "GET" to "/apps/files_sharing/api/v1/shares"
431+ And the list of returned shares has 0 shares
288432
433+ Scenario : Delete federated share from another server no longer reachable
434+ Given Using server "LOCAL"
435+ And user "user0" exists
436+ Given Using server "REMOTE"
437+ And user "user1" exists
438+ # Rename file so it has a unique name in the target server (as the target
439+ # server may have its own /textfile0.txt" file)
440+ And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
441+ And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
442+ And Using server "LOCAL"
443+ And User "user0" from server "LOCAL" accepts last pending share
444+ And as "user0" the file "/remote-share.txt" exists
445+ And As an "user0"
446+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
447+ And the list of returned shares has 1 shares
448+ And remote server is stopped
449+ When user "user0" deletes last accepted remote share
450+ Then the OCS status code should be "100"
451+ And the HTTP status code should be "200"
452+ And as "user0" the file "/remote-share.txt" does not exist
453+ And As an "user0"
454+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
455+ And the list of returned shares has 0 shares
289456
457+ Scenario : Delete federated share file from another server
458+ Given Using server "LOCAL"
459+ And user "user0" exists
460+ Given Using server "REMOTE"
461+ And user "user1" exists
462+ # Rename file so it has a unique name in the target server (as the target
463+ # server may have its own /textfile0.txt" file)
464+ And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
465+ And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
466+ And As an "user1"
467+ And sending "GET" to "/apps/files_sharing/api/v1/shares"
468+ And the list of returned shares has 1 shares
469+ And Using server "LOCAL"
470+ And User "user0" from server "LOCAL" accepts last pending share
471+ And as "user0" the file "/remote-share.txt" exists
472+ And As an "user0"
473+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
474+ And the list of returned shares has 1 shares
475+ When User "user0" deletes file "/remote-share.txt"
476+ Then the HTTP status code should be "204"
477+ And as "user0" the file "/remote-share.txt" does not exist
478+ And As an "user0"
479+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
480+ And the list of returned shares has 0 shares
481+ And Using server "REMOTE"
482+ And As an "user1"
483+ And sending "GET" to "/apps/files_sharing/api/v1/shares"
484+ And the list of returned shares has 0 shares
290485
486+ Scenario : Delete federated share file from another server no longer reachable
487+ Given Using server "LOCAL"
488+ And user "user0" exists
489+ Given Using server "REMOTE"
490+ And user "user1" exists
491+ # Rename file so it has a unique name in the target server (as the target
492+ # server may have its own /textfile0.txt" file)
493+ And User "user1" copies file "/textfile0.txt" to "/remote-share.txt"
494+ And User "user1" from server "REMOTE" shares "/remote-share.txt" with user "user0" from server "LOCAL"
495+ And Using server "LOCAL"
496+ And User "user0" from server "LOCAL" accepts last pending share
497+ And as "user0" the file "/remote-share.txt" exists
498+ And As an "user0"
499+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
500+ And the list of returned shares has 1 shares
501+ And remote server is stopped
502+ When User "user0" deletes file "/remote-share.txt"
503+ Then the HTTP status code should be "204"
504+ And as "user0" the file "/remote-share.txt" does not exist
505+ And As an "user0"
506+ And sending "GET" to "/apps/files_sharing/api/v1/remote_shares"
507+ And the list of returned shares has 0 shares
0 commit comments