ci-setup-rooms.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env bash
  2. # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  3. # SPDX-License-Identifier: GPL-3.0-or-later
  4. # This script is intended to setup specific rooms that we want to test
  5. # Setup a room with lobby enabled and add admin as a normal participant
  6. response=$(curl -u alice:alice 'http://localhost:8080/ocs/v2.php/apps/spreed/api/v4/room' \
  7. -H "OCS-APIRequest: true" \
  8. -H 'content-type: application/json' \
  9. -H 'accept: application/json, text/plain, */*' \
  10. --data-raw '{"roomType":2,"roomName":"LobbyTest"}')
  11. echo $response
  12. token=$(echo $response | jq -r .ocs.data.token)
  13. echo $token
  14. curl -u alice:alice "http://localhost:8080/ocs/v2.php/apps/spreed/api/v4/room/$token/webinar/lobby" \
  15. -X 'PUT' \
  16. -H "OCS-APIRequest: true" \
  17. -H 'content-type: application/json' \
  18. -H 'accept: application/json, text/plain, */*' \
  19. --data-raw '{"state":1}'
  20. curl -u alice:alice "http://localhost:8080/ocs/v2.php/apps/spreed/api/v4/room/$token/participants" \
  21. -H "OCS-APIRequest: true" \
  22. -H 'content-type: application/json' \
  23. -H 'accept: application/json, text/plain, */*' \
  24. --data-raw '{"newParticipant":"admin","source":"users"}'