def SetUp(self, context, result): """ Set up the resource. Create a generic endpoint object. """ ep = gen.Endpoint(self.ipaddr, self.mask, self.ethport) #ep.setValue('callingplan', self.callingplan) ep.setValue('extn', self.extn) ep.setValue('realm', self.realm) context[self.property] = ep
def SetUp(self, context, result): """ Set up the resource. Create a generic endpoint object. """ if len(self.mask) == 0: self.mask = None if len(self.ethport) == 0: self.ethport = None ep = gen.Endpoint(self.ipaddr, self.mask, self.ethport) ep.setValue('realm', self.realm) ep.configure('h323', mode='send', h323id=self.property, gateway=self.gateway, numcalls=self.numcalls, destnum=self.destnum) context[self.property] = ep
def SetUp(self, context, result): """ Set up the resource. Create a generic endpoint object. """ if len(self.mask) == 0: self.mask = None if len(self.ethport) == 0: self.ethport = None ep = gen.Endpoint(self.ipaddr, self.mask, self.ethport) ep.setValue('callingplan', self.callingplan) ep.setValue('extn', self.extn) ep.setValue('priority', self.priority) ep.setValue('realm', self.realm) ep.configure('h323', mode='receive', h323id=self.property, gateway=self.gateway) context[self.property] = ep
#Create a generic endpoint object. if len(self.mask) == 0: self.mask = None if len(self.ethport) == 0: self.ethport = None try: ip = socket.gethostbyname(self.ipaddr) except socket.gaierror, exc: errno, errstr = exc result.Annotate({ 'Endpoint name': self.property, 'Endpoint address': self.ipaddr, 'Exception': str(exc) }) result.Fail('Could not resolve endpoint IP address') else: ep = gen.Endpoint(ip, self.mask, self.ethport, self.property) context[self.property] = ep # the following is DEPRECATED. to get the ip address within # your tests, use: ip = context['my_endpoint'].addr addr = self.property + '_addr' context[addr] = self.ipaddr def CleanUp(self, result): #PR 184675 - Added the if condition of eth2 and eth3 #Incase we are using the physucal ip of eth2 and eth3 as resouce, these shouldnot #be deleted. if not ((self.ipaddr == 'eth2') or (self.ipaddr == 'eth3')): self.log.debug('Cleaning endpoint resource: property: %s, ip: %s, mask: %s, eth: %s' % \ (self.property, self.ipaddr, self.mask, self.ethport)) if self.ostype == 'Linux':