Change in vdsm[ovirt-3.5]: spec: Require sanlock 2.8-3
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: spec: Require sanlock 2.8-3
......................................................................
spec: Require sanlock 2.8-3
Sanlock 2.8-3 added missing dependency on /usr/sbin/useradd and
/usr/sbin/groupadd, used to add the sanlock user and group during
installation. Without these dependencies, sanlock installation fail to
add the user and group, which fail vdsm-tool configure later.
Change-Id: I83ad11eda2695f161ee294571bbacbac11586b83
Bug-Url: https://bugzilla.redhat.com/1349068
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/59656/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 607532f..7f968bd 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -216,7 +216,7 @@
Requires: iscsi-initiator-utils >= 6.2.0.873-21
%endif
-Requires: sanlock >= 2.8, sanlock-python
+Requires: sanlock >= 2.8-3, sanlock-python
%if 0%{?rhel}
Requires: python-ethtool >= 0.6-3
--
To view, visit https://gerrit.ovirt.org/59656
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I83ad11eda2695f161ee294571bbacbac11586b83
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 9 months
Change in vdsm[master]: pv-tags: Remove unused return value
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: pv-tags: Remove unused return value
......................................................................
pv-tags: Remove unused return value
Nobody is using _initpvs return value and the value is pretty useless to
the caller.
Change-Id: I4ed33d402d534cda971213008583e933196d2803
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/storage/lvm.py
1 file changed, 0 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/64947/1
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 68d3d98..a2442ca 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -738,8 +738,6 @@
log.error("%s, %s", out, err)
raise se.PhysDevInitializationError(str(devices))
- return (set(devices), set(), rc, out, err)
-
def getLvDmName(vgName, lvName):
return "%s-%s" % (vgName.replace("-", "--"), lvName)
--
To view, visit https://gerrit.ovirt.org/64947
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ed33d402d534cda971213008583e933196d2803
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 9 months
Change in vdsm[master]: tests: Add loop module
by fromani@redhat.com
Francesco Romani has posted comments on this change.
Change subject: tests: Add loop module
......................................................................
Patch Set 4: Code-Review+1
--
To view, visit https://gerrit.ovirt.org/64329
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I37184887930ad9ec1234036fdcdeb6cee8ccac42
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Ala Hino <ahino(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 9 months
Change in vdsm[master]: hostdev: prefer numa nodes close to device MMIO
by fromani@redhat.com
Francesco Romani has posted comments on this change.
Change subject: hostdev: prefer numa nodes close to device MMIO
......................................................................
Patch Set 17: Code-Review+2
--
To view, visit https://gerrit.ovirt.org/60640
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9bc795d2f5bad76ebf1e1bff391b3bc71037fffb
Gerrit-PatchSet: 17
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 9 months
Change in vdsm[master]: StorageDomain.getInfo - report the first pv of the metadata lv
by laravot@redhat.com
Liron Aravot has uploaded a new change for review.
Change subject: StorageDomain.getInfo - report the first pv of the metadata lv
......................................................................
StorageDomain.getInfo - report the first pv of the metadata lv
This patch adds the report of the first pv of the domain metadata lv
(for block domains) to StorageDomain.getInfo().
Currently we assume that the metadata lv is created on the first extant
of the device and verify that when performing different operations on
the domain.
As we intend to add support for operations that modify the vg
stracture (like reducing devices) - we want to prevent those
operations from being made on the first device of the metadata lv
as they might cause the metadata lv first extant to be changed from
0.
This patch adds the reporting of that info, so that the engine can
leverage the info to block such operations.
Change-Id: I32c847ae89b9f8f512c3dd8a0fff96fbc753ee5b
Signed-off-by: Liron Aravot <laravot(a)redhat.com>
---
M lib/api/vdsm-api.yml
M vdsm/storage/blockSD.py
2 files changed, 11 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/27/63027/7
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index 514206d..8168fbb 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -5651,6 +5651,12 @@
- description: The Storage Domain UUID
name: uuid
type: *UUID
+
+ - defaultvalue: null
+ description: The GUID of the first device containing the domain metadata lv (optional)
+ name: metadatadevice
+ type: string
+
type: object
StorageDomainStatus: &StorageDomainStatus
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 11191cd..b164551 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -445,6 +445,10 @@
# FIXME: following line.
lvm.extendLV(self.sdUUID, volumeUUID, size) # , isShuttingDown)
+ def getMetadataLVFirstDevice(self):
+ dev, _ = lvm.getFirstExt(self.sdUUID, sd.METADATA)
+ return os.path.basename(dev)
+
@classmethod
def getMetaDataMapping(cls, vgName, oldMapping={}):
firstDev, firstExtent = lvm.getFirstExt(vgName, sd.METADATA)
@@ -1103,6 +1107,7 @@
vg = lvm.getVG(self.sdUUID) # vg.name = self.sdUUID
info['vguuid'] = vg.uuid
info['state'] = vg.partial
+ info['metadatadevice'] = self._manifest.getMetadataLVFirstDevice()
return info
def getStats(self):
--
To view, visit https://gerrit.ovirt.org/63027
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I32c847ae89b9f8f512c3dd8a0fff96fbc753ee5b
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <laravot(a)redhat.com>
Gerrit-Reviewer: Liron Aravot <laravot(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
7 years, 9 months
Change in vdsm[master]: StorageDomain.getInfo - report lvm metadata device for block sd
by laravot@redhat.com
Liron Aravot has uploaded a new change for review.
Change subject: StorageDomain.getInfo - report lvm metadata device for block sd
......................................................................
StorageDomain.getInfo - report lvm metadata device for block sd
When a block storage domain is created, we disable the lvm metadata
on all the domain pvs except to the first one.
As we intend to add support for operations that modify the vg
stracture (like reducing devices) - we want to prevent those
operations from being made on the device containing the vg metadata.
This patch adds the reporting of that info, so that the engine can
leverage the info to block such operations.
Change-Id: I4a7763d2ab7d796be633ecd69f661cba96e29dde
Signed-off-by: Liron Aravot <laravot(a)redhat.com>
---
M lib/api/vdsm-api.yml
M lib/vdsm/storage/exception.py
M vdsm/storage/blockSD.py
M vdsm/storage/lvm.py
4 files changed, 48 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/64433/1
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index 8168fbb..02e1ede 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -5653,6 +5653,11 @@
type: *UUID
- defaultvalue: null
+ description: The GUID of the device containing the domain lvm metadata (optional)
+ name: lvmmetadatadevice
+ type: string
+
+ - defaultvalue: null
description: The GUID of the first device containing the domain metadata lv (optional)
name: metadatadevice
type: string
diff --git a/lib/vdsm/storage/exception.py b/lib/vdsm/storage/exception.py
index 23e2628..743c5d9 100644
--- a/lib/vdsm/storage/exception.py
+++ b/lib/vdsm/storage/exception.py
@@ -1556,6 +1556,11 @@
code = 615
message = "Could not resize PV"
+class CannotGetVGMetadataPV(StorageException):
+ def __init__(self, vgname):
+ self.value = "vgname=%s" % (vgname)
+ code = 616
+ message = "Cannot get Volume Group metadata PV"
#################################################
# SPM/HSM Exceptions
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index b164551..ec060c1 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -449,6 +449,9 @@
dev, _ = lvm.getFirstExt(self.sdUUID, sd.METADATA)
return os.path.basename(dev)
+ def getVgMetadataDevice(self):
+ return os.path.basename(lvm.getVgMetadataPv(self.sdUUID))
+
@classmethod
def getMetaDataMapping(cls, vgName, oldMapping={}):
firstDev, firstExtent = lvm.getFirstExt(vgName, sd.METADATA)
@@ -1108,6 +1111,7 @@
info['vguuid'] = vg.uuid
info['state'] = vg.partial
info['metadatadevice'] = self._manifest.getMetadataLVFirstDevice()
+ info['lvmmetadatadevice'] = self._manifest.getVgMetadataDevice()
return info
def getStats(self):
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 3d3c31a..c0a5c1c 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -51,7 +51,7 @@
LVM_DEFAULT_TTL = 100
PV_FIELDS = ("uuid,name,size,vg_name,vg_uuid,pe_start,pe_count,"
- "pe_alloc_count,mda_count,dev_size")
+ "pe_alloc_count,mda_count,dev_size,mda_used_count")
VG_FIELDS = ("uuid,name,attr,size,free,extent_size,extent_count,free_count,"
"tags,vg_mda_size,vg_mda_free,lv_count,pv_count,pv_name")
LV_FIELDS = "uuid,name,vg_name,attr,size,seg_start_pe,devices,tags"
@@ -555,6 +555,25 @@
reloaded = self._reloadpvs(stalepvs)
pvs.update(reloaded)
return pvs.values()
+
+ def _isMetadataPv(self, pv):
+ return int(pv.pv_mda_used_count) > 0
+
+ def getVgMetadataPv(self, vgName):
+ stalepvs = []
+ for pvName in self.listPVNames(vgName):
+ pv = self._pvs.get(pvName)
+ if not pv or isinstance(pv, Stub):
+ stalepvs.append(pvName)
+ if self._isMetadataPv(pv):
+ return pv
+
+ pvs = self._reloadpvs(pvName=stalepvs)
+ for pv in pvs:
+ if not isinstance(pv, Stub) and self._isMetadataPv(pv):
+ return pv
+
+ raise se.CouldNotResizePhysicalVolume(vgName)
def getVg(self, vgName):
# Get specific VG
@@ -1319,6 +1338,20 @@
return getLV(vg, lv).devices.strip(" )").split("(")
+def getVgMetadataPv(vgName):
+ pvs = _lvminfo.getVgPvs(vgName)
+ for pv in pvs:
+ try:
+ if _isMetadataPv(pv):
+ return pv
+ except AttributeError:
+ pass
+
+ raise se.CannotGetVGMetadataPV(vgName)
+
+def _isMetadataPv(pv):
+ return pv.mda_used_count == '2'
+
def listPVNames(vgName):
try:
pvNames = _lvminfo._vgs[vgName].pv_name
--
To view, visit https://gerrit.ovirt.org/64433
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a7763d2ab7d796be633ecd69f661cba96e29dde
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <laravot(a)redhat.com>
7 years, 9 months
Change in vdsm[master]: hostdev: report device MMIO numa node
by Martin Polednik
Martin Polednik has posted comments on this change.
Change subject: hostdev: report device MMIO numa node
......................................................................
Patch Set 15: Verified+1
--
To view, visit https://gerrit.ovirt.org/60637
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2995b68465caa52f6c721ed5af7d537748fa647a
Gerrit-PatchSet: 15
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 9 months
Change in vdsm[master]: hostdev: expose numa_node in host device
by Martin Polednik
Martin Polednik has posted comments on this change.
Change subject: hostdev: expose numa_node in host device
......................................................................
Patch Set 15: Verified+1
--
To view, visit https://gerrit.ovirt.org/60638
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4584b99dfbff8b2e61f4f73ad58e3b67bf0c55ce
Gerrit-PatchSet: 15
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 9 months
Change in vdsm[master]: hostdev: prefer numa nodes close to device MMIO
by Martin Polednik
Martin Polednik has posted comments on this change.
Change subject: hostdev: prefer numa nodes close to device MMIO
......................................................................
Patch Set 17: Verified+1
jenkins false negative on networking tests
--
To view, visit https://gerrit.ovirt.org/60640
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9bc795d2f5bad76ebf1e1bff391b3bc71037fffb
Gerrit-PatchSet: 17
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 9 months
Change in vdsm[ovirt-4.0]: net: Consume ifcfg files that have a non vdsm standard name
by edwardh@redhat.com
Edward Haas has uploaded a new change for review.
Change subject: net: Consume ifcfg files that have a non vdsm standard name
......................................................................
net: Consume ifcfg files that have a non vdsm standard name
VDSM assumes that the ifcfg files which represent network devices are
named in the following format: ifcfg-<dev name>
If the host is set initially by Network Manager, the names of the files
do no correspond to the expected format.
This patch adjusts the ifcfg file name to the mentioned format and
erases any other ifcfg files that correspond to the same device.
This is not a NM friendly patch, it assumes that NM is not active while
setupNetworks is issued.
Change-Id: I0bf70ba936d5de1f17a90742644719216018f674
Signed-off-by: Edward Haas <edwardh(a)redhat.com>
---
M lib/vdsm/network/configurators/ifcfg.py
M tests/network/func_net_basic_test.py
2 files changed, 70 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/64096/1
diff --git a/lib/vdsm/network/configurators/ifcfg.py b/lib/vdsm/network/configurators/ifcfg.py
index 33d2aae..6d1bfd6 100644
--- a/lib/vdsm/network/configurators/ifcfg.py
+++ b/lib/vdsm/network/configurators/ifcfg.py
@@ -106,6 +106,8 @@
self.runningConfig = None
def configureBridge(self, bridge, **opts):
+ if not self.owned_device(bridge.name):
+ self.normalize_device_filename(bridge.name)
self.configApplier.addBridge(bridge, **opts)
ifdown(bridge.name)
if bridge.port:
@@ -114,12 +116,16 @@
_ifup(bridge)
def configureVlan(self, vlan, **opts):
+ if not self.owned_device(vlan.name):
+ self.normalize_device_filename(vlan.name)
self.configApplier.addVlan(vlan, **opts)
vlan.device.configure(**opts)
self._addSourceRoute(vlan)
_ifup(vlan)
def configureBond(self, bond, **opts):
+ if not self.owned_device(bond.name):
+ self.normalize_device_filename(bond.name)
self.configApplier.addBonding(bond, **opts)
if not vlans.is_vlanned(bond.name):
for slave in bond.slaves:
@@ -143,6 +149,9 @@
nicsToSet = frozenset(nic.name for nic in bond.slaves)
currentNics = frozenset(_netinfo.getNicsForBonding(bond.name))
nicsToAdd = nicsToSet - currentNics
+
+ if not self.owned_device(bond.name):
+ self.normalize_device_filename(bond.name)
# Create bond configuration in case it was a non ifcfg controlled bond.
# Needed to be before slave configuration for initscripts to add slave
@@ -181,6 +190,8 @@
'switch': 'legacy'})
def configureNic(self, nic, **opts):
+ if not self.owned_device(nic.name):
+ self.normalize_device_filename(nic.name)
self.configApplier.addNic(nic, **opts)
self._addSourceRoute(nic)
if nic.bond is None:
@@ -189,6 +200,8 @@
_ifup(nic)
def removeBridge(self, bridge):
+ if not self.owned_device(bridge.name):
+ self.normalize_device_filename(bridge.name)
DynamicSourceRoute.addInterfaceTracking(bridge)
ifdown(bridge.name)
self._removeSourceRoute(bridge, StaticSourceRoute)
@@ -198,6 +211,8 @@
bridge.port.remove()
def removeVlan(self, vlan):
+ if not self.owned_device(vlan.name):
+ self.normalize_device_filename(vlan.name)
DynamicSourceRoute.addInterfaceTracking(vlan)
ifdown(vlan.name)
self._removeSourceRoute(vlan, StaticSourceRoute)
@@ -219,6 +234,8 @@
DynamicSourceRoute.addInterfaceTracking(netEnt)
def removeBond(self, bonding):
+ if not self.owned_device(bonding.name):
+ self.normalize_device_filename(bonding.name)
to_be_removed = self._ifaceDownAndCleanup(bonding)
if to_be_removed:
self.configApplier.removeBonding(bonding.name)
@@ -243,6 +260,8 @@
ipwrapper.linkSet(bonding.name, ['mtu', str(set_mtu)])
def removeNic(self, nic, remove_even_if_used=False):
+ if not self.owned_device(nic.name):
+ self.normalize_device_filename(nic.name)
to_be_removed = self._ifaceDownAndCleanup(nic, remove_even_if_used)
if to_be_removed:
self.configApplier.removeNic(nic.name)
@@ -295,6 +314,33 @@
else:
return content.startswith(CONFFILE_HEADER_SIGNATURE)
+ @staticmethod
+ def normalize_device_filename(device):
+ """
+ Attempts to detect a device ifcfg file and rename it to a vdsm
+ supported format.
+ In case of multiple ifcfg files that treat the same device, all except
+ the first are deleted.
+ """
+ device_files = []
+ paths = glob.iglob(NET_CONF_PREF + '*')
+ for ifcfg_file in paths:
+ with open(ifcfg_file) as f:
+ for line in f:
+ if line.startswith('#'):
+ continue
+ key, value = line.rstrip().split('=', 1)
+ if value and value[0] == '\"' and value[-1] == '\"':
+ value = value[1:-1]
+ if key.upper() == 'DEVICE':
+ if value == device:
+ device_files.append(ifcfg_file)
+ break
+ if device_files:
+ os.rename(device_files[0], NET_CONF_PREF + device)
+ for filepath in device_files[1:]:
+ utils.rmFile(filepath)
+
class ConfigWriter(object):
CONFFILE_HEADER = (CONFFILE_HEADER_SIGNATURE + ' ' +
diff --git a/tests/network/func_net_basic_test.py b/tests/network/func_net_basic_test.py
index f937202..213187a 100644
--- a/tests/network/func_net_basic_test.py
+++ b/tests/network/func_net_basic_test.py
@@ -20,6 +20,8 @@
from __future__ import absolute_import
+import os
+
from nose.plugins.attrib import attr
from .netfunctestlib import NetFuncTestCase, NOCHK
@@ -70,6 +72,28 @@
__test__ = True
switch = 'legacy'
+ def test_add_net_based_on_device_with_non_standard_ifcfg_file(self):
+ with dummy_device() as nic:
+ NETCREATE = {NETWORK_NAME: {'nic': nic, 'switch': self.switch}}
+ NETREMOVE = {NETWORK_NAME: {'remove': True}}
+ with self.setupNetworks(NETCREATE, {}, NOCHK):
+ self.setupNetworks(NETREMOVE, {}, NOCHK)
+ self.assertNoNetwork(NETWORK_NAME)
+
+ NET_CONF_DIR = '/etc/sysconfig/network-scripts/'
+ NET_CONF_PREF = NET_CONF_DIR + 'ifcfg-'
+
+ nic_ifcfg_file = NET_CONF_PREF + nic
+ self.assertTrue(os.path.exists(nic_ifcfg_file))
+ nic_ifcfg_badname_file = nic_ifcfg_file + 'tail123'
+ os.rename(nic_ifcfg_file, nic_ifcfg_badname_file)
+
+ # Up until now, we have set the test setup, now start the test.
+ with self.setupNetworks(NETCREATE, {}, NOCHK):
+ self.assertNetwork(NETWORK_NAME, NETCREATE[NETWORK_NAME])
+ self.assertTrue(os.path.exists(nic_ifcfg_file))
+ self.assertFalse(os.path.exists(nic_ifcfg_badname_file))
+
@attr(type='functional', switch='ovs')
class NetworkBasicOvsTest(NetworkBasicTemplate):
--
To view, visit https://gerrit.ovirt.org/64096
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bf70ba936d5de1f17a90742644719216018f674
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Edward Haas <edwardh(a)redhat.com>
7 years, 9 months