|
15 | 15 | # Making a 1G disk |
16 | 16 | rm -f bigdisk _build/xenvm*.out |
17 | 17 | dd if=/dev/zero of=bigdisk bs=1 seek=256G count=0 |
18 | | -echo Using /dev/loop0 |
19 | | -losetup /dev/loop0 bigdisk |
20 | | -cat test.xenvmd.conf.in | sed -r "s|@BIGDISK@|/dev/loop0|g" > test.xenvmd.conf |
| 18 | + |
| 19 | +LOOP=$(losetup -f) |
| 20 | +echo Using $LOOP |
| 21 | +losetup $LOOP bigdisk |
| 22 | +cat test.xenvmd.conf.in | sed -r "s|@BIGDISK@|$LOOP|g" > test.xenvmd.conf |
21 | 23 | mkdir -p /etc/xenvm.d |
22 | | -BISECT_FILE=_build/xenvm.coverage ./xenvm.native format /dev/loop0 --vg djstest |
| 24 | +BISECT_FILE=_build/xenvm.coverage ./xenvm.native format $LOOP --vg djstest |
23 | 25 | BISECT_FILE=_build/xenvmd.coverage ./xenvmd.native --config ./test.xenvmd.conf --daemon |
24 | 26 |
|
25 | 27 | export BISECT_FILE=_build/xenvm.coverage |
26 | 28 |
|
27 | | -./xenvm.native set-vg-info --pvpath /dev/loop0 -S /tmp/xenvmd djstest --local-allocator-path /tmp/xenvm-local-allocator --uri file://local/services/xenvmd/djstest |
| 29 | +./xenvm.native set-vg-info --pvpath $LOOP -S /tmp/xenvmd djstest --local-allocator-path /tmp/xenvm-local-allocator --uri file://local/services/xenvmd/djstest |
28 | 30 |
|
29 | 31 | ./xenvm.native lvcreate -n live -L 4 djstest |
30 | 32 | ./xenvm.native lvchange -ay /dev/djstest/live |
31 | 33 |
|
32 | 34 | #./xenvm.native benchmark |
33 | | - |
| 35 | +# create and connect to hosts |
34 | 36 | ./xenvm.native host-create /dev/djstest host1 |
35 | | -#./xenvm.native host-connect /dev/djstest host1 |
| 37 | +./xenvm.native host-connect /dev/djstest host1 |
| 38 | +cat test.local_allocator.conf.in | sed -r "s|@BIGDISK@|$LOOP|g" | sed -r "s|@HOST@|host1|g" > test.local_allocator.host1.conf |
| 39 | +./local_allocator.native --config ./test.local_allocator.host1.conf > /dev/null & |
| 40 | + |
| 41 | +./xenvm.native host-create /dev/djstest host2 |
| 42 | +./xenvm.native host-connect /dev/djstest host2 |
| 43 | +cat test.local_allocator.conf.in | sed -r "s|@BIGDISK@|$LOOP|g" | sed -r "s|@HOST@|host2|g" > test.local_allocator.host2.conf |
| 44 | +./local_allocator.native --config ./test.local_allocator.host2.conf > /dev/null & |
| 45 | + |
| 46 | +sleep 30 |
| 47 | +./xenvm.native host-list /dev/djstest |
| 48 | + |
| 49 | +# destroy hosts |
| 50 | +./xenvm.native host-disconnect /dev/djstest host2 |
| 51 | +./xenvm.native host-destroy /dev/djstest host2 |
| 52 | +./xenvm.native host-disconnect /dev/djstest host1 |
| 53 | +./xenvm.native host-destroy /dev/djstest host1 |
| 54 | + |
| 55 | +./xenvm.native host-list /dev/djstest |
| 56 | + |
| 57 | +#shutdown |
| 58 | +./xenvm.native lvchange -an /dev/djstest/live || true |
| 59 | +./xenvm.native shutdown /dev/djstest |
36 | 60 |
|
37 | 61 | #echo Run 'sudo ./xenvm.native host-connect /dev/djstest host1' to connect to the local allocator' |
38 | 62 | #echo Run 'sudo ./local_allocator.native' and type 'djstest-live' to request an allocation |
|
0 commit comments