~ubuntu-branches/ubuntu/vivid/cctools/vivid

« back to all changes in this revision

Viewing changes to chirp/test/TR_002_chirp_ops.sh

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2011-05-07 09:05:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110507090500-lqpmdtwndor6e7os
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
. ../../dttools/src/test_runner.common.sh
 
4
 
 
5
TEST_FILE=chirp_benchmark.tmp
 
6
PID_FILE=chirp_server.pid
 
7
PORT_FILE=chirp_server.port
 
8
 
 
9
prepare()
 
10
{
 
11
    mkdir foo
 
12
    ln -s ..//.//./..///foo/ foo/foo
 
13
    port=`find_free_port`
 
14
    ../src/chirp_server -r $PWD/foo -p $port &
 
15
    echo $! > $PID_FILE
 
16
    echo $port > $PORT_FILE
 
17
    exit 0
 
18
}
 
19
 
 
20
run()
 
21
{
 
22
    port=`cat $PORT_FILE`
 
23
    exec ../src/chirp localhost:$port <<EOF
 
24
help
 
25
df -g
 
26
mkdir bar
 
27
mv foo bar/foo
 
28
ls bar/foo
 
29
audit -r
 
30
whoami
 
31
whoareyou localhost:$port
 
32
ls
 
33
mkdir _test
 
34
ls
 
35
cd _test
 
36
ls
 
37
put /etc/hosts hosts.txt
 
38
cat hosts.txt
 
39
getacl
 
40
localpath hosts.txt
 
41
exit
 
42
EOF
 
43
}
 
44
 
 
45
clean()
 
46
{
 
47
    kill -9 `cat $PID_FILE`
 
48
    rm -rf foo _test .__acl $PID_FILE $PORT_FILE $TEST_FILE
 
49
    exit 0
 
50
}
 
51
 
 
52
dispatch $@