]> git.stg.codes - stg.git/blob - functest/test_admins.sh
Use common functions in admin tests and service tests.
[stg.git] / functest / test_admins.sh
1 #!/bin/sh
2
3 source `dirname $0`/functions
4
5 BASEPATH=$1
6
7 SGCONFPATH="$BASEPATH/stg/projects/sgconf"
8
9 RES=`"$SGCONFPATH/sgconf" -s localhost -p 5555 -u admin -w 123456 --get-admins`
10
11 if [ "$?" != "0" ]
12 then
13     printf "Failed to get admins list. Result:\n$RES\n"
14     exit 0
15 fi
16
17 LOGINS=`getFields "login" "$RES"`
18
19 printf "Logins:\n$LOGINS\n"
20
21 NUM=`count "$LOGINS"`
22
23 printf -- "--------\n$NUM\n\n"
24
25 RES=`"$SGCONFPATH/sgconf" -s localhost -p 5555 -u admin -w 123456 --chg-admin admin --priv 111111111`
26
27 if [ "$?" != "0" ]
28 then
29     printf "Failed to update admin's priviledges Result:\n$RES\n"
30     exit 0
31 fi