From: Tony Mack Date: Fri, 18 Apr 2008 15:22:10 +0000 (+0000) Subject: fix on the check_slice step, Now NM is doing more things so time between getting... X-Git-Tag: tests-4.2-4~38 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ab7002acd13c841b3dd9573f87f26152f8264fb0;p=tests.git fix on the check_slice step, Now NM is doing more things so time between getting ssh inside the node and having slice created is being more longer --- diff --git a/system/TestSlice.py b/system/TestSlice.py index 714c797..1305618 100644 --- a/system/TestSlice.py +++ b/system/TestSlice.py @@ -72,9 +72,9 @@ class TestSlice: found=True return (found,privatekey) - def check_slice(self,options,minutes=3): + def check_slice(self,options,minutes=6,gracetime=3,period=30): timeout = datetime.datetime.now()+datetime.timedelta(minutes=minutes) - + graceout = datetime.datetime.now()+datetime.timedelta(minutes=gracetime) # locate a key (found,remote_privatekey)=self.locate_key() if not found : @@ -95,8 +95,8 @@ class TestSlice: date_test_ssh = TestSsh (hostname,key=remote_privatekey,username=self.name()) # 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") - if not date: + date = date_test_ssh.run("id;hostname")==0 + if date: utils.header("Successfuly entered slice %s on %s"%(self.name(),hostname)) tocheck.remove(hostname) else: @@ -121,6 +121,10 @@ class TestSlice: for hostname in tocheck: utils.header("FAILURE to ssh into %s@%s"%(self.name(),hostname)) return False - time.sleep (15) + #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) # for an empty slice return True