Revision 5a672c30 test/ganeti.bdev_unittest.py

b/test/ganeti.bdev_unittest.py
62 62
    """Test drbdsetup show parser creation"""
63 63
    bdev.DRBD8._GetShowParser()
64 64

  
65
  def testParserBoth80(self):
66
    """Test drbdsetup show parser for disk and network"""
67
    data = self._ReadTestData("bdev-both.txt")
65
  def testParser80(self):
66
    """Test drbdsetup show parser for disk and network version 8.0"""
67
    data = self._ReadTestData("bdev-drbd-8.0.txt")
68 68
    result = bdev.DRBD8._GetDevInfo(data)
69 69
    self.failUnless(self._has_disk(result, "/dev/xenvg/test.data",
70 70
                                   "/dev/xenvg/test.meta"),
......
73 73
                                  ("192.168.1.2", 11000)),
74 74
                    "Wrong network info (8.0.x)")
75 75

  
76
  def testParserBoth83(self):
77
    """Test drbdsetup show parser for disk and network"""
78
    data = self._ReadTestData("bdev-8.3-both.txt")
76
  def testParser83(self):
77
    """Test drbdsetup show parser for disk and network version 8.3"""
78
    data = self._ReadTestData("bdev-drbd-8.3.txt")
79 79
    result = bdev.DRBD8._GetDevInfo(data)
80 80
    self.failUnless(self._has_disk(result, "/dev/xenvg/test.data",
81 81
                                   "/dev/xenvg/test.meta"),
82 82
                    "Wrong local disk info")
83 83
    self.failUnless(self._has_net(result, ("192.168.1.1", 11000),
84 84
                                  ("192.168.1.2", 11000)),
85
                    "Wrong network info (8.2.x)")
85
                    "Wrong network info (8.0.x)")
86 86

  
87
  def testParserNet(self):
88
    """Test drbdsetup show parser for disk and network"""
89
    data = self._ReadTestData("bdev-net.txt")
87
  def testParserNetIP4(self):
88
    """Test drbdsetup show parser for IPv4 network"""
89
    data = self._ReadTestData("bdev-drbd-net-ip4.txt")
90 90
    result = bdev.DRBD8._GetDevInfo(data)
91 91
    self.failUnless(("local_dev" not in result and
92 92
                     "meta_dev" not in result and
......
94 94
                    "Should not find local disk info")
95 95
    self.failUnless(self._has_net(result, ("192.168.1.1", 11002),
96 96
                                  ("192.168.1.2", 11002)),
97
                    "Wrong network info")
97
                    "Wrong network info (IPv4)")
98

  
99
  def testParserNetIP6(self):
100
    """Test drbdsetup show parser for IPv6 network"""
101
    data = self._ReadTestData("bdev-drbd-net-ip6.txt")
102
    result = bdev.DRBD8._GetDevInfo(data)
103
    self.failUnless(("local_dev" not in result and
104
                     "meta_dev" not in result and
105
                     "meta_index" not in result),
106
                    "Should not find local disk info")
107
    self.failUnless(self._has_net(result, ("2001:db8:65::1", 11048),
108
                                  ("2001:db8:66::1", 11048)),
109
                    "Wrong network info (IPv6)")
98 110

  
99 111
  def testParserDisk(self):
100
    """Test drbdsetup show parser for disk and network"""
101
    data = self._ReadTestData("bdev-disk.txt")
112
    """Test drbdsetup show parser for disk"""
113
    data = self._ReadTestData("bdev-drbd-disk.txt")
102 114
    result = bdev.DRBD8._GetDevInfo(data)
103 115
    self.failUnless(self._has_disk(result, "/dev/xenvg/test.data",
104 116
                                   "/dev/xenvg/test.meta"),

Also available in: Unified diff