Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 772
blob72027d55db04e42eb02b824c47b3326e8f2c551f
1 #!/bin/sh
2 # PCP QA Test No. 772
3 # pmnsmerge -x checks
5 # Copyright (c) 2015 Ken McDonell. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 status=1 # failure is the default!
17 $sudo rm -rf $tmp.* $seq.full
18 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
20 cat <<End-of-File >$tmp.root
21 root {
22 foo 1:2:3
23 dyno 4:*:*
24 bar
26 bar {
27 bar
28 one 7:0:1
30 bar.bar {
31 bar
32 two 7:0:2
34 bar.bar.bar {
35 three 7:0:3
37 End-of-File
39 cat <<End-of-File >$tmp.root2
40 root {
41 black
42 white
44 black {
45 sheep 7:0:2
47 white {
48 dyno 4:*:*
50 End-of-File
52 cat <<End-of-File >$tmp.root3
53 root {
54 white
55 goat 7:0:2
57 white {
58 dyno 4:*:*
60 End-of-File
62 cat <<End-of-File >$tmp.root4
63 root {
64 white
66 white {
67 dyno 4:*:*
69 End-of-File
71 _filter()
73 sed \
74 -e "s@$tmp@TMP@g" \
75 # end
78 # real QA test starts here
79 echo "no dups"
80 rm -f $tmp.tmp
81 pmnsmerge $tmp.root $tmp.tmp >$tmp.out 2>&1
82 xit=$?
83 _filter <$tmp.out
84 echo "exit status: $xit"
85 not=''
86 [ -f $tmp.tmp ] || not=' not'
87 echo "output PMNS$not created"
89 echo
90 echo "no dups -x"
91 rm -f $tmp.tmp
92 pmnsmerge -x $tmp.root $tmp.tmp >$tmp.out 2>&1
93 xit=$?
94 _filter <$tmp.out
95 echo "exit status: $xit"
96 not=''
97 [ -f $tmp.tmp ] || not=' not'
98 echo "output PMNS$not created"
100 echo
101 echo "dups"
102 rm -f $tmp.tmp
103 pmnsmerge $tmp.root $tmp.root2 $tmp.tmp >$tmp.out 2>&1
104 xit=$?
105 _filter <$tmp.out
106 echo "exit status: $xit"
107 not=''
108 [ -f $tmp.tmp ] || not=' not'
109 echo "output PMNS$not created"
111 echo
112 echo "dups - order reversed"
113 rm -f $tmp.tmp
114 pmnsmerge $tmp.root $tmp.root3 $tmp.tmp >$tmp.out 2>&1
115 xit=$?
116 _filter <$tmp.out
117 echo "exit status: $xit"
118 not=''
119 [ -f $tmp.tmp ] || not=' not'
120 echo "output PMNS$not created"
122 echo
123 echo "dups -x"
124 rm -f $tmp.tmp
125 pmnsmerge -x $tmp.root $tmp.root2 $tmp.tmp >$tmp.out 2>&1
126 xit=$?
127 _filter <$tmp.out
128 echo "exit status: $xit"
129 not=''
130 [ -f $tmp.tmp ] || not=' not'
131 echo "output PMNS$not created"
133 echo
134 echo "dups -x - order reversed"
135 rm -f $tmp.tmp
136 pmnsmerge -x $tmp.root $tmp.root3 $tmp.tmp >$tmp.out 2>&1
137 xit=$?
138 _filter <$tmp.out
139 echo "exit status: $xit"
140 not=''
141 [ -f $tmp.tmp ] || not=' not'
142 echo "output PMNS$not created"
144 echo
145 echo "dups - 3 input files"
146 rm -f $tmp.tmp
147 pmnsmerge $tmp.root $tmp.root2 $tmp.root3 $tmp.tmp >$tmp.out 2>&1
148 xit=$?
149 _filter <$tmp.out
150 echo "exit status: $xit"
151 not=''
152 [ -f $tmp.tmp ] || not=' not'
153 echo "output PMNS$not created"
154 cp $tmp.tmp $tmp.merged
156 echo
157 echo "only dynamic dups - 3 input files"
158 rm -f $tmp.tmp
159 pmnsmerge $tmp.root $tmp.root2 $tmp.root4 $tmp.tmp >$tmp.out 2>&1
160 xit=$?
161 _filter <$tmp.out
162 echo "exit status: $xit"
163 not=''
164 [ -f $tmp.tmp ] || not=' not'
165 echo "output PMNS$not created"
167 echo
168 echo "merged"
169 rm -f $tmp.tmp
170 pmnsmerge $tmp.merged $tmp.tmp >$tmp.out 2>&1
171 xit=$?
172 _filter <$tmp.out
173 echo "exit status: $xit"
174 not=''
175 [ -f $tmp.tmp ] || not=' not'
176 echo "output PMNS$not created"
178 echo
179 echo "merged -x"
180 rm -f $tmp.tmp
181 pmnsmerge -x $tmp.merged $tmp.tmp >$tmp.out 2>&1
182 xit=$?
183 _filter <$tmp.out
184 echo "exit status: $xit"
185 not=''
186 [ -f $tmp.tmp ] || not=' not'
187 echo "output PMNS$not created"
189 # success, all done
190 status=0
192 exit