From dfd400c2fb1383bcd6e3862d6199fffad4e78524 Mon Sep 17 00:00:00 2001 From: Nick Aerts Date: Fri, 23 Mar 2018 23:36:34 +0100 Subject: linkquality: added link_quality to add delay, loss and rate limit to link This adds the ability to assign delay and loss to links. 4 new object types are introduced: - LinkQuality - Delay - Loss - Rate All attributes are read-only, one attribute link_quality is added to the ShimEthDIF with a callback to the LinkQualityManager which will automatically apply a new link_quality profile when this attribute is written. --- rumba/testbeds/qemu.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'rumba/testbeds/qemu.py') diff --git a/rumba/testbeds/qemu.py b/rumba/testbeds/qemu.py index df80b7e..5f76684 100644 --- a/rumba/testbeds/qemu.py +++ b/rumba/testbeds/qemu.py @@ -125,14 +125,12 @@ class Testbed(mod.Testbed): "ip link set dev %(ifname)s up" % {'ifname': ipcp.ifname}) - def swap_in(self, experiment): + def _swap_in(self, experiment): """ :type experiment mod.Experiment :param experiment: The experiment running """ - mod.Testbed.swap_in(self, experiment) - if os.geteuid() != 0: try: subprocess.check_call(["sudo", "-v"]) @@ -195,19 +193,6 @@ class Testbed(mod.Testbed): 'brctl addif %(br)s %(tap)s' % {'tap': tap_id, 'br': shim.name} ).split('\n') - if shim.link_speed > 0: - speed = '%dmbit' % shim.link_speed - - # Rate limit the traffic transmitted on the TAP interface - command_list += ( - 'tc qdisc add dev %(tap)s handle 1: root ' - 'htb default 11\n' - 'tc class add dev %(tap)s parent 1: classid ' - '1:1 htb rate 10gbit\n' - 'tc class add dev %(tap)s parent 1:1 classid ' - '1:11 htb rate %(speed)s' - % {'tap': tap_id, 'speed': speed} - ).split('\n') # While we're at it, build vm ports table and ipcp table vm['ports'].append({'tap_id': tap_id, -- cgit v1.2.3