summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/wic.py33
1 files changed, 29 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index 3dc54a4c6d..9425dc07c4 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -31,6 +31,8 @@ from shutil import rmtree
31 31
32from oeqa.selftest.base import oeSelfTest 32from oeqa.selftest.base import oeSelfTest
33from oeqa.utils.commands import runCmd, bitbake, get_bb_var 33from oeqa.utils.commands import runCmd, bitbake, get_bb_var
34from oeqa.utils.decorators import testcase
35
34 36
35class Wic(oeSelfTest): 37class Wic(oeSelfTest):
36 """Wic test class.""" 38 """Wic test class."""
@@ -56,24 +58,29 @@ class Wic(oeSelfTest):
56 58
57 rmtree(self.resultdir, ignore_errors=True) 59 rmtree(self.resultdir, ignore_errors=True)
58 60
61 @testcase(1208)
59 def test01_help(self): 62 def test01_help(self):
60 """Test wic --help""" 63 """Test wic --help"""
61 self.assertEqual(0, runCmd('wic --help').status) 64 self.assertEqual(0, runCmd('wic --help').status)
62 65
66 @testcase(1209)
63 def test02_createhelp(self): 67 def test02_createhelp(self):
64 """Test wic create --help""" 68 """Test wic create --help"""
65 self.assertEqual(0, runCmd('wic create --help').status) 69 self.assertEqual(0, runCmd('wic create --help').status)
66 70
71 @testcase(1210)
67 def test03_listhelp(self): 72 def test03_listhelp(self):
68 """Test wic list --help""" 73 """Test wic list --help"""
69 self.assertEqual(0, runCmd('wic list --help').status) 74 self.assertEqual(0, runCmd('wic list --help').status)
70 75
76 @testcase(1211)
71 def test04_build_image_name(self): 77 def test04_build_image_name(self):
72 """Test wic create directdisk --image-name core-image-minimal""" 78 """Test wic create directdisk --image-name core-image-minimal"""
73 self.assertEqual(0, runCmd("wic create directdisk " 79 self.assertEqual(0, runCmd("wic create directdisk "
74 "--image-name core-image-minimal").status) 80 "--image-name core-image-minimal").status)
75 self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) 81 self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
76 82
83 @testcase(1212)
77 def test05_build_artifacts(self): 84 def test05_build_artifacts(self):
78 """Test wic create directdisk providing all artifacts.""" 85 """Test wic create directdisk providing all artifacts."""
79 vars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \ 86 vars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
@@ -87,33 +94,40 @@ class Wic(oeSelfTest):
87 self.assertEqual(0, status) 94 self.assertEqual(0, status)
88 self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) 95 self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
89 96
97 @testcase(1157)
90 def test06_gpt_image(self): 98 def test06_gpt_image(self):
91 """Test creation of core-image-minimal with gpt table and UUID boot""" 99 """Test creation of core-image-minimal with gpt table and UUID boot"""
92 self.assertEqual(0, runCmd("wic create directdisk-gpt " 100 self.assertEqual(0, runCmd("wic create directdisk-gpt "
93 "--image-name core-image-minimal").status) 101 "--image-name core-image-minimal").status)
94 self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct"))) 102 self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
95 103
104 @testcase(1213)
96 def test07_unsupported_subcommand(self): 105 def test07_unsupported_subcommand(self):
97 """Test unsupported subcommand""" 106 """Test unsupported subcommand"""
98 self.assertEqual(1, runCmd('wic unsupported', 107 self.assertEqual(1, runCmd('wic unsupported',
99 ignore_status=True).status) 108 ignore_status=True).status)
100 109
110 @testcase(1214)
101 def test08_no_command(self): 111 def test08_no_command(self):
102 """Test wic without command""" 112 """Test wic without command"""
103 self.assertEqual(1, runCmd('wic', ignore_status=True).status) 113 self.assertEqual(1, runCmd('wic', ignore_status=True).status)
104 114
105 def test09_help_kickstart(self): 115 @testcase(1215)
116 def test09_help_overview(self):
106 """Test wic help overview""" 117 """Test wic help overview"""
107 self.assertEqual(0, runCmd('wic help overview').status) 118 self.assertEqual(0, runCmd('wic help overview').status)
108 119
120 @testcase(1216)
109 def test10_help_plugins(self): 121 def test10_help_plugins(self):
110 """Test wic help plugins""" 122 """Test wic help plugins"""
111 self.assertEqual(0, runCmd('wic help plugins').status) 123 self.assertEqual(0, runCmd('wic help plugins').status)
112 124
125 @testcase(1217)
113 def test11_help_kickstart(self): 126 def test11_help_kickstart(self):
114 """Test wic help kickstart""" 127 """Test wic help kickstart"""
115 self.assertEqual(0, runCmd('wic help kickstart').status) 128 self.assertEqual(0, runCmd('wic help kickstart').status)
116 129
130 @testcase(1264)
117 def test12_compress_gzip(self): 131 def test12_compress_gzip(self):
118 """Test compressing an image with gzip""" 132 """Test compressing an image with gzip"""
119 self.assertEqual(0, runCmd("wic create directdisk " 133 self.assertEqual(0, runCmd("wic create directdisk "
@@ -122,7 +136,8 @@ class Wic(oeSelfTest):
122 self.assertEqual(1, len(glob(self.resultdir + \ 136 self.assertEqual(1, len(glob(self.resultdir + \
123 "directdisk-*.direct.gz"))) 137 "directdisk-*.direct.gz")))
124 138
125 def test13_compress_gzip(self): 139 @testcase(1265)
140 def test13_compress_bzip2(self):
126 """Test compressing an image with bzip2""" 141 """Test compressing an image with bzip2"""
127 self.assertEqual(0, runCmd("wic create directdisk " 142 self.assertEqual(0, runCmd("wic create directdisk "
128 "--image-name core-image-minimal " 143 "--image-name core-image-minimal "
@@ -130,7 +145,8 @@ class Wic(oeSelfTest):
130 self.assertEqual(1, len(glob(self.resultdir + \ 145 self.assertEqual(1, len(glob(self.resultdir + \
131 "directdisk-*.direct.bz2"))) 146 "directdisk-*.direct.bz2")))
132 147
133 def test14_compress_gzip(self): 148 @testcase(1266)
149 def test14_compress_xz(self):
134 """Test compressing an image with xz""" 150 """Test compressing an image with xz"""
135 self.assertEqual(0, runCmd("wic create directdisk " 151 self.assertEqual(0, runCmd("wic create directdisk "
136 "--image-name core-image-minimal " 152 "--image-name core-image-minimal "
@@ -138,12 +154,14 @@ class Wic(oeSelfTest):
138 self.assertEqual(1, len(glob(self.resultdir + \ 154 self.assertEqual(1, len(glob(self.resultdir + \
139 "directdisk-*.direct.xz"))) 155 "directdisk-*.direct.xz")))
140 156
157 @testcase(1267)
141 def test15_wrong_compressor(self): 158 def test15_wrong_compressor(self):
142 """Test how wic breaks if wrong compressor is provided""" 159 """Test how wic breaks if wrong compressor is provided"""
143 self.assertEqual(2, runCmd("wic create directdisk " 160 self.assertEqual(2, runCmd("wic create directdisk "
144 "--image-name core-image-minimal " 161 "--image-name core-image-minimal "
145 "-c wrong", ignore_status=True).status) 162 "-c wrong", ignore_status=True).status)
146 163
164 @testcase(1268)
147 def test16_rootfs_indirect_recipes(self): 165 def test16_rootfs_indirect_recipes(self):
148 """Test usage of rootfs plugin with rootfs recipes""" 166 """Test usage of rootfs plugin with rootfs recipes"""
149 wks = "directdisk-multi-rootfs" 167 wks = "directdisk-multi-rootfs"
@@ -154,6 +172,7 @@ class Wic(oeSelfTest):
154 % wks).status) 172 % wks).status)
155 self.assertEqual(1, len(glob(self.resultdir + "%s*.direct" % wks))) 173 self.assertEqual(1, len(glob(self.resultdir + "%s*.direct" % wks)))
156 174
175 @testcase(1269)
157 def test17_rootfs_artifacts(self): 176 def test17_rootfs_artifacts(self):
158 """Test usage of rootfs plugin with rootfs paths""" 177 """Test usage of rootfs plugin with rootfs paths"""
159 vars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \ 178 vars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
@@ -171,13 +190,15 @@ class Wic(oeSelfTest):
171 self.assertEqual(1, len(glob(self.resultdir + \ 190 self.assertEqual(1, len(glob(self.resultdir + \
172 "%(wks)s-*.direct" % vars))) 191 "%(wks)s-*.direct" % vars)))
173 192
193 @testcase(1264)
174 def test18_iso_image(self): 194 def test18_iso_image(self):
175 """Test creation of hybrid iso imagewith legacy and EFI boot""" 195 """Test creation of hybrid iso image with legacy and EFI boot"""
176 self.assertEqual(0, runCmd("wic create mkhybridiso " 196 self.assertEqual(0, runCmd("wic create mkhybridiso "
177 "--image-name core-image-minimal").status) 197 "--image-name core-image-minimal").status)
178 self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct"))) 198 self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct")))
179 self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso"))) 199 self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso")))
180 200
201 @testcase(1347)
181 def test19_image_env(self): 202 def test19_image_env(self):
182 """Test generation of <image>.env files.""" 203 """Test generation of <image>.env files."""
183 image = 'core-image-minimal' 204 image = 'core-image-minimal'
@@ -200,6 +221,7 @@ class Wic(oeSelfTest):
200 self.assertTrue(var in content, "%s is not in .env file" % var) 221 self.assertTrue(var in content, "%s is not in .env file" % var)
201 self.assertTrue(content[var]) 222 self.assertTrue(content[var])
202 223
224 @testcase(1351)
203 def test20_wic_image_type(self): 225 def test20_wic_image_type(self):
204 """Test building wic images by bitbake""" 226 """Test building wic images by bitbake"""
205 self.assertEqual(0, bitbake('wic-image-minimal').status) 227 self.assertEqual(0, bitbake('wic-image-minimal').status)
@@ -214,6 +236,7 @@ class Wic(oeSelfTest):
214 self.assertTrue(os.path.islink(path)) 236 self.assertTrue(os.path.islink(path))
215 self.assertTrue(os.path.isfile(os.path.realpath(path))) 237 self.assertTrue(os.path.isfile(os.path.realpath(path)))
216 238
239 @testcase(1348)
217 def test21_qemux86_directdisk(self): 240 def test21_qemux86_directdisk(self):
218 """Test creation of qemux-86-directdisk image""" 241 """Test creation of qemux-86-directdisk image"""
219 image = "qemux86-directdisk" 242 image = "qemux86-directdisk"
@@ -221,6 +244,7 @@ class Wic(oeSelfTest):
221 % image).status) 244 % image).status)
222 self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image))) 245 self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
223 246
247 @testcase(1349)
224 def test22_mkgummidisk(self): 248 def test22_mkgummidisk(self):
225 """Test creation of mkgummidisk image""" 249 """Test creation of mkgummidisk image"""
226 image = "mkgummidisk" 250 image = "mkgummidisk"
@@ -228,6 +252,7 @@ class Wic(oeSelfTest):
228 % image).status) 252 % image).status)
229 self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image))) 253 self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
230 254
255 @testcase(1350)
231 def test23_mkefidisk(self): 256 def test23_mkefidisk(self):
232 """Test creation of mkefidisk image""" 257 """Test creation of mkefidisk image"""
233 image = "mkefidisk" 258 image = "mkefidisk"