summaryrefslogtreecommitdiff
path: root/qa/207
blob: d6cb7f30216d36a3938406aa195238887dc171cb (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#! /bin/sh
# PCP QA Test No. 207
# Simple PMNS exerciser after dynamic PMNS changes
#
# Copyright (c) 2009 Ken McDonell.  All Rights Reserved.
# 

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

status=0	# success is the default!
$sudo rm -rf $tmp.*
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15

_filter()
{
    sed -e "s;$tmp;TMP;g"
}

cat <<'End-of-File' >$tmp.pmns
root {
    power
    simple
    set
    dynamic
}

power {
    zero	1:1:1
    one		2:2:2
    two		4:4:4
    three	8:8:8
    four	16:16:16
    five	32:32:32
    six		64:64:64
    seven	128:128:128
    eight	256:256:256
    nine	510:512:512
    ten		510:1024:1023
    eleven	510:2048:1023
}

simple {
    first	0:0:0
    last	510:4095:1023
}

set {
    first	0:0:1
    last	510:4095:1022
}

dynamic {
    first	0:*:*
    last	510:*:*
}
End-of-File

# real QA test starts here
echo "=== Limits on PMID fields ==="
pminfo -n $tmp.pmns -m

echo
echo "=== Error cases ==="
cat <<'End-of-File' >$tmp.pmns
root {
    reserved_domain	511:0:0
}
End-of-File
pminfo -n $tmp.pmns -m 2>&1 | _filter

echo
cat <<'End-of-File' >$tmp.pmns
root {
    big_domain	512:0:0
}
End-of-File
pminfo -n $tmp.pmns -m 2>&1 | _filter

echo
cat <<'End-of-File' >$tmp.pmns
root {
    big_cluster	0:4096:0
}
End-of-File
pminfo -n $tmp.pmns -m 2>&1 | _filter

echo
cat <<'End-of-File' >$tmp.pmns
root {
    big_serial	0:0:1024
}
End-of-File
pminfo -n $tmp.pmns -m 2>&1 | _filter

echo
cat <<'End-of-File' >$tmp.pmns
root {
    bad_domain	x:1:1
}
End-of-File
pminfo -n $tmp.pmns -m 2>&1 | _filter

echo
cat <<'End-of-File' >$tmp.pmns
root {
    bad_cluster	1:x:1
}
End-of-File
pminfo -n $tmp.pmns -m 2>&1 | _filter

echo
cat <<'End-of-File' >$tmp.pmns
root {
    bad_serial	1:1:x
}
End-of-File
pminfo -n $tmp.pmns -m 2>&1 | _filter

echo
cat <<'End-of-File' >$tmp.pmns
root {
    dyn_bad_cluster	13:0:*
}
End-of-File
pminfo -n $tmp.pmns -m 2>&1 | _filter

echo
cat <<'End-of-File' >$tmp.pmns
root {
    dyn_bad_serial	13:*:0
}
End-of-File
pminfo -n $tmp.pmns -m 2>&1 | _filter

# success, all done
exit