FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 07-26-2011, 11:33 AM
Ales Kozumplik
 
Default Fix broken unit tests (cmdline, network).

---
pyanaconda/cmdline.py | 19 ++++++++++---------
tests/pyanaconda_test/network_test.py | 32 ++++++++++----------------------
2 files changed, 20 insertions(+), 31 deletions(-)

diff --git a/pyanaconda/cmdline.py b/pyanaconda/cmdline.py
index 5b3e7a2..f45ea93 100644
--- a/pyanaconda/cmdline.py
+++ b/pyanaconda/cmdline.py
@@ -34,6 +34,16 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
import logging
log = logging.getLogger("anaconda")

+
+def setupProgressDisplay(anaconda):
+ if anaconda.dir == DISPATCH_BACK:
+ anaconda.intf.setInstallProgressClass(None)
+ return DISPATCH_BACK
+ else:
+ anaconda.intf.setInstallProgressClass(progressDisp lay())
+
+ return DISPATCH_FORWARD
+
stepToClasses = { "install" : setupProgressDisplay }

class WaitWindow:
@@ -200,12 +210,3 @@ class progressDisplay:
if stripped != self.display:
self.display = stripped
print(self.display)
-
-def setupProgressDisplay(anaconda):
- if anaconda.dir == DISPATCH_BACK:
- anaconda.intf.setInstallProgressClass(None)
- return DISPATCH_BACK
- else:
- anaconda.intf.setInstallProgressClass(progressDisp lay())
-
- return DISPATCH_FORWARD
diff --git a/tests/pyanaconda_test/network_test.py b/tests/pyanaconda_test/network_test.py
index 6a0b324..1b867e0 100644
--- a/tests/pyanaconda_test/network_test.py
+++ b/tests/pyanaconda_test/network_test.py
@@ -38,8 +38,6 @@ class NetworkTest(mock.TestCase):

# Network mock
pyanaconda.network.Network.update = mock.Mock()
- self.controlWireless_backup = pyanaconda.network.Network.controlWireless
- pyanaconda.network.Network.controlWireless = mock.Mock()
self.setNMControlledDevices_backup = pyanaconda.network.Network.setNMControlledDevices
pyanaconda.network.Network.setNMControlledDevices = mock.Mock()
pyanaconda.network.Network.netdevices = {}
@@ -434,26 +432,16 @@ class NetworkTest(mock.TestCase):
ret = nw.getOnbootControlledIfaces()
self.assertEqual(ret, ['dev'])

- def network_update_ifcfg_ssid_test(self):
+ def network_writeSSIDifcfgs_test(self):
import pyanaconda.network
nw = pyanaconda.network.Network()
nw.netdevices = {'dev': mock.Mock()}
- ret = nw.updateIfcfgsSSID({'dev': ['net_essid']})
- self.assertEqual(nw.netdevices['dev'].method_calls[0],
- ('set', (('ESSID', 'net_essid'),), {}))
- self.assertEqual(nw.netdevices['dev'].method_calls[1],
- ('writeIfcfgFile', (), {}))
-
- def network_control_wireless_test(self):
- import pyanaconda.network
- pyanaconda.network.isys = mock.Mock()
- pyanaconda.network.isys.isWirelessDevice.return_va lue = True
- nw = pyanaconda.network.Network()
- pyanaconda.network.Network.controlWireless = self.controlWireless_backup
- nw.netdevices['dev'] = mock.Mock()
- nw.controlWireless()
- self.assertEqual(nw.netdevices['dev'].method_calls,
- [('set', (('NM_CONTROLLED', 'yes'),), {})])
+ ret = nw.writeSSIDifcfgs({'dev': ['net_essid']})
+ self.assertEqual(self.fs['/tmp/etc/sysconfig/network-scripts/ifcfg-net_essid'],
+ "NAME=net_essid
"
+ "TYPE=Wireless
"
+ "ESSID=net_essid
"
+ "NM_CONTROLLED=yes
")

def network_write_ks_test(self):
import pyanaconda.network
@@ -509,6 +497,8 @@ class NetworkTest(mock.TestCase):
def network_copy_config_to_path_test(self):
import pyanaconda.network
pyanaconda.network.Network._copyFileToPath = mock.Mock()
+ pyanaconda.network.Network._copyIfcfgFiles = mock.Mock()
+

nw = pyanaconda.network.Network()
nw.netdevices['dev'] = mock.Mock()
@@ -516,9 +506,7 @@ class NetworkTest(mock.TestCase):
nw.netdevices['dev'].keyfilePath = self.DEV_KEY_FILE
ret = nw.copyConfigToPath(')
self.assertEqual(pyanaconda.network.Network._copyF ileToPath.call_args_list,
- [(('/tmp/etc/sysconfig/network-scripts/ifcfg-eth0', '), {}),
- (('/tmp/etc/sysconfig/network-scripts/keys-eth0', '), {}),
- (('/etc/dhcp/dhclient-dev.conf', '), {}),
+ [(('/etc/dhcp/dhclient-dev.conf', '), {}),
(('/tmp/etc/sysconfig/network', '), {'overwrite': 0}),
(('/etc/resolv.conf', '), {'overwrite': 0}),
(('/etc/udev/rules.d/70-persistent-net.rules', '), {'overwrite': 0})]
--
1.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

Tue Jul 26 15:30:02 2011
Return-path: <devel-bounces@lists.fedoraproject.org>
Envelope-to: tom@linux-archive.org
Delivery-date: Tue, 26 Jul 2011 14:40:04 +0300
Received: from bastion02.fedoraproject.org ([209.132.181.3]:40805 helo=bastion.fedoraproject.org)
by s2.java-tips.org with esmtp (Exim 4.69)
(envelope-from <devel-bounces@lists.fedoraproject.org>)
id 1QlfzY-0005Jh-D5
for tom@linux-archive.org; Tue, 26 Jul 2011 14:40:04 +0300
Received: from lists.fedoraproject.org (collab1.vpn.fedoraproject.org [192.168.1.21])
by bastion02.phx2.fedoraproject.org (Postfix) with ESMTP id F01BD1105DF;
Tue, 26 Jul 2011 11:42:28 +0000 (UTC)
Received: from collab1.fedoraproject.org (localhost.localdomain [127.0.0.1])
by lists.fedoraproject.org (Postfix) with ESMTP id 4F29832679C;
Tue, 26 Jul 2011 11:42:28 +0000 (UTC)
X-Original-To: devel@lists.fedoraproject.org
Delivered-To: devel@lists.fedoraproject.org
Received: from smtp-mm03.fedoraproject.org (vm4.fedora.ibiblio.org
[152.19.134.143])
by lists.fedoraproject.org (Postfix) with ESMTP id CFF6E326792
for <devel@lists.fedoraproject.org>;
Tue, 26 Jul 2011 11:28:05 +0000 (UTC)
Received: from mx1.es6.egwn.net (mx32b01.es6.egwn.net [195.10.6.123])
by smtp-mm03.fedoraproject.org (Postfix) with ESMTP id 6973B37D3F
for <devel@lists.fedoraproject.org>;
Tue, 26 Jul 2011 11:28:05 +0000 (UTC)
Received: from mx2.es6.egwn.net (server09.es6.egwn.net [195.10.6.27])
by mx1.es6.egwn.net (Postfix) with ESMTP id 925E4681E8
for <devel@lists.fedoraproject.org>;
Tue, 26 Jul 2011 13:28:03 +0200 (CEST)
Received: from python3.es.aed.lan (o.es6.aedgency.net [195.10.38.57])
by mx2.es6.egwn.net (new spiffy mail daemon) with ESMTP id 7E2C41A4009
for <devel@lists.fedoraproject.org>;
Tue, 26 Jul 2011 13:28:03 +0200 (CEST)
Date: Tue, 26 Jul 2011 13:28:02 +0200
From: Matthias Saou
<thias@spam.spam.spam.spam.spam.spam.spam.egg.and. spam.freshrpms.net>
To: devel@lists.fedoraproject.org
Subject: Re: Systemd transition prevents updating older release branches??
Message-ID: <20110726132802.00ce6580@python3.es.aed.lan>
In-Reply-To: <20110725214815.GD2781@unaka.lan>
References: <13233.1311620845@sss.pgh.pa.us> <20110725214815.GD2781@unaka.lan>
X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; x86_64-redhat-linux-gnu)
Mime-Version: 1.0
X-BeenThere: devel@lists.fedoraproject.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: Development discussions related to Fedora
<devel@lists.fedoraproject.org>
List-Id: Development discussions related to Fedora
<devel.lists.fedoraproject.org>
List-Unsubscribe: <https://admin.fedoraproject.org/mailman/listinfo/devel>,
<mailto:devel-request@lists.fedoraproject.org?subject=unsubscrib e>
List-Archive: <http://lists.fedoraproject.org/pipermail/devel>
List-Post: <mailto:devel@lists.fedoraproject.org>
List-Help: <mailto:devel-request@lists.fedoraproject.org?subject=help>
List-Subscribe: <https://admin.fedoraproject.org/mailman/listinfo/devel>,
<mailto:devel-request@lists.fedoraproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: devel-bounces@lists.fedoraproject.org
Errors-To: devel-bounces@lists.fedoraproject.org

Toshio Kuratomi wrote :

> Regarding the fragility argument in reply to notting's clarification; do
> note that the fragility there only lasts until that Fedora release goes EOL
> and therefore can no longer receive updates) less than a year now for Fedora
> 15. The fragility of packagers remembering that the package has an epoch
> seems lower on a case-by-case basis but its effect lasts for as long as we
> ship that package.

The fragility you mention will resurface when RHEL7 is released then
stay around for many many years for anyone maintaining EPEL6 and EPEL7
packages. Definitely something worth keeping in mind.

Matthias

--
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Fedora release 14 (Laughlin) - Linux kernel 2.6.35.13-91.fc14.x86_64
Load : 0.23 0.29 0.40
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 07-26-2011, 12:25 PM
Radek Vykydal
 
Default Fix broken unit tests (cmdline, network).

Ack.

On 07/26/2011 01:33 PM, Ales Kozumplik wrote:

---
pyanaconda/cmdline.py | 19 ++++++++++---------
tests/pyanaconda_test/network_test.py | 32 ++++++++++----------------------
2 files changed, 20 insertions(+), 31 deletions(-)

diff --git a/pyanaconda/cmdline.py b/pyanaconda/cmdline.py
index 5b3e7a2..f45ea93 100644
--- a/pyanaconda/cmdline.py
+++ b/pyanaconda/cmdline.py
@@ -34,6 +34,16 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
import logging
log = logging.getLogger("anaconda")

+
+def setupProgressDisplay(anaconda):
+ if anaconda.dir == DISPATCH_BACK:
+ anaconda.intf.setInstallProgressClass(None)
+ return DISPATCH_BACK
+ else:
+ anaconda.intf.setInstallProgressClass(progressDisp lay())
+
+ return DISPATCH_FORWARD
+
stepToClasses = { "install" : setupProgressDisplay }

class WaitWindow:
@@ -200,12 +210,3 @@ class progressDisplay:
if stripped != self.display:
self.display = stripped
print(self.display)
-
-def setupProgressDisplay(anaconda):
- if anaconda.dir == DISPATCH_BACK:
- anaconda.intf.setInstallProgressClass(None)
- return DISPATCH_BACK
- else:
- anaconda.intf.setInstallProgressClass(progressDisp lay())
-
- return DISPATCH_FORWARD
diff --git a/tests/pyanaconda_test/network_test.py b/tests/pyanaconda_test/network_test.py
index 6a0b324..1b867e0 100644
--- a/tests/pyanaconda_test/network_test.py
+++ b/tests/pyanaconda_test/network_test.py
@@ -38,8 +38,6 @@ class NetworkTest(mock.TestCase):

# Network mock
pyanaconda.network.Network.update = mock.Mock()
- self.controlWireless_backup = pyanaconda.network.Network.controlWireless
- pyanaconda.network.Network.controlWireless = mock.Mock()
self.setNMControlledDevices_backup = pyanaconda.network.Network.setNMControlledDevices
pyanaconda.network.Network.setNMControlledDevices = mock.Mock()
pyanaconda.network.Network.netdevices = {}
@@ -434,26 +432,16 @@ class NetworkTest(mock.TestCase):
ret = nw.getOnbootControlledIfaces()
self.assertEqual(ret, ['dev'])

- def network_update_ifcfg_ssid_test(self):
+ def network_writeSSIDifcfgs_test(self):
import pyanaconda.network
nw = pyanaconda.network.Network()
nw.netdevices = {'dev': mock.Mock()}
- ret = nw.updateIfcfgsSSID({'dev': ['net_essid']})
- self.assertEqual(nw.netdevices['dev'].method_calls[0],
- ('set', (('ESSID', 'net_essid'),), {}))
- self.assertEqual(nw.netdevices['dev'].method_calls[1],
- ('writeIfcfgFile', (), {}))
-
- def network_control_wireless_test(self):
- import pyanaconda.network
- pyanaconda.network.isys = mock.Mock()
- pyanaconda.network.isys.isWirelessDevice.return_va lue = True
- nw = pyanaconda.network.Network()
- pyanaconda.network.Network.controlWireless = self.controlWireless_backup
- nw.netdevices['dev'] = mock.Mock()
- nw.controlWireless()
- self.assertEqual(nw.netdevices['dev'].method_calls,
- [('set', (('NM_CONTROLLED', 'yes'),), {})])
+ ret = nw.writeSSIDifcfgs({'dev': ['net_essid']})
+ self.assertEqual(self.fs['/tmp/etc/sysconfig/network-scripts/ifcfg-net_essid'],
+ "NAME=net_essid
"
+ "TYPE=Wireless
"
+ "ESSID=net_essid
"
+ "NM_CONTROLLED=yes
")

def network_write_ks_test(self):
import pyanaconda.network
@@ -509,6 +497,8 @@ class NetworkTest(mock.TestCase):
def network_copy_config_to_path_test(self):
import pyanaconda.network
pyanaconda.network.Network._copyFileToPath = mock.Mock()
+ pyanaconda.network.Network._copyIfcfgFiles = mock.Mock()
+

nw = pyanaconda.network.Network()
nw.netdevices['dev'] = mock.Mock()
@@ -516,9 +506,7 @@ class NetworkTest(mock.TestCase):
nw.netdevices['dev'].keyfilePath = self.DEV_KEY_FILE
ret = nw.copyConfigToPath(')
self.assertEqual(pyanaconda.network.Network._copyF ileToPath.call_args_list,
- [(('/tmp/etc/sysconfig/network-scripts/ifcfg-eth0', '), {}),
- (('/tmp/etc/sysconfig/network-scripts/keys-eth0', '), {}),
- (('/etc/dhcp/dhclient-dev.conf', '), {}),
+ [(('/etc/dhcp/dhclient-dev.conf', '), {}),
(('/tmp/etc/sysconfig/network', '), {'overwrite': 0}),
(('/etc/resolv.conf', '), {'overwrite': 0}),
(('/etc/udev/rules.d/70-persistent-net.rules', '), {'overwrite': 0})]


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-26-2011, 02:05 PM
Chris Lumens
 
Default Fix broken unit tests (cmdline, network).

> diff --git a/pyanaconda/cmdline.py b/pyanaconda/cmdline.py
> index 5b3e7a2..f45ea93 100644
> --- a/pyanaconda/cmdline.py
> +++ b/pyanaconda/cmdline.py
> @@ -34,6 +34,16 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
> import logging
> log = logging.getLogger("anaconda")
>
> +
> +def setupProgressDisplay(anaconda):
> + if anaconda.dir == DISPATCH_BACK:
> + anaconda.intf.setInstallProgressClass(None)
> + return DISPATCH_BACK
> + else:
> + anaconda.intf.setInstallProgressClass(progressDisp lay())
> +
> + return DISPATCH_FORWARD
> +
> stepToClasses = { "install" : setupProgressDisplay }
>
> class WaitWindow:
> @@ -200,12 +210,3 @@ class progressDisplay:
> if stripped != self.display:
> self.display = stripped
> print(self.display)
> -
> -def setupProgressDisplay(anaconda):
> - if anaconda.dir == DISPATCH_BACK:
> - anaconda.intf.setInstallProgressClass(None)
> - return DISPATCH_BACK
> - else:
> - anaconda.intf.setInstallProgressClass(progressDisp lay())
> -
> - return DISPATCH_FORWARD

This part fixes 725757. Reassigning it to you so you can close when you
push this.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:52 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org