Revision 00ef625c test/py/ganeti.netutils_unittest.py

b/test/py/ganeti.netutils_unittest.py
502 502
    # IPv4-only, fake loopback interface
503 503
    tests = ["ip-addr-show-lo-ipv4.txt", "ip-addr-show-lo-oneline-ipv4.txt"]
504 504
    for test_file in tests:
505
      data = self._ReadTestData(test_file)
505
      data = testutils.ReadTestData(test_file)
506 506
      addr = netutils._GetIpAddressesFromIpOutput(data)
507 507
      self.failUnless(len(addr[4]) == 1 and addr[4][0] == "127.0.0.1" and not
508 508
                      addr[6])
......
510 510
    # IPv6-only, fake loopback interface
511 511
    tests = ["ip-addr-show-lo-ipv6.txt", "ip-addr-show-lo-ipv6.txt"]
512 512
    for test_file in tests:
513
      data = self._ReadTestData(test_file)
513
      data = testutils.ReadTestData(test_file)
514 514
      addr = netutils._GetIpAddressesFromIpOutput(data)
515 515
      self.failUnless(len(addr[6]) == 1 and addr[6][0] == "::1" and not addr[4])
516 516

  
517 517
    # IPv4 and IPv6, fake loopback interface
518 518
    tests = ["ip-addr-show-lo.txt", "ip-addr-show-lo-oneline.txt"]
519 519
    for test_file in tests:
520
      data = self._ReadTestData(test_file)
520
      data = testutils.ReadTestData(test_file)
521 521
      addr = netutils._GetIpAddressesFromIpOutput(data)
522 522
      self.failUnless(len(addr[6]) == 1 and addr[6][0] == "::1" and
523 523
                      len(addr[4]) == 1 and addr[4][0] == "127.0.0.1")
524 524

  
525 525
    # IPv4 and IPv6, dummy interface
526
    data = self._ReadTestData("ip-addr-show-dummy0.txt")
526
    data = testutils.ReadTestData("ip-addr-show-dummy0.txt")
527 527
    addr = netutils._GetIpAddressesFromIpOutput(data)
528 528
    self.failUnless(len(addr[6]) == 1 and
529 529
                    addr[6][0] == "2001:db8:85a3::8a2e:370:7334" and

Also available in: Unified diff