Dan Kenigsberg has posted comments on this change.
Change subject: netinfo: Do not mix local time and UTC, improve tests ......................................................................
Patch Set 4: Code-Review-1
(3 comments)
minor comment about comments remain.
http://gerrit.ovirt.org/#/c/24192/4/tests/functional/networkTests.py File tests/functional/networkTests.py:
Line 1689: @permutations([['default'], ['local']]) Line 1690: @cleanupNet Line 1691: @RequireVethMod Line 1692: @ValidateRunningAsRoot Line 1693: def testDhclientLeases(self, dateFormat): You have convinced me that the test is useful: we test getDhclientIfaces(), and we want to make sure it works with both values of db-time-format. Line 1694: dhcp4 = set() Line 1695: with vethIf() as (server, client): Line 1696: with avoidAnotherDhclient(client): Line 1697:
Line 1702: Line 1703: with namedTemporaryDir(dir='/var/lib/dhclient') as tmpDir: Line 1704: confFile = os.path.join(tmpDir, 'test.conf') Line 1705: leaseFile = os.path.join(tmpDir, 'test.lease') Line 1706: pidFile = os.path.join(tmpDir, 'test.pid') In a follow-up patch, please generate pidFile within dhcp.runDhclient() - we do not tweak it or care about it. it's a dhclient implementation detail. Line 1707: Line 1708: with open(confFile, 'w') as f: Line 1709: f.write('db-time-format {0};'.format(dateFormat)) Line 1710:
http://gerrit.ovirt.org/#/c/24192/4/tests/netinfoTests.py File tests/netinfoTests.py:
Line 301: ' interface "valid";\n' Line 302: ' expire {0:%w %Y/%m/%d %H:%M:%S};\n' Line 303: '}}\n' Line 304: 'lease {{\n' # in an actual lease file, Line 305: ' interface "valid2";\n' # human-readable date follows: but to simulate an actual lease file, this comment should be inside the string. Line 306: ' expire epoch {1:.0f};\n' Line 307: # expire epoch 2117041460; # Sat Jan 31 20:04:20 2037 Line 308: '}}\n' Line 309: 'lease {{\n'