7050702 slim_install_unit test failure after 7031613 is put back.
--- a/usr/src/cmd/system-config/profile/ip_address.py Fri Jun 03 12:11:47 2011 -0700
+++ b/usr/src/cmd/system-config/profile/ip_address.py Tue Jun 07 09:09:48 2011 +0200
@@ -29,7 +29,6 @@
import re
-
class IPAddress(object):
'''Simple class to represent IP addresses
@@ -129,9 +128,12 @@
def incremental_check(address):
'''Incrementally check an IP Address. Useful for checking a partial
address, e.g., one that is partly typed into the UI
-
+ Returns a list of valid segments parsed
+ Raises ValueError if invalid
'''
- if address[0] == '.':
+ if not address:
+ return []
+ if address.startswith('.'):
raise ValueError("An IP address may not begin with a period.")
if address.endswith(".."):
raise ValueError("Periods must be separated by numbers.")
--- a/usr/src/cmd/system-config/profile/test/test_ip_address.py Fri Jun 03 12:11:47 2011 -0700
+++ b/usr/src/cmd/system-config/profile/test/test_ip_address.py Tue Jun 07 09:09:48 2011 +0200
@@ -178,3 +178,7 @@
# Not using 'assertRaises' as we need to examine the ValueError
self.assertEquals("Values should be between 0 and 255",
err.args[0])
+
+
+if __name__ == '__main__':
+ unittest.main()
--- a/usr/src/cmd/system-config/profile/test/test_network_info.py Fri Jun 03 12:11:47 2011 -0700
+++ b/usr/src/cmd/system-config/profile/test/test_network_info.py Tue Jun 07 09:09:48 2011 +0200
@@ -94,10 +94,6 @@
net_phys = svc
elif svc.get("name") == "network/install":
net_install = svc
- elif svc.get("name") == "network/dns/install":
- net_dns_install = svc
- elif svc.get("name") == "network/dns/client":
- net_dns_client = svc
else:
self.fail("Unexpected service found: %s" %
etree.tostring(svc, pretty_print=True))
@@ -112,8 +108,7 @@
"install_ipv6_interface"):
self.fail("Unexpected property group of network/dns/install: "
"%s" % etree.tostring(prop_group, pretty_print=True))
-
- for prop_group in net_dns_install.iterchildren().next():
- if prop_group.get("name") != "install_props":
- self.fail("Unexpected property group of network/dns/install: "
- "%s" % etree.tostring(prop_group, pretty_print=True))
+
+
+if __name__ == '__main__':
+ unittest.main()