PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms 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#
 4# Populate U.C.Engine before a bench
 5#
 6
 7UCENGINE_ADMIN="ucengine-admin"
 8NB_MEETINGS=150 # Number of meetings
 9NB_USERS=10     # Number of user *per meeting*
10FILE="users.csv"
11
12HOST=$1
13
14if [ -z $HOST ];
15then
16    echo "You must provide a domain. $0 <domain>"
17    exit 1
18fi
19
20which $UCENGINE_ADMIN
21if [[ $? -ne 0 ]];
22then
23    echo "$UCENGINE_ADMIN was not found"
24    exit 2
25fi
26
27# Role participant
28$UCENGINE_ADMIN $HOST role add participant
29$UCENGINE_ADMIN $HOST role access add participant "add" "presence"
30$UCENGINE_ADMIN $HOST role access add participant "get" "infos"
31$UCENGINE_ADMIN $HOST role access add participant "add" "roster"
32$UCENGINE_ADMIN $HOST role access add participant "get" "meeting"
33$UCENGINE_ADMIN $HOST role access add participant "list" "meeting"
34$UCENGINE_ADMIN $HOST role access add participant "view" "video"
35$UCENGINE_ADMIN $HOST role access add participant "all" "event"
36
37rm -f $FILE
38
39for i in $(seq 1 $NB_MEETINGS)
40do
41    MEETING="meeting_$i"
42    echo "Creating meeting $MEETING"
43    $UCENGINE_ADMIN $HOST meeting add $MEETING
44
45
46    # Users
47    for j in $(seq 1 $NB_USERS)
48    do
49        j=$((($i - 1) * $NB_USERS + $j))
50        USER="user_$j"
51        echo "Creating user $USER"
52        $UCENGINE_ADMIN $HOST user add $USER password toto
53        $UCENGINE_ADMIN $HOST user role add $USER "participant"
54        echo "$MEETING;$USER;toto" >> $FILE
55    done
56done