diff options
author | Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> | 2016-12-16 19:24:08 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-22 08:50:17 +0000 |
commit | f8745bb51935e8fddab5daf3c1ad460a72e890bd (patch) | |
tree | 8413b1e3d1b31c5b0e6b21b1a0cfa5791f73e527 /meta/lib/oeqa/selftest/wic.py | |
parent | 285c2ed90e8056999c40df9cce3035e92cd7f9b4 (diff) | |
download | poky-f8745bb51935e8fddab5daf3c1ad460a72e890bd.tar.gz |
selftest/wic: reorganizing test methods by functionality
Part of the test methods were rearranged to group them by
functionality and identify more easily opportunities to extend
coverage.
(From OE-Core rev: f290a2c9b946e00dbc451592691596c656d49042)
Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/wic.py')
-rw-r--r-- | meta/lib/oeqa/selftest/wic.py | 184 |
1 files changed, 92 insertions, 92 deletions
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py index d130ba2658..52b9538a68 100644 --- a/meta/lib/oeqa/selftest/wic.py +++ b/meta/lib/oeqa/selftest/wic.py | |||
@@ -71,6 +71,32 @@ class Wic(oeSelfTest): | |||
71 | """Test wic list --help""" | 71 | """Test wic list --help""" |
72 | self.assertEqual(0, runCmd('wic list --help').status) | 72 | self.assertEqual(0, runCmd('wic list --help').status) |
73 | 73 | ||
74 | @testcase(1215) | ||
75 | def test_help_overview(self): | ||
76 | """Test wic help overview""" | ||
77 | self.assertEqual(0, runCmd('wic help overview').status) | ||
78 | |||
79 | @testcase(1216) | ||
80 | def test_help_plugins(self): | ||
81 | """Test wic help plugins""" | ||
82 | self.assertEqual(0, runCmd('wic help plugins').status) | ||
83 | |||
84 | @testcase(1217) | ||
85 | def test_help_kickstart(self): | ||
86 | """Test wic help kickstart""" | ||
87 | self.assertEqual(0, runCmd('wic help kickstart').status) | ||
88 | |||
89 | @testcase(1213) | ||
90 | def test_unsupported_subcommand(self): | ||
91 | """Test unsupported subcommand""" | ||
92 | self.assertEqual(1, runCmd('wic unsupported', | ||
93 | ignore_status=True).status) | ||
94 | |||
95 | @testcase(1214) | ||
96 | def test_no_command(self): | ||
97 | """Test wic without command""" | ||
98 | self.assertEqual(1, runCmd('wic', ignore_status=True).status) | ||
99 | |||
74 | @testcase(1211) | 100 | @testcase(1211) |
75 | def test_build_image_name(self): | 101 | def test_build_image_name(self): |
76 | """Test wic create directdisk --image-name core-image-minimal""" | 102 | """Test wic create directdisk --image-name core-image-minimal""" |
@@ -78,6 +104,64 @@ class Wic(oeSelfTest): | |||
78 | self.assertEqual(0, runCmd(cmd).status) | 104 | self.assertEqual(0, runCmd(cmd).status) |
79 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 105 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) |
80 | 106 | ||
107 | @testcase(1157) | ||
108 | def test_gpt_image(self): | ||
109 | """Test creation of core-image-minimal with gpt table and UUID boot""" | ||
110 | cmd = "wic create directdisk-gpt --image-name core-image-minimal" | ||
111 | self.assertEqual(0, runCmd(cmd).status) | ||
112 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | ||
113 | |||
114 | @testcase(1346) | ||
115 | def test_iso_image(self): | ||
116 | """Test creation of hybrid iso image with legacy and EFI boot""" | ||
117 | cmd = "wic create mkhybridiso --image-name core-image-minimal" | ||
118 | self.assertEqual(0, runCmd(cmd).status) | ||
119 | self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct"))) | ||
120 | self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso"))) | ||
121 | |||
122 | @testcase(1348) | ||
123 | def test_qemux86_directdisk(self): | ||
124 | """Test creation of qemux-86-directdisk image""" | ||
125 | cmd = "wic create qemux86-directdisk -e core-image-minimal" | ||
126 | self.assertEqual(0, runCmd(cmd).status) | ||
127 | self.assertEqual(1, len(glob(self.resultdir + "qemux86-directdisk-*direct"))) | ||
128 | |||
129 | @testcase(1349) | ||
130 | def test_mkgummidisk(self): | ||
131 | """Test creation of mkgummidisk image""" | ||
132 | cmd = "wic create mkgummidisk --image-name core-image-minimal" | ||
133 | self.assertEqual(0, runCmd(cmd).status) | ||
134 | self.assertEqual(1, len(glob(self.resultdir + "mkgummidisk-*direct"))) | ||
135 | |||
136 | @testcase(1350) | ||
137 | def test_mkefidisk(self): | ||
138 | """Test creation of mkefidisk image""" | ||
139 | cmd = "wic create mkefidisk -e core-image-minimal" | ||
140 | self.assertEqual(0, runCmd(cmd).status) | ||
141 | self.assertEqual(1, len(glob(self.resultdir + "mkefidisk-*direct"))) | ||
142 | |||
143 | @testcase(1385) | ||
144 | def test_directdisk_bootloader_config(self): | ||
145 | """Test creation of directdisk-bootloader-config image""" | ||
146 | cmd = "wic create directdisk-bootloader-config -e core-image-minimal" | ||
147 | self.assertEqual(0, runCmd(cmd).status) | ||
148 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-bootloader-config-*direct"))) | ||
149 | |||
150 | @testcase(1560) | ||
151 | def test_systemd_bootdisk(self): | ||
152 | """Test creation of systemd-bootdisk image""" | ||
153 | cmd = "wic create systemd-bootdisk -e core-image-minimal" | ||
154 | self.assertEqual(0, runCmd(cmd).status) | ||
155 | self.assertEqual(1, len(glob(self.resultdir + "systemd-bootdisk-*direct"))) | ||
156 | |||
157 | @testcase(1561) | ||
158 | def test_sdimage_bootpart(self): | ||
159 | """Test creation of sdimage-bootpart image""" | ||
160 | cmd = "wic create sdimage-bootpart -e core-image-minimal" | ||
161 | self.write_config('IMAGE_BOOT_FILES = "bzImage"\n') | ||
162 | self.assertEqual(0, runCmd(cmd).status) | ||
163 | self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct"))) | ||
164 | |||
81 | @testcase(1212) | 165 | @testcase(1212) |
82 | def test_build_artifacts(self): | 166 | def test_build_artifacts(self): |
83 | """Test wic create directdisk providing all artifacts.""" | 167 | """Test wic create directdisk providing all artifacts.""" |
@@ -92,39 +176,6 @@ class Wic(oeSelfTest): | |||
92 | self.assertEqual(0, status) | 176 | self.assertEqual(0, status) |
93 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | 177 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) |
94 | 178 | ||
95 | @testcase(1157) | ||
96 | def test_gpt_image(self): | ||
97 | """Test creation of core-image-minimal with gpt table and UUID boot""" | ||
98 | cmd = "wic create directdisk-gpt --image-name core-image-minimal" | ||
99 | self.assertEqual(0, runCmd(cmd).status) | ||
100 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) | ||
101 | |||
102 | @testcase(1213) | ||
103 | def test_unsupported_subcommand(self): | ||
104 | """Test unsupported subcommand""" | ||
105 | self.assertEqual(1, runCmd('wic unsupported', | ||
106 | ignore_status=True).status) | ||
107 | |||
108 | @testcase(1214) | ||
109 | def test_no_command(self): | ||
110 | """Test wic without command""" | ||
111 | self.assertEqual(1, runCmd('wic', ignore_status=True).status) | ||
112 | |||
113 | @testcase(1215) | ||
114 | def test_help_overview(self): | ||
115 | """Test wic help overview""" | ||
116 | self.assertEqual(0, runCmd('wic help overview').status) | ||
117 | |||
118 | @testcase(1216) | ||
119 | def test_help_plugins(self): | ||
120 | """Test wic help plugins""" | ||
121 | self.assertEqual(0, runCmd('wic help plugins').status) | ||
122 | |||
123 | @testcase(1217) | ||
124 | def test_help_kickstart(self): | ||
125 | """Test wic help kickstart""" | ||
126 | self.assertEqual(0, runCmd('wic help kickstart').status) | ||
127 | |||
128 | @testcase(1264) | 179 | @testcase(1264) |
129 | def test_compress_gzip(self): | 180 | def test_compress_gzip(self): |
130 | """Test compressing an image with gzip""" | 181 | """Test compressing an image with gzip""" |
@@ -183,13 +234,14 @@ class Wic(oeSelfTest): | |||
183 | self.assertEqual(0, status) | 234 | self.assertEqual(0, status) |
184 | self.assertEqual(1, len(glob(self.resultdir + "%(wks)s-*.direct" % bbvars))) | 235 | self.assertEqual(1, len(glob(self.resultdir + "%(wks)s-*.direct" % bbvars))) |
185 | 236 | ||
186 | @testcase(1346) | 237 | @testcase(1496) |
187 | def test_iso_image(self): | 238 | def test_bmap(self): |
188 | """Test creation of hybrid iso image with legacy and EFI boot""" | 239 | """Test generation of .bmap file""" |
189 | cmd = "wic create mkhybridiso --image-name core-image-minimal" | 240 | cmd = "wic create directdisk -e core-image-minimal --bmap" |
190 | self.assertEqual(0, runCmd(cmd).status) | 241 | status = runCmd(cmd).status |
191 | self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct"))) | 242 | self.assertEqual(0, status) |
192 | self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso"))) | 243 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) |
244 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct.bmap"))) | ||
193 | 245 | ||
194 | @testcase(1347) | 246 | @testcase(1347) |
195 | def test_image_env(self): | 247 | def test_image_env(self): |
@@ -230,34 +282,6 @@ class Wic(oeSelfTest): | |||
230 | self.assertTrue(os.path.islink(path)) | 282 | self.assertTrue(os.path.islink(path)) |
231 | self.assertTrue(os.path.isfile(os.path.realpath(path))) | 283 | self.assertTrue(os.path.isfile(os.path.realpath(path))) |
232 | 284 | ||
233 | @testcase(1348) | ||
234 | def test_qemux86_directdisk(self): | ||
235 | """Test creation of qemux-86-directdisk image""" | ||
236 | cmd = "wic create qemux86-directdisk -e core-image-minimal" | ||
237 | self.assertEqual(0, runCmd(cmd).status) | ||
238 | self.assertEqual(1, len(glob(self.resultdir + "qemux86-directdisk-*direct"))) | ||
239 | |||
240 | @testcase(1349) | ||
241 | def test_mkgummidisk(self): | ||
242 | """Test creation of mkgummidisk image""" | ||
243 | cmd = "wic create mkgummidisk --image-name core-image-minimal" | ||
244 | self.assertEqual(0, runCmd(cmd).status) | ||
245 | self.assertEqual(1, len(glob(self.resultdir + "mkgummidisk-*direct"))) | ||
246 | |||
247 | @testcase(1350) | ||
248 | def test_mkefidisk(self): | ||
249 | """Test creation of mkefidisk image""" | ||
250 | cmd = "wic create mkefidisk -e core-image-minimal" | ||
251 | self.assertEqual(0, runCmd(cmd).status) | ||
252 | self.assertEqual(1, len(glob(self.resultdir + "mkefidisk-*direct"))) | ||
253 | |||
254 | @testcase(1385) | ||
255 | def test_directdisk_bootloader_config(self): | ||
256 | """Test creation of directdisk-bootloader-config image""" | ||
257 | cmd = "wic create directdisk-bootloader-config -e core-image-minimal" | ||
258 | self.assertEqual(0, runCmd(cmd).status) | ||
259 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-bootloader-config-*direct"))) | ||
260 | |||
261 | @testcase(1422) | 285 | @testcase(1422) |
262 | def test_qemu(self): | 286 | def test_qemu(self): |
263 | """Test wic-image-minimal under qemu""" | 287 | """Test wic-image-minimal under qemu""" |
@@ -268,27 +292,3 @@ class Wic(oeSelfTest): | |||
268 | status, output = qemu.run_serial(cmd) | 292 | status, output = qemu.run_serial(cmd) |
269 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) | 293 | self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output)) |
270 | self.assertEqual(output, '/dev/root /\r\n/dev/vda3 /mnt') | 294 | self.assertEqual(output, '/dev/root /\r\n/dev/vda3 /mnt') |
271 | |||
272 | @testcase(1496) | ||
273 | def test_bmap(self): | ||
274 | """Test generation of .bmap file""" | ||
275 | cmd = "wic create directdisk -e core-image-minimal --bmap" | ||
276 | status = runCmd(cmd).status | ||
277 | self.assertEqual(0, status) | ||
278 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct"))) | ||
279 | self.assertEqual(1, len(glob(self.resultdir + "directdisk-*direct.bmap"))) | ||
280 | |||
281 | @testcase(1560) | ||
282 | def test_systemd_bootdisk(self): | ||
283 | """Test creation of systemd-bootdisk image""" | ||
284 | cmd = "wic create systemd-bootdisk -e core-image-minimal" | ||
285 | self.assertEqual(0, runCmd(cmd).status) | ||
286 | self.assertEqual(1, len(glob(self.resultdir + "systemd-bootdisk-*direct"))) | ||
287 | |||
288 | @testcase(1561) | ||
289 | def test_sdimage_bootpart(self): | ||
290 | """Test creation of sdimage-bootpart image""" | ||
291 | cmd = "wic create sdimage-bootpart -e core-image-minimal" | ||
292 | self.write_config('IMAGE_BOOT_FILES = "bzImage"\n') | ||
293 | self.assertEqual(0, runCmd(cmd).status) | ||
294 | self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct"))) | ||