[lnst] Don't remove any modules on device cleanup
by Jiří Pírko
commit 68cc48b9bcbb883548e459c5c94c0480c7e91b7e
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Mon Jan 27 10:09:16 2014 +0100
Don't remove any modules on device cleanup
Removal of some kernel modules can break the testing environment e.g.
the bridge driver in virtual setup where dom0 is acting as one of the
slaves. This patch removes the code that unloads netdevice's kernel module.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/NetConfigDevice.py | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
---
diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py
index 53e89b2..0c71fc7 100644
--- a/lnst/Slave/NetConfigDevice.py
+++ b/lnst/Slave/NetConfigDevice.py
@@ -72,9 +72,6 @@ class NetConfigDeviceGeneric:
def type_cleanup(self):
if self._cleanupcmd:
exec_cmd(self._cleanupcmd, die_on_err=False)
- if self._modulename:
- kmod_in_use(self._modulename, 300)
- exec_cmd("modprobe -q -r %s" % self._modulename, die_on_err=False)
class NetConfigDeviceEth(NetConfigDeviceGeneric):
def configure(self):
9 years, 10 months
[PATCH] Don't remove any modules on device cleanup
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Slave/NetConfigDevice.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py
index 53e89b2..0c71fc7 100644
--- a/lnst/Slave/NetConfigDevice.py
+++ b/lnst/Slave/NetConfigDevice.py
@@ -72,9 +72,6 @@ class NetConfigDeviceGeneric:
def type_cleanup(self):
if self._cleanupcmd:
exec_cmd(self._cleanupcmd, die_on_err=False)
- if self._modulename:
- kmod_in_use(self._modulename, 300)
- exec_cmd("modprobe -q -r %s" % self._modulename, die_on_err=False)
class NetConfigDeviceEth(NetConfigDeviceGeneric):
def configure(self):
--
1.8.1.4
9 years, 10 months
[PATCH] Don't remove any modules on device cleanup
by Jan Tluka
Removal of some kernel modules can break the testing environment e.g.
the bridge driver in virtual setup where dom0 is acting as one of the
slaves. This patch removes the code that unloads netdevice's kernel module.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Slave/NetConfigDevice.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py
index 53e89b2..0c71fc7 100644
--- a/lnst/Slave/NetConfigDevice.py
+++ b/lnst/Slave/NetConfigDevice.py
@@ -72,9 +72,6 @@ class NetConfigDeviceGeneric:
def type_cleanup(self):
if self._cleanupcmd:
exec_cmd(self._cleanupcmd, die_on_err=False)
- if self._modulename:
- kmod_in_use(self._modulename, 300)
- exec_cmd("modprobe -q -r %s" % self._modulename, die_on_err=False)
class NetConfigDeviceEth(NetConfigDeviceGeneric):
def configure(self):
--
1.8.1.4
9 years, 10 months
[lnst] Created tag v2
by Jiří Pírko
The lightweight tag 'v2' was created pointing to:
102e035... 2 release
9 years, 10 months
[lnst] 2 release
by Jiří Pírko
commit 102e0358dfca03c9823fde8dfc15a247039efb69
Author: Jiri Pirko <jiri(a)resnulli.us>
Date: Sat Jan 25 13:13:05 2014 +0100
2 release
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
setup.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/setup.py b/setup.py
index d841e58..f0a56e6 100755
--- a/setup.py
+++ b/setup.py
@@ -157,7 +157,7 @@ DATA_FILES = CONFIG + TEST_MODULES + MULTICAST_TEST_TOOLS + MAN_PAGES + \
SCHEMAS + BASH_COMP
setup(name="lnst",
- version="1",
+ version="2",
description="Linux Network Stack Test",
author="LNST Team",
author_email="lnst-developers(a)lists.fedorahosted.org",
9 years, 10 months
[lnst] Fix empty team port bug
by Jiří Pírko
commit 1174ba74009d4ead271d8cde51dd4f708fe2d643
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Tue Jan 14 11:05:08 2014 +0100
Fix empty team port bug
Team daemon refuses to update port configuration with empty string. This
patch fixes this issue and passes the config only if it has been
specified in the recipe.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/NmConfigDevice.py | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index bf488cb..396dea8 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -750,8 +750,6 @@ class NmConfigDeviceTeam(NmConfigDeviceGeneric):
teamd_port_config = get_slave_option(self._netdev,
slave, "teamd_port_config")
- if teamd_port_config == None:
- teamd_port_config = ""
s_eth = dbus.Dictionary({
'duplex': dbus.Array('full', 's'),
@@ -765,13 +763,14 @@ class NmConfigDeviceTeam(NmConfigDeviceGeneric):
'master': self._netdev["master_uuid"],
'slave-type': 'team'})
- s_port_cfg = dbus.Dictionary({
- 'config': teamd_port_config})
-
slave_con = dbus.Dictionary({
'802-3-ethernet': s_eth,
- 'connection': s_slave_con,
- 'team-port': s_port_cfg})
+ 'connection': s_slave_con})
+
+ if teamd_port_config != None:
+ s_port_cfg = dbus.Dictionary({
+ 'config': teamd_port_config})
+ slave_con['team-port'] = s_port_cfg
netdev["con_obj_path"] = self._nm_add_connection(slave_con)
9 years, 10 months
[lnst] Fix copy-paste error in is_nm_managed call
by Jiří Pírko
commit bf61edd023188415b46e24e7446fb02947aa12ac
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Fri Jan 10 17:38:21 2014 +0100
Fix copy-paste error in is_nm_managed call
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/NmConfigDevice.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 4901729..bf488cb 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -457,7 +457,7 @@ class NmConfigDeviceBridge(NmConfigDeviceGeneric):
@classmethod
def is_nm_managed(cls, netdev, config):
if _dev_exists(netdev["hwaddr"]):
- managed = super(NmConfigDeviceBond, cls).is_nm_managed(netdev,
+ managed = super(NmConfigDeviceBridge, cls).is_nm_managed(netdev,
config)
else:
slave_id = get_slaves(netdev)[1]
@@ -598,7 +598,7 @@ class NmConfigDeviceVlan(NmConfigDeviceGeneric):
@classmethod
def is_nm_managed(cls, netdev, config):
if _dev_exists(netdev["hwaddr"]):
- managed = super(NmConfigDeviceBond, cls).is_nm_managed(netdev,
+ managed = super(NmConfigDeviceVlan, cls).is_nm_managed(netdev,
config)
else:
slave_id = get_slaves(netdev)[0]
9 years, 10 months
[PATCH] Allow more attempts on connection activation
by Jan Tluka
NM connections might not be available immediately and in that case an
activation of such connection will raise DBusException. This patch adds
a check for the exception and retries to activate connection five times
with 1 second step. After timeout the exception is passed further.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Slave/NmConfigDevice.py | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 396dea8..fa8fed4 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -24,6 +24,7 @@ from lnst.Common.Utils import kmod_in_use, bool_it
from lnst.Common.NetUtils import scan_netdevs
from lnst.Common.Utils import check_process_running
from lnst.Common.Config import lnst_config
+from dbus.exceptions import DBusException
NM_BUS = "org.freedesktop.NetworkManager"
OBJ_PRE = "/org/freedesktop/NetworkManager"
@@ -221,9 +222,19 @@ class NmConfigDeviceGeneric(object):
except:
device_obj_path = "/"
- netdev["acon_obj_path"] = nm_if.ActivateConnection(
- netdev["con_obj_path"],
- device_obj_path, "/")
+ timeout = 0
+ while timeout != 5:
+ try:
+ netdev["acon_obj_path"] = nm_if.ActivateConnection(
+ netdev["con_obj_path"],
+ device_obj_path, "/")
+ break
+ except DBusException as e:
+ # connection might not be available yet, wait 1 second
+ timeout += 1
+ if timeout == 5:
+ raise e
+ time.sleep(1)
logging.debug("Device object path: %s" % device_obj_path)
logging.debug("Connection object path: %s" % netdev["con_obj_path"])
--
1.8.1.4
9 years, 11 months
[PATCH] Fix empty team port bug
by Jan Tluka
Team daemon refuses to update port configuration with empty string. This
patch fixes this issue and passes the config only if it has been
specified in the recipe.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Slave/NmConfigDevice.py | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index bf488cb..396dea8 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -750,8 +750,6 @@ class NmConfigDeviceTeam(NmConfigDeviceGeneric):
teamd_port_config = get_slave_option(self._netdev,
slave, "teamd_port_config")
- if teamd_port_config == None:
- teamd_port_config = ""
s_eth = dbus.Dictionary({
'duplex': dbus.Array('full', 's'),
@@ -765,13 +763,14 @@ class NmConfigDeviceTeam(NmConfigDeviceGeneric):
'master': self._netdev["master_uuid"],
'slave-type': 'team'})
- s_port_cfg = dbus.Dictionary({
- 'config': teamd_port_config})
-
slave_con = dbus.Dictionary({
'802-3-ethernet': s_eth,
- 'connection': s_slave_con,
- 'team-port': s_port_cfg})
+ 'connection': s_slave_con})
+
+ if teamd_port_config != None:
+ s_port_cfg = dbus.Dictionary({
+ 'config': teamd_port_config})
+ slave_con['team-port'] = s_port_cfg
netdev["con_obj_path"] = self._nm_add_connection(slave_con)
--
1.8.1.4
9 years, 11 months
[PATCH] Fix copy-paste error in is_nm_managed call
by Jan Tluka
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Slave/NmConfigDevice.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 4901729..bf488cb 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -457,7 +457,7 @@ class NmConfigDeviceBridge(NmConfigDeviceGeneric):
@classmethod
def is_nm_managed(cls, netdev, config):
if _dev_exists(netdev["hwaddr"]):
- managed = super(NmConfigDeviceBond, cls).is_nm_managed(netdev,
+ managed = super(NmConfigDeviceBridge, cls).is_nm_managed(netdev,
config)
else:
slave_id = get_slaves(netdev)[1]
@@ -598,7 +598,7 @@ class NmConfigDeviceVlan(NmConfigDeviceGeneric):
@classmethod
def is_nm_managed(cls, netdev, config):
if _dev_exists(netdev["hwaddr"]):
- managed = super(NmConfigDeviceBond, cls).is_nm_managed(netdev,
+ managed = super(NmConfigDeviceVlan, cls).is_nm_managed(netdev,
config)
else:
slave_id = get_slaves(netdev)[0]
--
1.8.1.4
9 years, 11 months