Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 686126 Details for
Bug 903224
network test uses ifconfig not in RHEL7
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
network patch replacing use of ifconfig with ip
network.patch (text/plain), 4.42 KB, created by
Greg Nichols
on 2013-01-23 18:28:03 UTC
(
hide
)
Description:
network patch replacing use of ifconfig with ip
Filename:
MIME Type:
Creator:
Greg Nichols
Created:
2013-01-23 18:28:03 UTC
Size:
4.42 KB
patch
obsolete
>diff --git a/tests/network/network.py b/tests/network/network.py >index 0f95e5f..0c64b50 100644 >--- a/tests/network/network.py >+++ b/tests/network/network.py >@@ -53,6 +53,9 @@ class NetworkTest(Test): > def tags(self): > return [TestTag.noninteractive, TestTag.certification] > >+ def getRequiredRPMs(self): >+ return ["ethtool"] >+ > def plan(self, planner): > tests = dict() > devices = planner.getUdevDeviceDetector().getDevices() >@@ -234,42 +237,50 @@ class NetworkTest(Test): > print "Warning: Bounce of interface %s was not tested" % self.interface > return True > >+ success = True > # shut it down > if not self.shutdownInterface(self.interface): > print "Error: could not shut down interface %s" % self.interface >- return False >+ success = False > > if not self.restartInterface(self.interface): > print "Error: could not restart interface %s" % self.interface >- return False >+ success = False > > if not self.pingTestServer(self.interface): > print "Error: could not ping test server %s " % self.getTestServer() >- return False >+ success = False > > >- return True >+ return success > > def shutdownInterface(self, interface): >+ print "Shutting down interface %s" % interface > if not os.system("ifdown %s" % interface) is 0: > print "Warning: could not shut down interface %s" % interface > >- # confirm that it really went down (or is allready down) >+ # confirm that it really went down (or is all ready down) > slept=0 > delay=15 >- while slept < delay: >- if not os.system("ifconfig %s | fgrep \"RUNNING\" -q" % interface): >+ interfaceUpCommand = Command("ip -f inet addr show %s" % interface) >+ down = False >+ while not down and slept < delay: >+ try: >+ interfaceUpCommand.getString("inet", singleLine=False) >+ print "Interface %s is up" % interface > time.sleep(1) > slept = slept + 1 >- else: >- print "Interface %s is down" % interface >- break >- if slept > delay: >+ >+ except Exception, e: >+ print "interface %s is down" % interface >+ down = True >+ >+ >+ if not down: > print "Error: Unable to shut down interface %s" % interface >- return False >- >- return True >- >+ >+ return down >+ > def restartInterface(self, interface): > print "Bringing up interface %s" % interface > returnValue = os.system("ifup %s" % self.interface) >@@ -283,14 +294,16 @@ class NetworkTest(Test): > slept=0 > wait = 3 > delay=30 >+ interfaceUpCommand = Command("ip -f inet addr show %s" % interface) > while slept < delay: >- if os.system("ifconfig %s | fgrep \"RUNNING\" -q" % interface): >- time.sleep(wait) >- slept = slept + wait >- sys.stdout.flush() >- else: >- print "Interface %s is RUNNING" % interface >- return True >+ try: >+ interfaceUpCommand.getString("inet", singleLine=False) >+ print "Interface %s is UP" % interface >+ return True >+ except Exception, e: >+ time.sleep(wait) >+ slept = slept + wait >+ sys.stdout.flush() > > return False > >@@ -732,11 +745,12 @@ class NetworkTest(Test): > Command("ethtool %s" % self.interface).echoIgnoreErrors() > print "" > try: >- ifconfig = Command("ifconfig %s" % self.interface) >- address = ifconfig.getString(regex="^.*HWaddr (?P<address>[a-fA-F0-9:]+)", regexGroup="address", singleLine=False) >+ ipLinkShow = Command("ip link show %s" % self.interface) >+ address = ipLinkShow.getString(regex="^.*link/ether (?P<address>[a-fA-F0-9:]+)", regexGroup="address", singleLine=False) > print "MAC Address: %s" % address >- except V7CommandException: >+ except V7CommandException, e: > print "Warning: could not determine MAC address" >+ print e > > > print "+-----dmesg-----+"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 903224
: 686126