aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rumba/model.py1
-rw-r--r--rumba/ssh_support.py10
-rw-r--r--rumba/testbeds/jfed.py17
3 files changed, 18 insertions, 10 deletions
diff --git a/rumba/model.py b/rumba/model.py
index 941cba8..c1c6f5d 100644
--- a/rumba/model.py
+++ b/rumba/model.py
@@ -49,6 +49,7 @@ class Testbed:
self.proj_name = proj_name
self.exp_name = exp_name
self.http_proxy = http_proxy
+ self.flags = {'no_vlan_offload': False}
@abc.abstractmethod
def swap_in(self, experiment):
diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py
index f8ba03b..a1e1ba4 100644
--- a/rumba/ssh_support.py
+++ b/rumba/ssh_support.py
@@ -275,9 +275,9 @@ def setup_vlan(testbed, node, vlan_id, int_name):
% args),
sudo("ifconfig %(ifname)s.%(vlan)s up"
% args)]
- # TODO: is ethtool needed? Should install or check if it is present.
- # cmds += [sudo("ethtool -K %(ifname)s rxvlan off"
- # % args),
- # sudo("ethtool -K %(ifname)s txvlan off"
- # % args)]
+ if testbed.flags['no_vlan_offload']:
+ cmds += [sudo("ethtool -K %(ifname)s rxvlan off"
+ % args),
+ sudo("ethtool -K %(ifname)s txvlan off"
+ % args)]
execute_commands(testbed, node.ssh_config, cmds)
diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py
index 1e1c732..83fbce7 100644
--- a/rumba/testbeds/jfed.py
+++ b/rumba/testbeds/jfed.py
@@ -68,6 +68,7 @@ class Testbed(mod.Testbed):
tar.close()
logger.info("Extracted in current directory")
os.remove(tarball)
+ self.flags['no_vlan_offload'] = True
def create_rspec(self, experiment):
impl = xml.getDOMImplementation()
@@ -189,11 +190,17 @@ class Testbed(mod.Testbed):
mac = ":".join(
[aux_mac_address[i:i+2] for i in range(0, 12, 2)]
)
- ssh_support.copy_path_to_testbed(
- self,
- node_n.ssh_config,
- os.path.join(dir_path, 'mac2ifname.sh'),
- '')
+ command = (
+ 'echo "mac=\\"\$1\\"; cd / && ./sbin/ifconfig -a | '
+ 'awk \'/^[a-z]/ { if ( \\"\'\\"\$mac\\"\'\\" == \$5 )'
+ ' print \$1}\'" > mac2ifname.sh')
+ ssh_support.execute_command(self, node_n.ssh_config, command)
+
+ # ssh_support.copy_path_to_testbed(
+ # self,
+ # node_n.ssh_config,
+ # os.path.join(dir_path, 'mac2ifname.sh'),
+ # '')
ssh_support.execute_command(
self,
node_n.ssh_config,