コード例 #1
0
 def __init__(self):
     self.setuptestcase()
     self.setup_parser(description="Test EBS on BFEBS during restart", testlist=False)
     self.parser.add_argument('--count',
                              help='Number of times to start/stop instance', default=5)
     self.parser.add_argument('--pause',
                              help='Number of seconds to pause between tests',default=5)
     self.parser.add_argument('--size',
                              help='Size of volume to create', default=1)
     self.get_args()
     self.set_arg('azone', self.args.zone)
     try:
         self.do_with_args(self.checkargs)
     except Exception:
         raise Exception("Mandotory arguments missing: emi and zone and (credpath or (config and password))")
     self.tester = self.do_with_args(Eucaops)
     self.volume = None
     self.instance = EuInstance()
コード例 #2
0
     pmsg("Remote file size: "+ str(rfsize) + "g")
     conn.close() 
 except Exception, e:
     pmsg("Failed to get remote file size...")
     raise e
 try:
     instance = None    
     keys = tester.get_all_current_local_keys()
     
     if keys != []:
         pmsg("Looks like we had some local keys looking through them now...")
         for keypair in keys:
             pmsg('looking for instances using keypair:'+keypair.name)
             instances = tester.get_instances(state='running',key=keypair.name)
             if instances != []:
                 instance = EuInstance(instances[0])
                 pmsg('Found usable instance:'+instance.id+'using key:'+keypair.name)
                 break
 except Exception, e:
     pmsg("Failed to find a pre-existing isntance we can connect to:"+str(e))
     pass
 
         
 if instance is None:   
     #Create a new keypair to use for this test if we didn't find one
     if keypair is None:
         try:
             keypair = tester.add_keypair(prefix + "-" + str(time.time()))
         except Exception, e:
             raise Exception("Error when adding keypair. Error:"+str(e))