Skip to content
Newer
Older
100755 307 lines (256 sloc) 8.27 KB
364bfc2 adding test file
BuzzTroll authored
1 #!/bin/bash
2
5a97c0d more diagnostics for b&t
BuzzTroll authored
3 echo "home directory in use is $HOME"
364bfc2 adding test file
BuzzTroll authored
4 bkdate=`date +%s`
5 work_dir=$1
6 if [ "X$work_dir" == "X" ]; then
7 echo "You must provide a base install directory"
8 exit 1
9 fi
10
446b505 test framework changes
BuzzTroll authored
11 if [ -e $HOME/.ssh ]; then
12 echo "this will destroy your .ssh dir! please back it up first"
13 exit 1
14 fi
15 if [ -e $HOME/.globus ]; then
16 echo "this will destroy your .globus dir! please back it up first"
17 exit 1
18 fi
19 if [ -e $HOME/.nimbus ]; then
20 echo "this will destroy your .nimbus dir! please back it up first"
21 exit 1
22 fi
74d8237 adding logic to configure s3cmd
BuzzTroll authored
23 if [ -e $HOME/.s3cfg ]; then
24 echo "this will destroy your .s3cfg file! please back it up first"
25 exit 1
26 fi
446b505 test framework changes
BuzzTroll authored
27
12b7ad7 for b&t test
BuzzTroll authored
28 mkdir $HOME/.ssh
29 mkdir $HOME/.globus
30 mkdir $HOME/.nimbus
31 chmod 700 $HOME/.ssh
32 chmod 700 $HOME/.globus
33 chmod 700 $HOME/.nimbus
34
35
364bfc2 adding test file
BuzzTroll authored
36 bd=`dirname $0`
37 cd $bd
38 src_dir=`pwd`
39
b9829db test suite changes that were not copied back in
BuzzTroll authored
40
c4f8887 adding a script to build and test the release tarballs
BuzzTroll authored
41 if [ "X$NIMBUS_SRC_DIR" == "X" ]; then
b9829db test suite changes that were not copied back in
BuzzTroll authored
42 echo "Going to use git"
c4f8887 adding a script to build and test the release tarballs
BuzzTroll authored
43 repo_dir="$work_dir/src"
44 mkdir $repo_dir
45 cd $repo_dir
46
47 repo="git://github.com/nimbusproject/nimbus.git"
48 if [ "X$NIMBUS_REPO" != "X" ]; then
49 repo=$NIMBUS_REPO
50 fi
51 echo "Checking out nimbus from $repo"
7c3a3a4 @labisso force repo name in test env
labisso authored
52 git clone --depth 1 $repo nimbus
c4f8887 adding a script to build and test the release tarballs
BuzzTroll authored
53 if [ $? -ne 0 ]; then
54 echo "failed to checkout git from $NIMBUS_REPO"
55 exit 1
56 fi
57
58 nimbus_source_dir=$repo_dir/nimbus
b9829db test suite changes that were not copied back in
BuzzTroll authored
59 nimbus_wsc_source_dir=$nimbus_source_dir/control/
60 nimbus_cc_dir=$nimbus_source_dir/cloud-client
61 mkdir $nimbus_wsc_dir
62 unset CLOUD_CLIENT_HOME
c4f8887 adding a script to build and test the release tarballs
BuzzTroll authored
63 else
b9829db test suite changes that were not copied back in
BuzzTroll authored
64 echo "Going to use premade dirs"
65
22ff52d script to download, extract, and then run tests on tarballs
BuzzTroll authored
66 if [ "X$NIMBUS_WSC_SRC_DIR" = "X" ]; then
67 echo "Either unset NIMBUS_SRC_DIR or set NIMBUS_WSC_SRC_DIR"
68 exit 1
69 fi
70 if [ "X$NIMBUS_CC_DIR" = "X" ]; then
71 echo "Either unset NIMBUS_SRC_DIR or set NIMBUS_CC_DIR"
72 exit 1
73 fi
74 if [ "X$CLOUD_CLIENT_HOME" = "X" ]; then
75 echo "Either unset NIMBUS_SRC_DIR or set CLOUD_CLIENT_HOME"
76 exit 1
77 fi
78
c4f8887 adding a script to build and test the release tarballs
BuzzTroll authored
79 nimbus_source_dir=$NIMBUS_SRC_DIR
b9829db test suite changes that were not copied back in
BuzzTroll authored
80 nimbus_wsc_source_dir=$NIMBUS_WSC_SRC_DIR/workspace-control/
d60538b testing tarballs should work now
bresnaha authored
81 export CLOUD_CLIENT_HOME=$NIMBUS_CC_DIR
b9829db test suite changes that were not copied back in
BuzzTroll authored
82 nimbus_cc_dir=$CLOUD_CLIENT_HOME
95b92ad check return code of git clone
BuzzTroll authored
83 fi
b9829db test suite changes that were not copied back in
BuzzTroll authored
84 wsc_dst_src=$work_dir/control
85 mkdir $wsc_dst_src
364bfc2 adding test file
BuzzTroll authored
86
87 install_dir=$work_dir/NIMBUSINSTALL
2ec2b27 @buzztroll modified the test suite so that it the image name come from an env and
buzztroll authored
88 export NIMBUS_HOME=$install_dir
364bfc2 adding test file
BuzzTroll authored
89
c4f8887 adding a script to build and test the release tarballs
BuzzTroll authored
90 cd $nimbus_source_dir
364bfc2 adding test file
BuzzTroll authored
91 echo "========================================="
92 echo "Installing nimbus"
93 echo "========================================="
94 python $src_dir/install-nim.py ./install $install_dir "$work_dir/install.log"
95 rc=$?
96 if [ $rc -ne 0 ]; then
34a8322 NMI checks
BuzzTroll authored
97 ls -l $src_dir/install-nim.py
98 ls -l
364bfc2 adding test file
BuzzTroll authored
99 echo "nimbus install failed"
100 exit 1
101 fi
102
103 echo "========================================="
104 echo "Configuring propagation only mode"
105 echo "========================================="
106
5a97c0d more diagnostics for b&t
BuzzTroll authored
107 ls -l $HOME/.ssh/
f6865f8 build and test seems to work
BuzzTroll authored
108 new_key=$HOME/.ssh/id_rsa
109 python $src_dir/ssh.py $new_key
e8e9517 verbose output change for NMI debug
BuzzTroll authored
110 rc=$?
276e511 for nmi testing
BuzzTroll authored
111 ls -l $HOME/.ssh/
e8e9517 verbose output change for NMI debug
BuzzTroll authored
112 if [ $rc -ne 0 ]; then
a7a3efa return code checking for b&t
BuzzTroll authored
113 echo "failed to make the ssh key"
114 exit 1
115 fi
364bfc2 adding test file
BuzzTroll authored
116 user=`whoami`
f6865f8 build and test seems to work
BuzzTroll authored
117 echo "Attempting to ssh"
118 ssh localhost hostname
5a97c0d more diagnostics for b&t
BuzzTroll authored
119 rc=$?
120 echo "ssh return code $rc"
364bfc2 adding test file
BuzzTroll authored
121
b9829db test suite changes that were not copied back in
BuzzTroll authored
122 export NIMBUS_WORKSPACE_CONTROL_HOME=$wsc_dst_src
123 cp -r $nimbus_wsc_source_dir/* $wsc_dst_src
d60538b testing tarballs should work now
bresnaha authored
124 if [ $? -ne 0 ]; then
b9829db test suite changes that were not copied back in
BuzzTroll authored
125 echo "could not copy in WSC:: cp -r $nimbus_wsc_source_dir/* $wsc_dst_src"
d60538b testing tarballs should work now
bresnaha authored
126 exit 1
127 fi
128
0b8aa41 merged virga1 and master
BuzzTroll authored
129 sed -e "s^@NIMBUS_WORKSPACE_CONTROL_HOME@^$NIMBUS_WORKSPACE_CONTROL_HOME^" -e "s^@KEY@^$new_key^" -e "s/@WHO@/$user/" $src_dir/autoconfig-decisions.sh.in > $install_dir/services/share/nimbus-autoconfig/autoconfig-decisions.sh
364bfc2 adding test file
BuzzTroll authored
130
131 cat $install_dir/services/share/nimbus-autoconfig/autoconfig-decisions.sh
132
133 $install_dir/services/share/nimbus-autoconfig/autoconfig-adjustments.sh
134
d60538b testing tarballs should work now
bresnaha authored
135 #cd $work_dir/control
b9829db test suite changes that were not copied back in
BuzzTroll authored
136 cd $wsc_dst_src
d60538b testing tarballs should work now
bresnaha authored
137 pwd
2ec2b27 @buzztroll modified the test suite so that it the image name come from an env and
buzztroll authored
138 if [ "X$NIMBUS_TEST_REAL" == "X" ]; then
139 bash ./src/propagate-only-mode.sh
140 fi
141
d60538b testing tarballs should work now
bresnaha authored
142 if [ $? -ne 0 ]; then
143 echo "PROP ONLY MODE CONFIGURATION FAILED"
144 exit 1
145 fi
364bfc2 adding test file
BuzzTroll authored
146
147 echo "========================================="
148 echo "Making cloud client"
149 echo "========================================="
150
d60538b testing tarballs should work now
bresnaha authored
151 if [ "X$CLOUD_CLIENT_HOME" == "X" ]; then
152 cd $nimbus_cc_dir
b9829db test suite changes that were not copied back in
BuzzTroll authored
153 pwd
d60538b testing tarballs should work now
bresnaha authored
154 bash ./builder/get-wscore.sh
b9829db test suite changes that were not copied back in
BuzzTroll authored
155 if [ $? -ne 0 ]; then
156 echo "bash ./builder/get-wscore.sh failed"
157 exit 1
158 fi
d60538b testing tarballs should work now
bresnaha authored
159 bash ./builder/dist.sh
b9829db test suite changes that were not copied back in
BuzzTroll authored
160 if [ $? -ne 0 ]; then
161 echo "bash ./builder/dist.sh failed"
162 exit 1
163 fi
d60538b testing tarballs should work now
bresnaha authored
164 cd $work_dir
165 tar -zxvf $nimbus_cc_dir/nimbus-cloud-client*.tar.gz
b9829db test suite changes that were not copied back in
BuzzTroll authored
166 if [ $? -ne 0 ]; then
167 echo "failed to untar $nimbus_cc_dir/nimbus-cloud-client*.tar.gz"
168 exit 1
169 fi
364bfc2 adding test file
BuzzTroll authored
170
d60538b testing tarballs should work now
bresnaha authored
171 cd nimbus-cloud-client*
172 ./bin/cloud-client.sh --help
173 export CLOUD_CLIENT_HOME=`pwd`
174 fi
364bfc2 adding test file
BuzzTroll authored
175
176 echo "========================================="
aad2f33 listing all of the common files for ec2 iface also
BuzzTroll authored
177 echo "Making a common user"
178 echo "========================================="
179 user_name="nimbus@$RANDOM"
93fb60d @labisso Better default group-authz configuration
labisso authored
180 user_stuff=`$install_dir/bin/nimbus-new-user --batch -r cloud_properties,cert,key,access_id,access_secret $user_name`
aad2f33 listing all of the common files for ec2 iface also
BuzzTroll authored
181 aid=`echo $user_stuff | awk -F , '{ print $4 }'`
182 apw=`echo $user_stuff | awk -F , '{ print $5 }'`
183
743e36e getting the accounts right for the test
BuzzTroll authored
184 sed -e "s^@ID@^$aid^" -e "s/@KEY@/$apw/" $src_dir/s3cfg.in > $HOME/.s3cfg
185 cat $HOME/.s3cfg
aad2f33 listing all of the common files for ec2 iface also
BuzzTroll authored
186
187 echo "========================================="
364bfc2 adding test file
BuzzTroll authored
188 echo "Making a new user"
189 echo "========================================="
190
191 user_name="nimbus@$RANDOM"
93fb60d @labisso Better default group-authz configuration
labisso authored
192 user_stuff=`$install_dir/bin/nimbus-new-user --batch -r cloud_properties,cert,key,access_id,access_secret,canonical_id $user_name`
364bfc2 adding test file
BuzzTroll authored
193
194 echo $user_stuff
195 cp=`echo $user_stuff | awk -F , '{ print $1 }'`
196 cert=`echo $user_stuff | awk -F , '{ print $2 }'`
197 key=`echo $user_stuff | awk -F , '{ print $3 }'`
74d8237 adding logic to configure s3cmd
BuzzTroll authored
198 aid=`echo $user_stuff | awk -F , '{ print $4 }'`
199 apw=`echo $user_stuff | awk -F , '{ print $5 }'`
342d2b6 added a new test for md5 check
BuzzTroll authored
200 can_id=`echo $user_stuff | awk -F , '{ print $6 }'`
364bfc2 adding test file
BuzzTroll authored
201
743e36e getting the accounts right for the test
BuzzTroll authored
202 sed -e "s^@ID@^$aid^" -e "s/@KEY@/$apw/" $src_dir/s3cfg.in > $HOME/.s3cfg.reg
6bb46a0 b&t and test tweaks
BuzzTroll authored
203
d60538b testing tarballs should work now
bresnaha authored
204 pwd
364bfc2 adding test file
BuzzTroll authored
205 echo $cp
206 echo $cert
207 echo $key
208
d60538b testing tarballs should work now
bresnaha authored
209 cd $CLOUD_CLIENT_HOME
210 cp $install_dir/var/ca/ca-certs/* $CLOUD_CLIENT_HOME/lib/certs/
211 if [ $? -ne 0 ]; then
212 pwd
213 echo "could not copy to $CLOUD_CLIENT_HOME/lib/certs/"
214 exit 1
215 fi
364bfc2 adding test file
BuzzTroll authored
216 cp $cp conf/
217
544d8c2 chaging ~ to $HOME
BuzzTroll authored
218 mkdir $HOME/.nimbus
219 cp $cert $HOME/.nimbus/
220 cp $key $HOME/.nimbus/
221 cp -r $HOME/.nimbus $HOME/.globus
364bfc2 adding test file
BuzzTroll authored
222
5a97c0d more diagnostics for b&t
BuzzTroll authored
223 echo "reporitng contents of dot nimbus and globus"
224 ls -l $HOME/.nimbus/
225 ls -l $HOME/.globus/
226
d60538b testing tarballs should work now
bresnaha authored
227 cd $CLOUD_CLIENT_HOME
228 $CLOUD_CLIENT_HOME/bin/grid-proxy-init.sh
364bfc2 adding test file
BuzzTroll authored
229
49b6870 @labisso Modified tests to use nimbus-admin for adding VMM
labisso authored
230 echo "========================================="
231 echo "Setting up VMM and network pools"
232 echo "========================================="
233
fba1429 removing tempfile change. no need for it yet
BuzzTroll authored
234 #sed -i 's^socket.dir=$NIMBUS_HOME/var/run/privileged/^socket.dir=//tmp^' $install_dir/services/etc/nimbus/workspace-service/admin.conf
235 #if [ $? -ne 0 ]; then
236 # echo "failed to sed admin file"
237 # exit 1
238 #fi
4487648 putting domain soickets in /tmp
BuzzTroll authored
239
240
49b6870 @labisso Modified tests to use nimbus-admin for adding VMM
labisso authored
241 $install_dir/bin/nimbusctl services start
242 if [ $? -ne 0 ]; then
243 echo "Starting Nimbus services failed"
244 exit 1
245 fi
7a7c221 need more sleep time.
BuzzTroll authored
246 sleep 15 # make sure it is really started, uhhhhh
15a10d3 getting more info out of the test suite for NMI
BuzzTroll authored
247 echo "trying $install_dir/bin/nimbusctl services status"
248 $install_dir/bin/nimbusctl services status
249 if [ $? -ne 0 ]; then
250 echo "Starting Nimbus services failed"
251 cat $install_dir/var/services.log
07375b0 minor test patch. fails when using a 0 prefixed group (not sure why)
BuzzTroll authored
252 cat $install_dir/var/cumulus.log
15a10d3 getting more info out of the test suite for NMI
BuzzTroll authored
253 exit 1
254 fi
17b20a5 retry the VM add a few times to deal with delay issues
BuzzTroll authored
255
256 done=1
257 try_count=0
258 while [ $done -ne 0 ];
259 do
2ec2b27 @buzztroll modified the test suite so that it the image name come from an env and
buzztroll authored
260 $src_dir/nimbus-nodes.sh
17b20a5 retry the VM add a few times to deal with delay issues
BuzzTroll authored
261 if [ $? -eq 0 ]; then
262 done=0
263 else
264 try_count=`expr $try_count + 1`
265
266 if [ $try_count -gt 10 ]; then
267 echo "Adding VMM node failed"
268 cat $install_dir/var/services.log
269 cat $install_dir/var/cumulus.log
270 ls -l $install_dir/var/
271 exit 1
272 fi
273 sleep 30
274 fi
275 done
276
49b6870 @labisso Modified tests to use nimbus-admin for adding VMM
labisso authored
277 $install_dir/bin/nimbusctl services stop
278 if [ $? -ne 0 ]; then
279 echo "Stopping Nimbus services failed"
280 exit 1
281 fi
282
283
246ff5c adding the pool of VM ips to the test suite
BuzzTroll authored
284 cp $src_dir/public $install_dir/services/etc/nimbus/workspace-service/network-pools/public
285
a188f82 adding another host with more memory to the pool
BuzzTroll authored
286
364bfc2 adding test file
BuzzTroll authored
287 echo $work_dir
288 export NIMBUS_TEST_USER=$user_name
289
290 echo "Your test environment is:"
291 echo "NIMBUS_HOME: $NIMBUS_HOME"
292 echo "NIMBUS_TEST_USER: $NIMBUS_TEST_USER"
293 echo "CLOUD_CLIENT_HOME: $CLOUD_CLIENT_HOME"
0b8aa41 merged virga1 and master
BuzzTroll authored
294 echo "NIMBUS_WORKSPACE_CONTROL_HOME: $NIMBUS_WORKSPACE_CONTROL_HOME"
342d2b6 added a new test for md5 check
BuzzTroll authored
295 echo "NIMBUS_TEST_USER_CAN_ID: $can_id"
364bfc2 adding test file
BuzzTroll authored
296
297
298 echo "export NIMBUS_HOME=$NIMBUS_HOME" > $src_dir/env.sh
299 echo "export NIMBUS_TEST_USER=$NIMBUS_TEST_USER" >> $src_dir/env.sh
300 echo "export CLOUD_CLIENT_HOME=$CLOUD_CLIENT_HOME" >> $src_dir/env.sh
301 echo "export NIMBUS_WORKSPACE_CONTROL_HOME=$NIMBUS_WORKSPACE_CONTROL_HOME" >> $src_dir/env.sh
342d2b6 added a new test for md5 check
BuzzTroll authored
302 echo "export NIMBUS_TEST_USER_CAN_ID=$can_id" >> $src_dir/env.sh
f3cd495 @buzztroll breaking out the image name from the image location
buzztroll authored
303 echo "export NIMBUS_TEST_IMAGE=group" >> $src_dir/env.sh
304 echo "export NIMBUS_SOURCE_TEST_IMAGE=/etc/group" >> $src_dir/env.sh
3511c12 @buzztroll making the test timeout configurable
buzztroll authored
305 echo "export NIMBUS_TEST_TIMEOUT=90" >> $src_dir/env.sh
364bfc2 adding test file
BuzzTroll authored
306
Something went wrong with that request. Please try again.