3 # Copyright (C) 2009 Google Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 # This is a live-testing script for most/all of the htools
21 # programs. It needs either to run on a live cluster or access to a
22 # cluster via ssh and an exported LUXI interface (via socat, for
23 # example). The cluster must not be empty (otherwise the hail relocate
26 # Use: if running on a cluster master, just running it should be
27 # enough. If running remotely, set env vars as follows: LUXI to the
28 # export unix socket, RAPI to the cluster IP, CLUSTER to the command
29 # used to login on the cluster (e.g. CLUSTER="ssh root@cluster").
35 echo Using $T as temporary dir
40 echo Testing hbal/luxi
42 echo Testing hbal/rapi
44 echo Testing hbal/text
45 ./hbal -t$T/$RAPI.data
47 echo Getting data files for hail
48 IR=`$CLUSTER head -n1 /var/lib/ganeti/ssconf_instance_list`
49 $CLUSTER gnt-debug allocator --dir in --mode allocate --mem 128m \
50 --disks 128m -t drbd -o no_such_os no_such_instance \
52 $CLUSTER gnt-debug allocator --dir in --mode relocate --mem 128m \
53 --disks 128m -t drbd -o no_such_os $IR > $T/h-reloc.json
54 echo Testing hail/allocate
55 ./hail $T/h-alloc.json
56 echo Testing hail/relocate
57 ./hail $T/h-reloc.json
65 echo ALLOC_INSTANCES=$HTS_ALLOC_INSTANCES
70 TIER="--tiered 102400,8192,2"
71 echo Testing hspace/luxi
72 ./hspace -L$LUXI $TIER > $HOUT
73 ( check_hspace_out ) || exit 1
74 echo Testing hspace/rapi
75 ./hspace -m$RAPI $TIER > $HOUT
76 ( check_hspace_out ) || exit 1
77 echo Testing hspace/text
78 ./hspace -t$T/$RAPI.data $TIER > $HOUT
79 ( check_hspace_out ) || exit 1
80 echo Testing hspace/simu
81 # ~6T disk space, 32G ram, 4 VCPUs
82 ./hspace --simu=10,6835937,32768,4 $TIER > $HOUT
83 ( check_hspace_out ) || exit 1