~smoser/ubuntu/zesty/curtin/pkg

« back to all changes in this revision

Viewing changes to tests/vmtests/test_mdadm_bcache.py

  • Committer: Scott Moser
  • Date: 2016-02-12 22:07:36 UTC
  • mfrom: (1.1.33)
  • Revision ID: smoser@ubuntu.com-20160212220736-9xdkp6t1t8501fh0
Tags: 0.1.0~bzr351-0ubuntu1
releasing package curtin version 0.1.0~bzr351-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from . import VMBaseClass
2
 
from unittest import TestCase
 
2
from .releases import base_vm_classes as relbase
3
3
 
4
4
import textwrap
5
5
import os
6
6
 
7
7
 
8
 
class TestMdadmAbs(VMBaseClass, TestCase):
9
 
    __test__ = False
10
 
    repo = "maas-daily"
11
 
    arch = "amd64"
 
8
class TestMdadmAbs(VMBaseClass):
12
9
    install_timeout = 600
13
10
    boot_timeout = 100
14
11
    interactive = False
77
74
        bcache_cset_uuid = None
78
75
        found = {}
79
76
        for bcache_super in bcache_supers:
80
 
            with open(os.path.join(self.td.mnt, bcache_super), "r") as fp:
 
77
            with open(os.path.join(self.td.collect, bcache_super), "r") as fp:
81
78
                for line in fp.read().splitlines():
82
79
                    if line != "" and line.split()[0] == "cset.uuid":
83
80
                        bcache_cset_uuid = line.split()[-1].rstrip()
86
83
                        else:
87
84
                            found[bcache_cset_uuid] = [bcache_super]
88
85
            self.assertIsNotNone(bcache_cset_uuid)
89
 
            with open(os.path.join(self.td.mnt, "bcache_ls"), "r") as fp:
 
86
            with open(os.path.join(self.td.collect, "bcache_ls"), "r") as fp:
90
87
                self.assertTrue(bcache_cset_uuid in fp.read().splitlines())
91
88
 
92
89
        # one cset.uuid for all devices
103
100
        self.check_file_regex("bcache_cache_mode", r"\[writeback\]")
104
101
 
105
102
 
106
 
class WilyTestMdadmBcache(TestMdadmBcacheAbs):
107
 
    __test__ = True
108
 
    release = "wily"
109
 
 
110
 
 
111
 
class VividTestMdadmBcache(TestMdadmBcacheAbs):
112
 
    __test__ = True
113
 
    release = "vivid"
 
103
class VividTestMdadmBcache(relbase.vivid, TestMdadmBcacheAbs):
 
104
    __test__ = True
 
105
 
 
106
 
 
107
class WilyTestMdadmBcache(relbase.wily, TestMdadmBcacheAbs):
 
108
    __test__ = True
114
109
 
115
110
 
116
111
class TestMirrorbootAbs(TestMdadmAbs):
124
119
                     'md0': 0}
125
120
 
126
121
 
127
 
class WilyTestMirrorboot(TestMirrorbootAbs):
128
 
    __test__ = True
129
 
    release = "wily"
130
 
 
131
 
 
132
 
class VividTestMirrorboot(TestMirrorbootAbs):
133
 
    __test__ = True
134
 
    release = "vivid"
 
122
class VividTestMirrorboot(relbase.vivid, TestMirrorbootAbs):
 
123
    __test__ = True
 
124
 
 
125
 
 
126
class WilyTestMirrorboot(relbase.wily, TestMirrorbootAbs):
 
127
    __test__ = True
135
128
 
136
129
 
137
130
class TestRaid5bootAbs(TestMdadmAbs):
146
139
                     'md0': 0}
147
140
 
148
141
 
149
 
class WilyTestRaid5boot(TestRaid5bootAbs):
150
 
    __test__ = True
151
 
    release = "wily"
152
 
 
153
 
 
154
 
class VividTestRaid5boot(TestRaid5bootAbs):
155
 
    __test__ = True
156
 
    release = "vivid"
 
142
class VividTestRaid5boot(relbase.vivid, TestRaid5bootAbs):
 
143
    __test__ = True
 
144
 
 
145
 
 
146
class WilyTestRaid5boot(relbase.wily, TestRaid5bootAbs):
 
147
    __test__ = True
157
148
 
158
149
 
159
150
class TestRaid6bootAbs(TestMdadmAbs):
181
172
        self.check_file_regex("mdadm_detail", r"ubuntu:foobar")
182
173
 
183
174
 
184
 
class WilyTestRaid6boot(TestRaid6bootAbs):
185
 
    __test__ = True
186
 
    release = "wily"
187
 
 
188
 
 
189
 
class VividTestRaid6boot(TestRaid6bootAbs):
190
 
    __test__ = True
191
 
    release = "vivid"
 
175
class VividTestRaid6boot(relbase.vivid, TestRaid6bootAbs):
 
176
    __test__ = True
 
177
 
 
178
 
 
179
class WilyTestRaid6boot(relbase.wily, TestRaid6bootAbs):
 
180
    __test__ = True
192
181
 
193
182
 
194
183
class TestRaid10bootAbs(TestMdadmAbs):
204
193
                     'md0': 0}
205
194
 
206
195
 
207
 
class WilyTestRaid10boot(TestRaid10bootAbs):
208
 
    __test__ = True
209
 
    release = "wily"
210
 
 
211
 
 
212
 
class VividTestRaid10boot(TestRaid10bootAbs):
213
 
    __test__ = True
214
 
    release = "vivid"
 
196
class VividTestRaid10boot(relbase.vivid, TestRaid10bootAbs):
 
197
    __test__ = True
 
198
 
 
199
 
 
200
class WilyTestRaid10boot(relbase.wily, TestRaid10bootAbs):
 
201
    __test__ = True
215
202
 
216
203
 
217
204
class TestAllindataAbs(TestMdadmAbs):
285
272
        self.check_file_regex("xfs_info", r"^meta-data=/dev/mapper/dmcrypt0")
286
273
 
287
274
 
288
 
class WilyTestAllindata(TestAllindataAbs):
289
 
    __test__ = True
290
 
    release = "wily"
291
 
 
292
 
 
293
 
class VividTestAllindata(TestAllindataAbs):
294
 
    __test__ = True
295
 
    release = "vivid"
 
275
class VividTestAllindata(relbase.vivid, TestAllindataAbs):
 
276
    __test__ = True
 
277
 
 
278
 
 
279
class WilyTestAllindata(relbase.wily, TestAllindataAbs):
 
280
    __test__ = True