Skip to content

Commit 19a93be

Browse files
author
Jon Ludlam
committed
Merge pull request #124 from jonludlam/fix-tests-for-fedora-2
Fix tests for fedora
2 parents d0dc195 + 96c39dd commit 19a93be

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ mkdir -p /tmp/xenvm.d
5353
./xenvm.native host-create /dev/djstest host1 --configdir /tmp/xenvm.d $MOCK_ARG
5454
./xenvm.native host-connect /dev/djstest host1 --configdir /tmp/xenvm.d $MOCK_ARG
5555
cat test.local_allocator.conf.in | sed -r "s|@BIGDISK@|$LOOP|g" | sed -r "s|@HOST@|host1|g" > test.local_allocator.host1.conf
56-
./local_allocator.native --daemon --config ./test.local_allocator.host1.conf $MOCK_ARG
56+
./local_allocator.native --config ./test.local_allocator.host1.conf $MOCK_ARG > local_allocator.host2.log &
5757

5858
sleep 30 # the local allocator daemonizes too soon
5959

@@ -62,7 +62,7 @@ sleep 30 # the local allocator daemonizes too soon
6262
./xenvm.native host-create /dev/djstest host2 --configdir /tmp/xenvm.d $MOCK_ARG
6363
./xenvm.native host-connect /dev/djstest host2 --configdir /tmp/xenvm.d $MOCK_ARG
6464
cat test.local_allocator.conf.in | sed -r "s|@BIGDISK@|$LOOP|g" | sed -r "s|@HOST@|host2|g" > test.local_allocator.host2.conf
65-
./local_allocator.native --config ./test.local_allocator.host2.conf $MOCK_ARG > /dev/null &
65+
./local_allocator.native --config ./test.local_allocator.host2.conf $MOCK_ARG > local_allocator.host2.log &
6666

6767
sleep 30
6868
./xenvm.native host-list /dev/djstest --configdir /tmp/xenvm.d $MOCK_ARG

test.local_allocator.conf.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(
22
(socket /tmp/@HOST@-socket)
33
(allocation_quantum 16)
4-
(localJournal /tmp/@HOST@-localJournal)
4+
(localJournal @HOST@-localJournal)
55
(devices (@BIGDISK@))
66
(toLVM @HOST@-toLVM)
77
(fromLVM @HOST@-fromLVM)

test.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ cat test.xenvmd.conf.in | sed -r "s|@BIGDISK@|$LOOP|g" > test.xenvmd.conf
3636
mkdir -p /etc/xenvm.d
3737
BISECT_FILE=_build/xenvm.coverage ./xenvm.native format $LOOP --vg djstest $MOCK_ARG
3838
BISECT_FILE=_build/xenvmd.coverage ./xenvmd.native --config ./test.xenvmd.conf --daemon
39-
4039
export BISECT_FILE=_build/xenvm.coverage
4140

4241
./xenvm.native set-vg-info --pvpath $LOOP -S /tmp/xenvmd djstest --local-allocator-path /tmp/xenvm-local-allocator --uri file://local/services/xenvmd/djstest $MOCK_ARG
@@ -88,20 +87,28 @@ sleep 30
8887

8988
./xenvm.native host-list /dev/djstest $MOCK_ARG
9089

90+
xenvmdpid=`pidof xenvmd.native`
9191
#shutdown
9292
./xenvm.native lvchange -an /dev/djstest/live $MOCK_ARG
9393
./xenvm.native shutdown /dev/djstest $MOCK_ARG
9494

9595

96-
wait $(pidof xenvmd.native)
96+
while [ -d /proc/$xenvmdpid ];
97+
do
98+
sleep 1;
99+
done
100+
97101
echo Generating bisect report-- this fails on travis
98102
(cd _build; bisect-report xenvm*.out -summary-only -html /vagrant/report/ || echo Ignoring bisect-report failure)
99103
echo Sending to coveralls-- this only works on travis
100104
`opam config var bin`/ocveralls --prefix _build _build/xenvm*.out --send || echo "Failed to upload to coveralls"
101105

102-
dmsetup remove_all
103-
dd if=/dev/zero of=$LOOP bs=1M count=128
104-
losetup -d $LOOP
105-
dd if=/dev/zero of=$CHENGZLOOP bs=1M count=128
106-
losetup -d $CHENGZLOOP
107-
rm -f localJournal bigdisk *.out chengzDisk
106+
if [ "$USE_MOCK" -eq "0" ]; then
107+
dmsetup remove_all
108+
dd if=/dev/zero of=$LOOP bs=1M count=128
109+
losetup -d $LOOP
110+
dd if=/dev/zero of=$CHENGZLOOP bs=1M count=128
111+
losetup -d $CHENGZLOOP
112+
fi
113+
114+
rm -f localJournal bigdisk *.out chengzDisk

test/common.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ let tib = Int64.(gib * kib)
218218
module Client = Xenvm_client.Client
219219

220220
let with_temp_file fn =
221-
let filename = "/tmp/vg" in
221+
let filename = Filename.concat (Unix.getcwd ()) "vg" in
222222
let f = Unix.openfile filename [Unix.O_CREAT; Unix.O_RDWR; Unix.O_TRUNC] 0o644 in
223223
(* approximately 10000 4MiB extents for volumes, 100MiB for metadata and
224224
overhead *)

0 commit comments

Comments
 (0)