Exemplo n.º 1
0
 def _configLink(self):
     host = self.getHost()
     iface = self.internalInterface()
     self._assignIfb()
     assert self.hasIfbId()
     ifb = "ifb%d" % self.getIfbId()
     ifaceutil.ifup(host, ifb)
     tc.setLinkEmulation(
         host,
         iface,
         bandwidth=float(self.getNetemProp("bandwidth", "to")),
         delay=float(self.getNetemProp("delay", "to")),
         jitter=float(self.getNetemProp("jitter", "to")),
         delay_correlation=float(self.getNetemProp("delay_correlation", "to")),
         distribution=self.getNetemProp("distribution", "to"),
         loss=float(self.getNetemProp("lossratio", "to")),
         loss_correlation=float(self.getNetemProp("lossratio_correlation", "to")),
         duplicate=float(self.getNetemProp("duplicate", "to")),
         corrupt=float(self.getNetemProp("corrupt", "to")),
     )
     tc.setLinkEmulation(
         host,
         ifb,
         bandwidth=float(self.getNetemProp("bandwidth", "from")),
         delay=float(self.getNetemProp("delay", "from")),
         jitter=float(self.getNetemProp("jitter", "from")),
         delay_correlation=float(self.getNetemProp("delay_correlation", "from")),
         distribution=self.getNetemProp("distribution", "from"),
         loss=float(self.getNetemProp("lossratio", "from")),
         loss_correlation=float(self.getNetemProp("lossratio_correlation", "from")),
         duplicate=float(self.getNetemProp("duplicate", "from")),
         corrupt=float(self.getNetemProp("corrupt", "from")),
     )
     tc.setIncomingRedirect(host, iface, ifb)
Exemplo n.º 2
0
	def _configLink(self):
		host = self.getHost()
		iface = self.internalInterface()
		assert not self.getAttribute("ifb_id", None) is None
		ifb = "ifb%d" % self.getAttribute("ifb_id", None)
		ifaceutil.ifup(host, ifb)
		tc.setLinkEmulation(host, iface, 
			bandwidth=self.getNetemProp("bandwidth", "to"),
			delay=self.getNetemProp("delay", "to"),
			jitter=self.getNetemProp("jitter", "to"),
			delay_correlation=self.getNetemProp("delay_correlation", "to"),
			distribution=self.getNetemProp("distribution", "to"),
			loss=self.getNetemProp("lossratio", "to"),
			loss_correlation=self.getNetemProp("lossratio_correlation", "to"),
			duplicate=self.getNetemProp("duplicate", "to"),
			corrupt=self.getNetemProp("corrupt", "to"),
		)
		tc.setLinkEmulation(host, ifb,
			bandwidth=self.getNetemProp("bandwidth", "from"),
			delay=self.getNetemProp("delay", "from"),
			jitter=self.getNetemProp("jitter", "from"),
			delay_correlation=self.getNetemProp("delay_correlation", "from"),
			distribution=self.getNetemProp("distribution", "from"),
			loss=self.getNetemProp("lossratio", "from"),
			loss_correlation=self.getNetemProp("lossratio_correlation", "from"),
			duplicate=self.getNetemProp("duplicate", "from"),
			corrupt=self.getNetemProp("corrupt", "from"),
		)
		tc.setIncomingRedirect(host, iface, ifb)