~charm-toolers/charm-tools/1.3

« back to all changes in this revision

Viewing changes to tests/helpers/disabled_test_peer.sh

  • Committer: Marco Ceppi
  • Date: 2013-11-11 19:08:11 UTC
  • Revision ID: marco@ceppi.net-20131111190811-w9co29f91241ck7n
Re-organized testing

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
# debug=1 full
4
 
# debug=2 client only
5
 
debug=0
6
 
 
7
 
if [ -z "$test_home" ] ; then
8
 
    test_home=`dirname $0`
9
 
    test_home=`readlink -f $test_home`
10
 
fi
11
 
 
12
 
[ "$LIB_SOURCED" = "1" ] || . $test_home/lib.sh
13
 
 
14
 
set -ue
15
 
 
16
 
JUJU_UNIT_NAME="EMPTY"
17
 
 
18
 
#mock relation-list
19
 
alias relation-list=mock_relation_list
20
 
mock_relation_list()
21
 
{
22
 
    [ -z $CH_MASTER ] && let CH_MASTER=1
23
 
    
24
 
    case $CH_MASTER in
25
 
    4)
26
 
        echo "TEST/3
27
 
TEST/2
28
 
TEST/4"
29
 
        ;;
30
 
    3)
31
 
        echo "TEST/4
32
 
TEST/3
33
 
TEST/1"
34
 
        ;;
35
 
    2)
36
 
        echo "TEST/3
37
 
TEST/4"
38
 
        ;;
39
 
     1)
40
 
        echo "TEST/2
41
 
TEST/3
42
 
TEST/4"
43
 
        ;;
44
 
    0)
45
 
        echo "TEST/1
46
 
TEST/3
47
 
TEST/4"
48
 
        ;;
49
 
    -1)
50
 
        echo ""
51
 
        ;;
52
 
    esac 
53
 
 
54
 
}
55
 
 
56
 
#Save juju-log for debugging
57
 
CH_TEMPLOG="/tmp/$USER-tmp-juju-log"
58
 
echo "" > $CH_TEMPLOG
59
 
output "creating test-log in $CH_TEMPLOG"
60
 
alias juju-log=mock_juju_log
61
 
mock_juju_log()
62
 
{
63
 
    echo "$*" >> $CH_TEMPLOG
64
 
}
65
 
 
66
 
#mock unit-get
67
 
alias unit-get=mock_unit_get
68
 
mock_unit_get()
69
 
{
70
 
   case $1 in
71
 
   "private-address")
72
 
       echo "localhost"
73
 
       ;;
74
 
   *)
75
 
       echo "UNDEFINED"
76
 
       ;;
77
 
   esac
78
 
}
79
 
 
80
 
#mock relation-set/get
81
 
alias relation-set=mock_relation_set
82
 
alias relation-get=mock_relation_get
83
 
CH_scp_hostname=""
84
 
CH_scp_ssh_key_saved=""
85
 
CH_scp_ssh_key=""
86
 
CH_scp_copy_done=""
87
 
mock_relation_set()
88
 
{
89
 
    juju-log "mock_relation_set: $1"
90
 
    CH_varname=`echo $1 | cut -d= -f1`
91
 
    CH_value=`echo $1 | sed 's/^[^=]*=//'`
92
 
    case $CH_varname in
93
 
    "scp-hostname")
94
 
        CH_scp_hostname=$CH_value
95
 
        ;;
96
 
    "scp-ssh-key-saved")
97
 
        CH_scp_ssh_key_saved=$CH_value
98
 
        ;;
99
 
    "scp-ssh-key")
100
 
        CH_scp_ssh_key="$CH_value"
101
 
        ;;
102
 
    "scp-copy-done")
103
 
        CH_scp_copy_done=$CH_value
104
 
        ;;
105
 
    *)
106
 
        juju-log "mock_relation_set: unknow var $CH_varname"
107
 
        ;;
108
 
    esac
109
 
}
110
 
mock_relation_get()
111
 
{
112
 
    case $1 in
113
 
    "scp-hostname")
114
 
        echo $CH_scp_hostname
115
 
        juju-log "mock_relation_get: $1 = $CH_scp_hostname"
116
 
        ;;
117
 
    "scp-ssh-key-saved")
118
 
        echo $CH_scp_ssh_key_saved
119
 
        juju-log "mock_relation_get: $1 = $CH_scp_ssh_key_saved"
120
 
        ;;
121
 
    "scp-ssh-key")
122
 
        echo "$CH_scp_ssh_key"
123
 
        juju-log "mock_relation_get: $1 = $CH_scp_ssh_key"
124
 
        ;;
125
 
    "scp-copy-done")
126
 
        echo $CH_scp_copy_done
127
 
        juju-log "mock_relation_get: $1 = $CH_scp_copy_done"
128
 
        ;;
129
 
    *)
130
 
        juju-log "mock_relation_get: unknow var $1"
131
 
        ;;
132
 
    esac
133
 
}
134
 
 
135
 
CH_TEMPDIR=""
136
 
 
137
 
created_ssh_home=0
138
 
 
139
 
cleanup_peer()
140
 
{
141
 
    [ $debug = 1 ] && output "====== sshd server log ======" && cat /tmp/juju-sshd-log ; rm -f /tmp/juju-sshd-log
142
 
    [ $debug -gt 1 ] && output "===== juju debug log ======" && cat $CH_TEMPLOG
143
 
    output "Cleaning up..."
144
 
    unalias juju-log
145
 
    unalias relation-set
146
 
    unalias relation-get
147
 
    unalias unit-get
148
 
    unalias relation-list
149
 
    [ -n "$CH_TEMPDIR" ] || return 0
150
 
    [ ! -f $CH_TEMPDIR/sshd.pid ] || kill -9 `cat $CH_TEMPDIR/sshd.pid`
151
 
    rm -rf $CH_TEMPDIR
152
 
    if [ $created_ssh_home = 1 ] ; then
153
 
        backup_dir=`mktemp -d /tmp/backup-charm-helper.ssh.XXXXXXXX`
154
 
        output "Backing up created $HOME/.ssh to $backup_dir/dot-ssh"
155
 
        mv $HOME/.ssh $backup_dir/dot-ssh
156
 
    fi
157
 
    if [ -e $HOME/ch_test ] ; then
158
 
        rm -rf $HOME/ch_test
159
 
    fi
160
 
}
161
 
trap cleanup_peer EXIT
162
 
if [ $debug -gt 0 ] ; then echo "user: $USER, home: $HOME"; fi
163
 
if [ ! -d $HOME ] ; then
164
 
    mkdir -p $HOME
165
 
    chown $USER:$USER $HOME
166
 
    chmod 700 $HOME
167
 
fi
168
 
if [ ! -d $HOME/.ssh ] ; then
169
 
    mkdir -p $HOME/.ssh
170
 
    chmod 700 $HOME/.ssh
171
 
    created_ssh_home=1
172
 
else
173
 
    output "ch_peer_scp can be destructive to \$HOME/.ssh, move it out of the way or"
174
 
    output "run these tests in a clean chroot or with a test user. Skipping."
175
 
    exit 0
176
 
fi
177
 
if [ x"$USER" = x"root" ] ; then
178
 
    if ! touch /root/.ssh/known_hosts ; then
179
 
        USER=`basename $HOME`
180
 
        echo "forcing user to: $USER"
181
 
    fi
182
 
fi
183
 
touch $HOME/.ssh/authorized_keys
184
 
touch $HOME/.ssh/known_hosts
185
 
chmod 600 $HOME/.ssh/authorized_keys
186
 
 
187
 
# mock sshd server
188
 
CH_TEMPDIR=`mktemp -d "/tmp/juju-helpers-tmp.XXXXXXX"`
189
 
mkdir -p $CH_TEMPDIR/sourcedir/
190
 
mkdir -p $CH_TEMPDIR/destdir/
191
 
mkdir -p $CH_TEMPDIR/$HOME/
192
 
if ! [ -d /var/run/sshd ] ; then
193
 
    if ! mkdir -p /var/run/sshd ; then
194
 
        mkdir -p $HOME/var/run/sshd/
195
 
    fi
196
 
fi
197
 
# Protect user's normal home dir
198
 
head -c 16384 /dev/urandom > $CH_TEMPDIR/sourcedir/testfile0
199
 
head -c 32385 /dev/urandom > $CH_TEMPDIR/sourcedir/testfile1
200
 
head -c 19998 /dev/urandom > $CH_TEMPDIR/sourcedir/testfile
201
 
CH_portnum=28822
202
 
# lucid's ssh-keygen does not accept -h, so we check for maverick or
203
 
# later to add -h
204
 
ssh_version=`dpkg -l 'openssh-client'|awk '/^ii/ { print $3 }'`
205
 
if dpkg --compare-versions $ssh_version lt 1:5.5p1-4ubuntu4 ; then
206
 
  opts=""
207
 
else
208
 
  opts="-h"
209
 
fi
210
 
ssh-keygen -t rsa -b 1024 -N "" $opts -f $CH_TEMPDIR/my_host_key > /dev/null 2>&1 
211
 
if [ $debug = 1 ] ; then
212
 
    /usr/sbin/sshd -e -o PidFile=$CH_TEMPDIR/sshd.pid -o UsePrivilegeSeparation=no -o StrictModes=no -d -h $CH_TEMPDIR/my_host_key -p $CH_portnum 2> /tmp/juju-sshd-log &
213
 
    CH_scpopt="-v"
214
 
    listening=1
215
 
else
216
 
    /usr/sbin/sshd -e -o PidFile=$CH_TEMPDIR/sshd.pid -o UsePrivilegeSeparation=no -o StrictModes=no -h $CH_TEMPDIR/my_host_key -p $CH_portnum
217
 
    # wait for server
218
 
    output "waiting for sshd to be available"
219
 
    listening=0
220
 
    ch_tmp_result=`mktemp`
221
 
    for i in 1 2 3 4 5 ; do
222
 
      sleep 1
223
 
 
224
 
      ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no -p $CH_portnum bozo@localhost 2> $ch_tmp_result ||
225
 
      if grep -q -F "Permission denied" $ch_tmp_result ; then
226
 
        output Attempt $i succeeded.
227
 
        listening=1
228
 
        break
229
 
      fi
230
 
      output Attempt $i failed..
231
 
    done
232
 
    rm -f $ch_tmp_result
233
 
    if [ $listening = 0 ] ; then
234
 
        exit 1
235
 
    fi
236
 
    if [ $debug -gt 0 ]; then CH_scpopt="-v" ; else CH_scpopt="-q"; fi;
237
 
fi
238
 
 
239
 
. $HELPERS_HOME/peer.sh
240
 
 
241
 
start_test ch_unit_id...
242
 
JUJU_UNIT_NAME="TEST/1"
243
 
[ ! `ch_unit_id $JUJU_UNIT_NAME` -eq 1 ] && return 1
244
 
CH_bad="badarg"
245
 
ch_unit_id $CH_bad > /dev/null || return 1
246
 
echo PASS
247
 
 
248
 
start_test ch_my_unit_id...
249
 
[ ! `ch_my_unit_id` -eq  1 ] && return 1
250
 
echo PASS
251
 
 
252
 
start_test ch_peer_i_am_leader...
253
 
JUJU_REMOTE_UNIT="TEST/3"
254
 
JUJU_UNIT_NAME="TEST/2"
255
 
CH_MASTER=1
256
 
ch_peer_i_am_leader && return 1 || :
257
 
JUJU_UNIT_NAME="TEST/1"
258
 
ch_peer_i_am_leader || return 1 && :
259
 
echo PASS
260
 
 
261
 
start_test "ch_peer_i_am_leader (unordered list 1)..."
262
 
JUJU_REMOTE_UNIT="TEST/3"
263
 
JUJU_UNIT_NAME="TEST/2"
264
 
CH_MASTER=3
265
 
ch_peer_i_am_leader && return 1 || :
266
 
echo PASS
267
 
 
268
 
start_test "ch_peer_i_am_leader (unordered list 2)..."
269
 
JUJU_UNIT_NAME="TEST/1"
270
 
CH_MASTER=4
271
 
ch_peer_i_am_leader || return 1 && :
272
 
echo PASS
273
 
 
274
 
start_test "ch_peer_i_am_leader (unordered list 3)..."
275
 
JUJU_UNIT_NAME="TEST/2"
276
 
CH_MASTER=3
277
 
ch_peer_i_am_leader && return 1 || :
278
 
echo PASS
279
 
 
280
 
start_test "ch_peer_i_am_leader (unordered list 4)..."
281
 
JUJU_UNIT_NAME="TEST/3"
282
 
ch_peer_i_am_leader && return 1 && :
283
 
echo PASS
284
 
 
285
 
start_test "ch_peer_i_am_leader (empty list)..."
286
 
JUJU_REMOTE_UNIT="TEST/3"
287
 
JUJU_UNIT_NAME="TEST/1"
288
 
CH_MASTER=-1
289
 
ch_peer_i_am_leader || return 1 && :
290
 
echo PASS
291
 
 
292
 
start_test "ch_peer_i_am_leader (departed leader)..."
293
 
JUJU_REMOTE_UNIT="TEST/1"
294
 
JUJU_UNIT_NAME="TEST/4"
295
 
CH_MASTER=2
296
 
ch_peer_i_am_leader && return 1 || :
297
 
JUJU_UNIT_NAME="TEST/2"
298
 
ch_peer_i_am_leader || return 1 && :
299
 
echo PASS
300
 
 
301
 
start_test ch_peer_leader...
302
 
JUJU_REMOTE_UNIT="TEST/3"
303
 
JUJU_UNIT_NAME="TEST/1"
304
 
CH_MASTER=1
305
 
[ "`ch_peer_leader`" = "TEST/1" ] ||  return 1
306
 
[ `ch_peer_leader --id` -eq 1 ] || return 1
307
 
JUJU_UNIT_NAME="TEST/2"
308
 
[ "`ch_peer_leader`" = "TEST/2" ] || return 1
309
 
[ `ch_peer_leader --id` -eq 2 ] || return 1
310
 
echo PASS
311
 
 
312
 
start_test "ch_peer_scp -r..."
313
 
for i in 1 2 3 
314
 
do
315
 
    #slave relation joined
316
 
    JUJU_UNIT_NAME="TEST/2"  
317
 
    JUJU_REMOTE_UNIT="TEST/1"
318
 
    CH_MASTER=0
319
 
    if ch_peer_scp -r -p $CH_portnum -o "$CH_scpopt" "$CH_TEMPDIR/sourcedir/*" "$CH_TEMPDIR/destdir/" ; then break ; fi
320
 
    #master relation joined
321
 
    JUJU_UNIT_NAME="TEST/1"  
322
 
    JUJU_REMOTE_UNIT="TEST/2"
323
 
    CH_MASTER=1
324
 
    if ch_peer_scp -r -p $CH_portnum -o "$CH_scpopt" "$CH_TEMPDIR/sourcedir/*" "$CH_TEMPDIR/destdir/" ; then break ; fi
325
 
done
326
 
[ ! -e $CH_TEMPDIR/destdir/ ] && output "dir not copied" && exit 1
327
 
[ ! -e $CH_TEMPDIR/destdir/testfile0 ] && output "file1 not copied" && exit 1
328
 
[ ! -e $CH_TEMPDIR/destdir/testfile1 ] && output "file2 not copied" && exit 1
329
 
CH_t1=`md5sum $CH_TEMPDIR/sourcedir/testfile0 | cut -d" " -f1`
330
 
CH_t2=`md5sum $CH_TEMPDIR/destdir/testfile0 | cut -d" " -f1`
331
 
[ ! "$CH_t1" = "$CH_t2" ] && output "md5sum differ" && exit 1
332
 
rm -rf $CH_TEMPDIR/destdir/*
333
 
echo PASS
334
 
 
335
 
start_test "ch_peer_rsync..."
336
 
CH_scp_hostname=""
337
 
CH_scp_ssh_key_saved=""
338
 
CH_scp_ssh_key=""
339
 
CH_scp_copy_done=""
340
 
for i in 1 2 3 
341
 
do
342
 
    #slave relation joined
343
 
    JUJU_UNIT_NAME="TEST/2"  
344
 
    JUJU_REMOTE_UNIT="TEST/1"
345
 
    CH_MASTER=0
346
 
    if ch_peer_rsync -p $CH_portnum -o "-azq" "$CH_TEMPDIR/sourcedir/*" "$CH_TEMPDIR/destdir/" ; then break ; fi
347
 
    #master relation joined
348
 
    JUJU_UNIT_NAME="TEST/1"  
349
 
    JUJU_REMOTE_UNIT="TEST/2"
350
 
    CH_MASTER=1
351
 
    if ch_peer_rsync -p $CH_portnum -o "-azq" "$CH_TEMPDIR/sourcedir/*" "$CH_TEMPDIR/destdir/" ; then break ; fi
352
 
done
353
 
[ ! -e $CH_TEMPDIR/destdir/ ] && output"dir not copied" && exit 1
354
 
[ ! -e $CH_TEMPDIR/destdir/testfile0 ] && output "file1 not copied" && exit 1
355
 
[ ! -e $CH_TEMPDIR/destdir/testfile1 ] && output "file2 not copied" && exit 1
356
 
CH_t1=`md5sum $CH_TEMPDIR/sourcedir/testfile0 | cut -d" " -f1`
357
 
CH_t2=`md5sum $CH_TEMPDIR/destdir/testfile0 | cut -d" " -f1`
358
 
[ ! "$CH_t1" = "$CH_t2" ] && output "md5sum differ" && exit 1
359
 
rm -rf $CH_TEMPDIR/destdir/*
360
 
echo PASS
361
 
 
362
 
start_test "ch_peer_scp..."
363
 
CH_scp_hostname=""
364
 
CH_scp_ssh_key_saved=""
365
 
CH_scp_ssh_key=""
366
 
CH_scp_copy_done=""
367
 
for i in 1 2 3 
368
 
do
369
 
    #slave relation joined
370
 
    JUJU_UNIT_NAME="TEST/2" 
371
 
    JUJU_REMOTE_UNIT="TEST/1"
372
 
    CH_MASTER=0
373
 
    if ch_peer_scp -p $CH_portnum -o "-q" "$CH_TEMPDIR/sourcedir/testfile" "$CH_TEMPDIR/destdir/" "$CH_TEMPDIR/sourcedir/testfile1" "$CH_TEMPDIR/destdir/" ; then break ; fi
374
 
    #master relation joined
375
 
    JUJU_UNIT_NAME="TEST/1" 
376
 
    JUJU_REMOTE_UNIT="TEST/2"
377
 
    CH_MASTER=1
378
 
    if ch_peer_scp -p $CH_portnum -o "-q" "$CH_TEMPDIR/sourcedir/testfile" "$CH_TEMPDIR/destdir/" "$CH_TEMPDIR/sourcedir/testfile1" "$CH_TEMPDIR/destdir/" ; then break ; fi
379
 
done
380
 
[ ! -e $CH_TEMPDIR/destdir/testfile ] && output "file1 not copied" && exit 1
381
 
[ ! -e $CH_TEMPDIR/destdir/testfile1 ] && output "file2 not copied" && exit 1
382
 
CH_t1=`md5sum $CH_TEMPDIR/sourcedir/testfile | cut -d" " -f1`
383
 
CH_t2=`md5sum $CH_TEMPDIR/destdir/testfile | cut -d" " -f1`
384
 
[ ! "$CH_t1" = "$CH_t2" ] && output "md5sum differ" && exit 1
385
 
rm -rf $CH_TEMPDIR/destdir/*
386
 
echo PASS
387
 
 
388
 
start_test "ch_peer_copy_replay..."
389
 
CH_scp_hostname=""
390
 
CH_scp_ssh_key_saved=""
391
 
CH_scp_ssh_key=""
392
 
CH_scp_copy_done=""
393
 
#We are not in a relation, we are on master
394
 
JUJU_UNIT_NAME="TEST/1" 
395
 
JUJU_REMOTE_UNIT=""
396
 
CH_MASTER=-1
397
 
if ! ch_peer_copy_replay ; then
398
 
    output "should not have returned not copied (1)"
399
 
    exit 1
400
 
fi
401
 
#We are not in a relation, we are on slave
402
 
JUJU_UNIT_NAME="TEST/2" 
403
 
JUJU_REMOTE_UNIT=""
404
 
CH_MASTER=-1
405
 
if ch_peer_copy_replay ; then
406
 
    output "should not have returned copied (0)"
407
 
    exit 1
408
 
fi
409
 
[ ! -e $CH_TEMPDIR/destdir/testfile ] && output "file not copied" && exit 1
410
 
CH_t1=`md5sum $CH_TEMPDIR/sourcedir/testfile | cut -d" " -f1`
411
 
CH_t2=`md5sum $CH_TEMPDIR/destdir/testfile | cut -d" " -f1`
412
 
[ ! "$CH_t1" = "$CH_t2" ] && output "md5sum differ" && exit 1
413
 
[ ! -e $CH_TEMPDIR/destdir/ ] && output "dir not copied" && exit 1
414
 
[ ! -e $CH_TEMPDIR/destdir/testfile0 ] && output "file1 not copied" && exit 1
415
 
[ ! -e $CH_TEMPDIR/destdir/testfile1 ] && output "file2 not copied" && exit 1
416
 
CH_t1=`md5sum $CH_TEMPDIR/sourcedir/testfile0 | cut -d" " -f1`
417
 
CH_t2=`md5sum $CH_TEMPDIR/destdir/testfile0 | cut -d" " -f1`
418
 
[ ! "$CH_t1" = "$CH_t2" ] && output "md5sum differ" && exit 1
419
 
rm -rf $CH_TEMPDIR/destdir/*
420
 
echo PASS
421
 
 
422
 
start_test "ch_peer_rsync (out of relation)..."
423
 
CH_scp_hostname=""
424
 
CH_scp_ssh_key_saved=""
425
 
CH_scp_ssh_key=""
426
 
CH_scp_copy_done=""
427
 
#We are not in a relation, we are on master
428
 
JUJU_UNIT_NAME="TEST/1" 
429
 
JUJU_REMOTE_UNIT=""
430
 
CH_MASTER=-1
431
 
ch_peer_rsync -p $CH_portnum -o "-azq" "$CH_TEMPDIR/sourcedir/*" "$CH_TEMPDIR/destdir/" && chres=0 || chres=$?
432
 
if [ $chres -ne 101 ] ; then
433
 
    output "should not have returned not copied (received $chres, 101 expected)"
434
 
    exit 1
435
 
fi
436
 
#We are not in a relation, we are on slave
437
 
JUJU_UNIT_NAME="TEST/2" 
438
 
JUJU_REMOTE_UNIT=""
439
 
CH_MASTER=-1
440
 
ch_peer_rsync -p $CH_portnum -o "-azq" "$CH_TEMPDIR/sourcedir/*" "$CH_TEMPDIR/destdir/" && chres=0 || chres=$?
441
 
if [ $chres -ne 100 ] ; then
442
 
    output "should not have returned copied (received $chres, 100 expected)"
443
 
    exit 1
444
 
fi
445
 
[ ! -e $CH_TEMPDIR/destdir/ ] && output "dir not copied" && exit 1
446
 
[ ! -e $CH_TEMPDIR/destdir/testfile0 ] && output "file1 not copied" && exit 1
447
 
[ ! -e $CH_TEMPDIR/destdir/testfile1 ] && output "file2 not copied" && exit 1
448
 
CH_t1=`md5sum $CH_TEMPDIR/sourcedir/testfile0 | cut -d" " -f1`
449
 
CH_t2=`md5sum $CH_TEMPDIR/destdir/testfile0 | cut -d" " -f1`
450
 
[ ! "$CH_t1" = "$CH_t2" ] && output "md5sum differ" && exit 1
451
 
rm -rf $CH_TEMPDIR/destdir/*
452
 
#restore authorized_keys & known_hosts
453
 
echo PASS
454
 
 
455
 
start_test "ch_peer_copy_cleanup..."
456
 
# as a leader
457
 
JUJU_UNIT_NAME="TEST/1" 
458
 
JUJU_REMOTE_UNIT="TEST/2"
459
 
CH_MASTER=-1
460
 
ch_peer_copy_cleanup "$JUJU_REMOTE_UNIT"
461
 
unitname=`echo $JUJU_UNIT_NAME | sed 's/\//-/g'`
462
 
[ `grep -F "$JUJU_REMOTE_UNIT" $HOME/ch_test/$unitname` ] && output "not cleaned up" && exit 1
463
 
# as a slave
464
 
JUJU_UNIT_NAME="TEST/2" 
465
 
JUJU_REMOTE_UNIT="TEST/1"
466
 
CH_MASTER=-1
467
 
ch_peer_copy_cleanup "$JUJU_REMOTE_UNIT"
468
 
#nothing to check here other than if we did not choke on cleaning up something that does not exist
469
 
echo PASS
470
 
 
471
 
trap - EXIT
472
 
cleanup_peer