File: users.sh

package info (click to toggle)
cssc 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,540 kB
  • ctags: 10,602
  • sloc: cpp: 39,776; sh: 16,907; ansic: 13,767; python: 3,923; makefile: 1,698; perl: 342; awk: 15
file content (58 lines) | stat: -rw-r--r-- 1,754 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#! /bin/sh

# users.sh:  Testing for -a and -e options of admin.

# Import common functions & definitions.
. ../common/test-common

g=bar
s=s.${g}
z=z.${g}

remove $s $g $z foo command.log last.command core 
remove expected.stderr got.stderr expected.stdout got.stdout

remove foo
echo '%M%' > foo
test `cat foo` = '%M%' || miscarry cannot create file foo.

docommand A1 "${vg_admin} -ifoo ${s}" 0 "" IGNORE
remove foo

#no_users="\n"
no_users="none\n\n"

# We may not have a "prt".
# docommand A2 "${prt} -u $s" 0 "\ns.bar:\n\n Users allowed to make deltas -- \n\teveryone\n" ""

# If the authorised user list is empty everyone is allowed to make deltas.
docommand A2 "${prs} -d:UN: $s" 0 "${no_users}" ""

# Check the adding of users.
docommand A3 "${vg_admin} -abashful ${s}" 0 "" ""
docommand A4 "${vg_admin} -agrumpy  ${s}" 0 "" ""
docommand A5 "${vg_admin} -asleepy  ${s}" 0 "" ""

# docommand A6 "${prt} -u $s" 0 "\ns.bar:\n\n Users allowed to make deltas -- \n\tsleepy\n\tgrumpy\n\tbashful\n" ""
docommand A6 "${vg_prs} -d:UN: $s" 0 "sleepy\ngrumpy\nbashful\n\n" ""


# Check the removal of users.
docommand A7 "${vg_admin} -esleepy  ${s}" 0 "" ""
docommand A8 "${vg_prs} -d:UN: $s" 0 "grumpy\nbashful\n\n" ""
docommand A9 "${vg_admin} -ebashful  ${s}" 0 "" ""
docommand A10 "${prs} -d:UN: $s" 0 "grumpy\n\n" ""
docommand A11 "${vg_admin} -egrumpy  ${s}" 0 "" ""
docommand A12 "${prs} -d:UN: $s" 0 "${no_users}" ""

# Adding and removing a user in the same command should still
# result in the user being added.
docommand A13 "${vg_admin} -asleepy -esleepy ${s}" 0 "" ""
docommand A14 "${prs} -d:UN: $s" 0 "sleepy\n\n" ""


remove $s $g $z foo command.log last.command core 
remove expected.stderr got.stderr expected.stdout got.stdout


success