isname=self.slice_spec['initscriptname']
utils.header("Adding initscript %s in %s"%(isname,slice_name))
self.test_plc.apiserver.AddSliceAttribute(self.test_plc.auth_root(), slice_name,'initscript',isname)
+ if self.slice_spec.has_key ('vref'):
+ vref_value=self.slice_spec['vref']
+ self.test_plc.apiserver.AddSliceAttribute(self.test_plc.auth_root(), slice_name,'vref',vref_value)
def locate_key(self):
# locate the first avail. key
found=True
return (found,privatekey)
- def check_slice(self,options,minutes=6,gracetime=3,period=30):
+ def check_slice(self,options,minutes=10,gracetime=4,period=15):
timeout = datetime.datetime.now()+datetime.timedelta(minutes=minutes)
graceout = datetime.datetime.now()+datetime.timedelta(minutes=gracetime)
# locate a key
for hostname in tocheck:
(site_spec,node_spec) = self.test_plc.locate_hostname(hostname)
date_test_ssh = TestSsh (hostname,key=remote_privatekey,username=self.name())
+ if datetime.datetime.now() >= graceout:
+ utils.header('Trying to enter into slice %s@%s'%(self.name(),hostname))
# this can be ran locally as we have the key
- utils.header('Trying to enter into slice %s@%s'%(self.name(),hostname))
date = date_test_ssh.run("id;hostname")==0
if date:
utils.header("Successfuly entered slice %s on %s"%(self.name(),hostname))
for hostname in tocheck:
utils.header("FAILURE to ssh into %s@%s"%(self.name(),hostname))
return False
- #freezing ,slice don't get created before at least 3 minutes after sshd is started
- if datetime.datetime.now() < graceout:
- utils.header ("The Slice %s under the Node %s is not created yet"%(self.name(),hostname))
- time.sleep(gracetime*60)
- else : time.sleep (period)
+ # wait for the period
+ time.sleep (period)
# for an empty slice
return True
+