Commit bc7dda1e authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Merge branch 'stable-2.10' into stable-2.11



* stable-2.10
  (no changes)

* stable-2.9
  Move the design for query splitting to the implemented list
  Add tests for DRBD setups with empty first resource

* stable-2.8
  DRBD parser: consume initial empty resource lines

Conflicts:
	doc/design-draft.rst: trivial
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parents 343309cb 9b91bd4f
......@@ -1405,6 +1405,7 @@ TEST_FILES = \
test/data/proc_drbd83_sync_want.txt \
test/data/proc_drbd83_sync_krnl2.6.39.txt \
test/data/proc_drbd84.txt \
test/data/proc_drbd84_emptyfirst.txt \
test/data/proc_drbd84_sync.txt \
test/data/proc_meminfo.txt \
test/data/proc_cpuinfo.txt \
......
......@@ -11,7 +11,8 @@ Design document drafts
design-http-server.rst
design-impexp2.rst
design-resource-model.rst
design-query-splitting.rst
design-storagetypes.rst
design-internal-shutdown.rst
design-glusterfs-ganeti-support.rst
design-hugepages-support.rst
design-optables.rst
......
......@@ -118,6 +118,7 @@ Draft designs
design-partitioned
design-performance-tests.rst
design-query2.rst
design-query-splitting.rst
design-reason-trail.rst
design-restricted-commands.rst
design-shared-storage.rst
......
......@@ -114,6 +114,7 @@ versionInfoParser = do
-- | The parser for a (multi-line) string representing a device.
deviceParser :: [DrbdInstMinor] -> Parser DeviceInfo
deviceParser instMinor = do
_ <- additionalEOL
deviceNum <- skipSpaces *> A.decimal <* A.char ':'
cs <- skipSpacesAndString "cs:" connStateParser
if cs == Unconfigured
......
version: 8.4.2 (api:1/proto:86-101)
GIT-hash: 7ad5f850d711223713d6dcadc3dd48860321070c build by root@example.com, 2013-04-10 07:45:25
1: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----
ns:0 nr:1048576 dw:1048576 dr:0 al:0 bm:64 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
2: cs:Unconfigured
4: cs:WFConnection ro:Primary/Unknown ds:UpToDate/DUnknown C r-----
ns:0 nr:0 dw:0 dr:200 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:1048320
6: cs:Connected ro:Secondary/Primary ds:Diskless/UpToDate C r-----
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0
8: cs:StandAlone ro:Secondary/Unknown ds:UpToDate/DUnknown r-----
ns:0 nr:0 dw:0 dr:200 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:1048320
......@@ -163,6 +163,49 @@ case_drbd84 = testParser (drbdStatusParser []) "proc_drbd84.txt" $
Nothing
]
-- | Test a DRBD 8.4 file with the first resource empty.
case_drbd84_emptyfirst :: Assertion
case_drbd84_emptyfirst = testParser (drbdStatusParser [])
"proc_drbd84_emptyfirst.txt" $ DRBDStatus
( VersionInfo (Just "8.4.2") (Just "1") (Just "86-101") Nothing
(Just "7ad5f850d711223713d6dcadc3dd48860321070c")
(Just "root@example.com, 2013-04-10 07:45:25")
)
[ DeviceInfo 1 Connected (LocalRemote Secondary Primary)
(LocalRemote UpToDate UpToDate) 'C' "r-----"
(PerfIndicators 0 1048576 1048576 0 0 64 0 0 0 0 (Just 1)
(Just 'f') (Just 0))
Nothing
Nothing
Nothing
Nothing,
UnconfiguredDevice 2,
DeviceInfo 4 WFConnection (LocalRemote Primary Unknown)
(LocalRemote UpToDate DUnknown) 'C' "r-----"
(PerfIndicators 0 0 0 200 0 0 0 0 0 0 (Just 1)
(Just 'f') (Just 1048320))
Nothing
Nothing
Nothing
Nothing,
DeviceInfo 6 Connected (LocalRemote Secondary Primary)
(LocalRemote Diskless UpToDate) 'C' "r-----"
(PerfIndicators 0 0 0 0 0 0 0 0 0 0 (Just 1) (Just 'b')
(Just 0))
Nothing
Nothing
Nothing
Nothing,
DeviceInfo 8 StandAlone (LocalRemote Secondary Unknown)
(LocalRemote UpToDate DUnknown) ' ' "r-----"
(PerfIndicators 0 0 0 200 0 0 0 0 0 0 (Just 1)
(Just 'f') (Just 1048320))
Nothing
Nothing
Nothing
Nothing
]
-- | Test a DRBD 8.3 file with a NULL caracter inside.
case_drbd83_sync_krnl2_6_39 :: Assertion
case_drbd83_sync_krnl2_6_39 = testParser (drbdStatusParser [])
......@@ -477,6 +520,7 @@ testSuite "Block/Drbd/Parser"
'case_drbd80_emptyversion,
'case_drbd84_sync,
'case_drbd84,
'case_drbd84_emptyfirst,
'case_drbd83_sync_krnl2_6_39,
'case_drbd83_sync,
'case_drbd83_sync_want,
......
......@@ -289,6 +289,8 @@ class TestDRBD8Status(testutils.GanetiTestCase):
testutils.TestDataFilename("proc_drbd83_sync_krnl2.6.39.txt")
proc84_data = testutils.TestDataFilename("proc_drbd84.txt")
proc84_sync_data = testutils.TestDataFilename("proc_drbd84_sync.txt")
proc84_emptyfirst_data = \
testutils.TestDataFilename("proc_drbd84_emptyfirst.txt")
self.proc80ev_data = \
testutils.TestDataFilename("proc_drbd80-emptyversion.txt")
......@@ -303,6 +305,8 @@ class TestDRBD8Status(testutils.GanetiTestCase):
self.drbd_info84 = drbd.DRBD8Info.CreateFromFile(filename=proc84_data)
self.drbd_info84_sync = \
drbd.DRBD8Info.CreateFromFile(filename=proc84_sync_data)
self.drbd_info84_emptyfirst = \
drbd.DRBD8Info.CreateFromFile(filename=proc84_emptyfirst_data)
def testIOErrors(self):
"""Test handling of errors while reading the proc file."""
......@@ -329,6 +333,7 @@ class TestDRBD8Status(testutils.GanetiTestCase):
self.failUnless(not self.drbd_info.HasMinorStatus(9))
self.failUnless(not self.drbd_info83.HasMinorStatus(9))
self.failUnless(not self.drbd_info80e.HasMinorStatus(3))
self.failUnless(not self.drbd_info84_emptyfirst.HasMinorStatus(0))
def testLineNotMatch(self):
"""Test wrong line passed to drbd_info.DRBD8Status"""
......@@ -344,7 +349,8 @@ class TestDRBD8Status(testutils.GanetiTestCase):
def testMinor1(self):
"""Test connected, secondary device"""
for info in [self.drbd_info, self.drbd_info83, self.drbd_info84]:
for info in [self.drbd_info, self.drbd_info83, self.drbd_info84,
self.drbd_info84_emptyfirst]:
stats = info.GetMinorStatus(1)
self.failUnless(stats.is_in_use)
self.failUnless(stats.is_connected and stats.is_secondary and
......@@ -353,13 +359,15 @@ class TestDRBD8Status(testutils.GanetiTestCase):
def testMinor2(self):
"""Test unconfigured device"""
for info in [self.drbd_info, self.drbd_info83,
self.drbd_info80e, self.drbd_info84]:
self.drbd_info80e, self.drbd_info84,
self.drbd_info84_emptyfirst]:
stats = info.GetMinorStatus(2)
self.failIf(stats.is_in_use)
def testMinor4(self):
"""Test WFconn device"""
for info in [self.drbd_info, self.drbd_info83, self.drbd_info84]:
for info in [self.drbd_info, self.drbd_info83,
self.drbd_info84, self.drbd_info84_emptyfirst]:
stats = info.GetMinorStatus(4)
self.failUnless(stats.is_in_use)
self.failUnless(stats.is_wfconn and stats.is_primary and
......@@ -368,7 +376,8 @@ class TestDRBD8Status(testutils.GanetiTestCase):
def testMinor6(self):
"""Test diskless device"""
for info in [self.drbd_info, self.drbd_info83, self.drbd_info84]:
for info in [self.drbd_info, self.drbd_info83,
self.drbd_info84, self.drbd_info84_emptyfirst]:
stats = info.GetMinorStatus(6)
self.failUnless(stats.is_in_use)
self.failUnless(stats.is_connected and stats.is_secondary and
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment