Revision fcee765d test/ganeti.bdev_unittest.py

b/test/ganeti.bdev_unittest.py
1 1
#!/usr/bin/python
2 2
#
3 3

  
4
# Copyright (C) 2006, 2007 Google Inc.
4
# Copyright (C) 2006, 2007, 2010 Google Inc.
5 5
#
6 6
# This program is free software; you can redistribute it and/or modify
7 7
# it under the terms of the GNU General Public License as published by
......
31 31
import testutils
32 32

  
33 33

  
34
class TestBaseDRBD(testutils.GanetiTestCase):
35
  def testGetVersion(self):
36
    data = [
37
      ["version: 8.0.12 (api:76/proto:86-91)"],
38
      ["version: 8.2.7 (api:88/proto:0-100)"],
39
      ["version: 8.3.7.49 (api:188/proto:13-191)"],
40
    ]
41
    result = [
42
      {
43
      "k_major": 8,
44
      "k_minor": 0,
45
      "k_point": 12,
46
      "api": 76,
47
      "proto": 86,
48
      "proto2": "91",
49
      },
50
      {
51
      "k_major": 8,
52
      "k_minor": 2,
53
      "k_point": 7,
54
      "api": 88,
55
      "proto": 0,
56
      "proto2": "100",
57
      },
58
      {
59
      "k_major": 8,
60
      "k_minor": 3,
61
      "k_point": 7,
62
      "api": 188,
63
      "proto": 13,
64
      "proto2": "191",
65
      }
66
    ]
67
    for d,r in zip(data, result):
68
      self.assertEqual(bdev.BaseDRBD._GetVersion(d), r)
69

  
70

  
34 71
class TestDRBD8Runner(testutils.GanetiTestCase):
35 72
  """Testing case for DRBD8"""
36 73

  

Also available in: Unified diff