PageRenderTime 51ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/benchmarks/scenarii/many_meetings.sh

http://github.com/AF83/ucengine
Shell | 56 lines | 40 code | 10 blank | 6 comment | 4 complexity | 1a28528d1c79b104d165b16b1a954db6 MD5 | raw file
  1. #!/usr/bin/env bash
  2. #
  3. # Populate U.C.Engine before a bench
  4. #
  5. UCENGINE_ADMIN="ucengine-admin"
  6. NB_MEETINGS=150 # Number of meetings
  7. NB_USERS=10 # Number of user *per meeting*
  8. FILE="users.csv"
  9. HOST=$1
  10. if [ -z $HOST ];
  11. then
  12. echo "You must provide a domain. $0 <domain>"
  13. exit 1
  14. fi
  15. which $UCENGINE_ADMIN
  16. if [[ $? -ne 0 ]];
  17. then
  18. echo "$UCENGINE_ADMIN was not found"
  19. exit 2
  20. fi
  21. # Role participant
  22. $UCENGINE_ADMIN $HOST role add participant
  23. $UCENGINE_ADMIN $HOST role access add participant "add" "presence"
  24. $UCENGINE_ADMIN $HOST role access add participant "get" "infos"
  25. $UCENGINE_ADMIN $HOST role access add participant "add" "roster"
  26. $UCENGINE_ADMIN $HOST role access add participant "get" "meeting"
  27. $UCENGINE_ADMIN $HOST role access add participant "list" "meeting"
  28. $UCENGINE_ADMIN $HOST role access add participant "view" "video"
  29. $UCENGINE_ADMIN $HOST role access add participant "all" "event"
  30. rm -f $FILE
  31. for i in $(seq 1 $NB_MEETINGS)
  32. do
  33. MEETING="meeting_$i"
  34. echo "Creating meeting $MEETING"
  35. $UCENGINE_ADMIN $HOST meeting add $MEETING
  36. # Users
  37. for j in $(seq 1 $NB_USERS)
  38. do
  39. j=$((($i - 1) * $NB_USERS + $j))
  40. USER="user_$j"
  41. echo "Creating user $USER"
  42. $UCENGINE_ADMIN $HOST user add $USER password toto
  43. $UCENGINE_ADMIN $HOST user role add $USER "participant"
  44. echo "$MEETING;$USER;toto" >> $FILE
  45. done
  46. done