Revision efa6dd08 test/hs/Test/Ganeti/Block/Drbd/Parser.hs

b/test/hs/Test/Ganeti/Block/Drbd/Parser.hs
92 92
      UnconfiguredDevice 6
93 93
    ]
94 94

  
95
-- | Test a DRBD 8.4 file with an ongoing synchronization.
96
case_drbd84_sync :: Assertion
97
case_drbd84_sync = testFile "proc_drbd84_sync.txt" $
98
  DRBDStatus
99
    ( VersionInfo (Just "8.4.2") (Just "1") (Just "86-101") Nothing
100
        (Just "7ad5f850d711223713d6dcadc3dd48860321070c")
101
        (Just "root@example.com, 2013-04-10 07:45:25")
102
    )
103
    [ DeviceInfo 0 StandAlone (LocalRemote Primary Unknown)
104
        (LocalRemote UpToDate DUnknown) ' ' "r-----"
105
        (PerfIndicators 0 0 33318 730 15 0 0 0 0 0 (Just 1)
106
          (Just 'd') (Just 1048320))
107
        Nothing
108
        Nothing
109
        Nothing
110
        Nothing,
111
      UnconfiguredDevice 3,
112
      DeviceInfo 5 SyncSource (LocalRemote Secondary Secondary)
113
        (LocalRemote UpToDate Inconsistent) 'C' "r---n-"
114
        (PerfIndicators 716992 0 0 719432 0 43 0 33 18 0 (Just 1)
115
          (Just 'f') (Just 335744))
116
        (Just $ SyncStatus 68.5 335744 1048576 KiloByte (Time 0 0 5) 64800
117
          Nothing KiloByte Second)
118
        Nothing
119
        Nothing
120
        Nothing
121
    ]
122

  
123
-- | Test a DRBD 8.4 file.
124
case_drbd84 :: Assertion
125
case_drbd84 = testFile "proc_drbd84.txt" $
126
  DRBDStatus
127
    ( VersionInfo (Just "8.4.2") (Just "1") (Just "86-101") Nothing
128
      (Just "7ad5f850d711223713d6dcadc3dd48860321070c")
129
      (Just "root@example.com, 2013-04-10 07:45:25")
130
    )
131
    [ DeviceInfo 0 Connected (LocalRemote Primary Secondary)
132
        (LocalRemote UpToDate UpToDate) 'C' "r-----"
133
        (PerfIndicators 1048576 0 0 1048776 0 64 0 0 0 0 (Just 1)
134
          (Just 'f') (Just 0))
135
        Nothing
136
        Nothing
137
        Nothing
138
        Nothing,
139
      DeviceInfo 1 Connected (LocalRemote Secondary Primary)
140
        (LocalRemote UpToDate UpToDate) 'C' "r-----"
141
        (PerfIndicators 0 1048576 1048576 0 0 64 0 0 0 0 (Just 1)
142
          (Just 'f') (Just 0))
143
        Nothing
144
        Nothing
145
        Nothing
146
        Nothing,
147
      UnconfiguredDevice 2,
148
      DeviceInfo 4 WFConnection (LocalRemote Primary Unknown)
149
        (LocalRemote UpToDate DUnknown) 'C' "r-----"
150
        (PerfIndicators 0 0 0 200 0 0 0 0 0 0 (Just 1)
151
          (Just 'f') (Just 1048320))
152
        Nothing
153
        Nothing
154
        Nothing
155
        Nothing,
156
      DeviceInfo 6 Connected (LocalRemote Secondary Primary)
157
        (LocalRemote Diskless UpToDate) 'C' "r-----"
158
        (PerfIndicators 0 0 0 0 0 0 0 0 0 0 (Just 1) (Just 'b')
159
          (Just 0))
160
        Nothing
161
        Nothing
162
        Nothing
163
        Nothing,
164
      DeviceInfo 8 StandAlone (LocalRemote Secondary Unknown)
165
        (LocalRemote UpToDate DUnknown) ' ' "r-----"
166
        (PerfIndicators 0 0 0 200 0 0 0 0 0 0 (Just 1)
167
          (Just 'f') (Just 1048320))
168
        Nothing
169
        Nothing
170
        Nothing
171
        Nothing
172
    ]
173

  
95 174
-- | Test a DRBD 8.3 file with a NULL caracter inside.
96 175
case_drbd83_sync_krnl2_6_39 :: Assertion
97 176
case_drbd83_sync_krnl2_6_39 = testFile "proc_drbd83_sync_krnl2.6.39.txt" $
......
404 483
testSuite "Block/Drbd/Parser"
405 484
          [ 'case_drbd80_emptyline,
406 485
            'case_drbd80_emptyversion,
486
            'case_drbd84_sync,
487
            'case_drbd84,
407 488
            'case_drbd83_sync_krnl2_6_39,
408 489
            'case_drbd83_sync,
409 490
            'case_drbd83_sync_want,

Also available in: Unified diff