Debian Codegraph @

functionaltests.py

raw symbols SCIP
1 #!/usr/bin/python3.4
2 # -*- coding: utf-8 -*-
3 # Copyright © 2015 Carl Chenet <[email protected]>
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17 import hashlib
18 from multiprocessing import Process, Queue
19 from os import linesep, environ, link, remove
20 import subprocess
21 import os.path
22 import shutil
23 import sys
24
25 import functionaltests
26
27 EXE = './brebis.py'
28 OPTCONFIG = '-c'
29 OPTDEL = '-d'
30 OPTEXCEPTIONSFILE = '-E'
31 OPTGEN = '-g'
32 OPTFULLGEN = '-G'
33 OPTHASHTYPE = '--hashtype'
34 OPTHASHES = '-H'
35 OPTLOG = '-l'
36 OKMSG = 'ok'
37 KOMSG = 'ko - '
38 PYTHONEXE =''
39 ABSPATH = ''
40 ALTERNATEDELIMITER = '('
41
42 # To correctly use the tests with buildbot
43 if 'PYTHONEXE' in environ:
44 PYTHONEXE = environ['PYTHONEXE']
45 ABSPATH = environ['PWD']
46
47 class Main:
48 '''Main of all the Test* classes'''
49 def _main(self, __condition):
50 if 'PYTHONEXE' in environ:
51 __retcode = subprocess.call([PYTHONEXE, EXE, OPTCONFIG, self._testdir, OPTLOG, self._resultfile])
52 else:
53 __retcode = subprocess.call([EXE, OPTCONFIG, self._testdir, OPTLOG, self._resultfile])
54 if __retcode != 0:
55 self._queue.put('{} - {}return code:{}'.format(self._testname, KOMSG, str(__retcode)))
56 else:
57 with open(self._resultfile, 'r') as __file:
58 if __condition in __file.read():
59 self._queue.put('{} - {}'.format(self._testname, OKMSG))
60 else:
61 self._queue.put('{} - {}value in result file not expected'.format(self._testname, KOMSG))
62
63 class MainGenerateParse:
64 '''Main of all the Test*GenerateParse classes'''
65 def _main(self, __condition):
66 if 'PYTHONEXE' in environ:
67 __retcode = subprocess.call([PYTHONEXE, EXE, OPTCONFIG, self._testdir, OPTLOG, self._resultfile])
68 else:
69 __retcode = subprocess.call([EXE, OPTCONFIG, self._testdir, OPTLOG, self._resultfile])
70 if __retcode != 0:
71 self._queue.put('{} - {}return code:{}'.format(self._testname, KOMSG, str(__retcode)))
72 else:
73 with open(self._resultfile, 'r') as __file:
74 if '' == __file.read():
75 self._queue.put('{} - {}'.format(self._testname, OKMSG))
76 else:
77 self._queue.put('{} - {}value in result file not expected'.format(self._testname, KOMSG))
78
79 class Test_file_missing_in_tar(Main):
80 '''Test if a file is missing in a tar archive'''
81 def __init__(self, q):
82 self._queue = q
83 self._testname = self.__class__.__name__
84 self._testdir = os.path.join(ABSPATH, 'functional-tests/file-missing-in-tar')
85 self._resultfile = os.path.join(self._testdir, 'a.out')
86 self._main('1 file missing in')
87
88 class Test_file_missing_in_tar_gz(Main):
89 '''Test if a file is missing in a tar.gz archive'''
90 def __init__(self, q):
91 self._queue = q
92 self._testname = self.__class__.__name__
93 self._testdir = os.path.join(ABSPATH, 'functional-tests/file-missing-in-tar-gz')
94 self._resultfile = os.path.join(self._testdir, 'a.out')
95 self._main('1 file missing in')
96
97 class Test_file_missing_in_tar_bz2(Main):
98 '''Test if a file is missing in a tar.bz2 archive'''
99 def __init__(self, q):
100 self._queue = q
101 self._testname = self.__class__.__name__
102 self._testdir = os.path.join(ABSPATH, 'functional-tests/file-missing-in-tar-bz2')
103 self._resultfile = os.path.join(self._testdir, 'a.out')
104 self._main('1 file missing in')
105
106 class Test_file_missing_in_tar_xz(Main):
107 '''Test if a file is missing in a tar.xz archive'''
108 def __init__(self, q):
109 self._queue = q
110 self._testname = self.__class__.__name__
111 self._testdir = os.path.join(ABSPATH, 'functional-tests/file-missing-in-tar-xz')
112 self._resultfile = os.path.join(self._testdir, 'a.out')
113 self._main('1 file missing in')
114
115 class Test_file_missing_in_gzip(Main):
116 def __init__(self, q):
117 self._queue = q
118 self._testname = self.__class__.__name__
119 self._testdir = os.path.join(ABSPATH, 'functional-tests/file-missing-in-gzip')
120 self._resultfile = os.path.join(self._testdir, 'a.out')
121 self._main('1 file missing in')
122
123 class Test_file_missing_in_xz(Main):
124 def __init__(self, q):
125 self._queue = q
126 self._testname = self.__class__.__name__
127 self._testdir = os.path.join(ABSPATH, 'functional-tests/file-missing-in-xz')
128 self._resultfile = os.path.join(self._testdir, 'a.out')
129 self._main('1 file missing in')
130
131 class Test_file_missing_in_zip(Main):
132 def __init__(self, q):
133 self._queue = q
134 self._testname = self.__class__.__name__
135 self._testdir = os.path.join(ABSPATH, 'functional-tests/file-missing-in-zip')
136 self._resultfile = os.path.join(self._testdir, 'a.out')
137 self._main('1 file missing in')
138
139 class Test_file_missing_in_tree(Main):
140 def __init__(self, q):
141 self._queue = q
142 self._testname = self.__class__.__name__
143 self._testdir = os.path.join(ABSPATH, 'functional-tests/file-missing-in-tree')
144 self._resultfile = os.path.join(self._testdir, 'a.out')
145 self._main('1 file missing in')
146
147 class Test_wrong_tar_archive_mode(Main):
148 def __init__(self, q):
149 self._queue = q
150 self._testname = self.__class__.__name__
151 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-archive-mode')
152 self._resultfile = os.path.join(self._testdir, 'a.out')
153 self._main('1 file with unexpected mode')
154
155 class Test_wrong_tar_gz_archive_mode(Main):
156 def __init__(self, q):
157 self._queue = q
158 self._testname = self.__class__.__name__
159 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-gz-archive-mode')
160 self._resultfile = os.path.join(self._testdir, 'a.out')
161 self._main('1 file with unexpected mode')
162
163 class Test_wrong_tar_bz2_archive_mode(Main):
164 def __init__(self, q):
165 self._queue = q
166 self._testname = self.__class__.__name__
167 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-bz2-archive-mode')
168 self._resultfile = os.path.join(self._testdir, 'a.out')
169 self._main('1 file with unexpected mode')
170
171 class Test_wrong_tar_xz_archive_mode(Main):
172 def __init__(self, q):
173 self._queue = q
174 self._testname = self.__class__.__name__
175 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-xz-archive-mode')
176 self._resultfile = os.path.join(self._testdir, 'a.out')
177 self._main('1 file with unexpected mode')
178
179 class Test_wrong_gzip_archive_mode(Main):
180 def __init__(self, q):
181 self._queue = q
182 self._testname = self.__class__.__name__
183 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-gz-archive-mode')
184 self._resultfile = os.path.join(self._testdir, 'a.out')
185 self._main('1 file with unexpected mode')
186
187 class Test_wrong_xz_archive_mode(Main):
188 def __init__(self, q):
189 self._queue = q
190 self._testname = self.__class__.__name__
191 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-xz-archive-mode')
192 self._resultfile = os.path.join(self._testdir, 'a.out')
193 self._main('1 file with unexpected mode')
194
195 class Test_wrong_zip_archive_mode(Main):
196 def __init__(self, q):
197 self._queue = q
198 self._testname = self.__class__.__name__
199 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-zip-archive-mode')
200 self._resultfile = os.path.join(self._testdir, 'a.out')
201 self._main('1 file with unexpected mode')
202
203 class Test_wrong_tar_archive_uid(Main):
204 def __init__(self, q):
205 self._queue = q
206 self._testname = self.__class__.__name__
207 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-archive-uid')
208 self._resultfile = os.path.join(self._testdir, 'a.out')
209 self._main('1 file with unexpected uid')
210
211 class Test_wrong_tar_gz_archive_uid(Main):
212 def __init__(self, q):
213 self._queue = q
214 self._testname = self.__class__.__name__
215 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-gz-archive-uid')
216 self._resultfile = os.path.join(self._testdir, 'a.out')
217 self._main('1 file with unexpected uid')
218
219 class Test_wrong_tar_xz_archive_uid(Main):
220 def __init__(self, q):
221 self._queue = q
222 self._testname = self.__class__.__name__
223 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-xz-archive-uid')
224 self._resultfile = os.path.join(self._testdir, 'a.out')
225 self._main('1 file with unexpected uid')
226
227 class Test_wrong_tar_bz2_archive_uid(Main):
228 def __init__(self, q):
229 self._queue = q
230 self._testname = self.__class__.__name__
231 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-bz2-archive-uid')
232 self._resultfile = os.path.join(self._testdir, 'a.out')
233 self._main('1 file with unexpected uid')
234
235 class Test_wrong_zip_archive_uid(Main):
236 def __init__(self, q):
237 self._queue = q
238 self._testname = self.__class__.__name__
239 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-zip-archive-uid')
240 self._resultfile = os.path.join(self._testdir, 'a.out')
241 self._main('1 file with unexpected uid')
242
243 class Test_wrong_gz_archive_uid(Main):
244 def __init__(self, q):
245 self._queue = q
246 self._testname = self.__class__.__name__
247 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-gz-archive-uid')
248 self._resultfile = os.path.join(self._testdir, 'a.out')
249 self._main('1 file with unexpected uid')
250
251 class Test_wrong_bzip2_archive_uid(Main):
252 def __init__(self, q):
253 self._queue = q
254 self._testname = self.__class__.__name__
255 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-bz2-archive-uid')
256 self._resultfile = os.path.join(self._testdir, 'a.out')
257 self._main('1 file with unexpected uid')
258
259 class Test_wrong_xz_archive_uid(Main):
260 def __init__(self, q):
261 self._queue = q
262 self._testname = self.__class__.__name__
263 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-xz-archive-uid')
264 self._resultfile = os.path.join(self._testdir, 'a.out')
265 self._main('1 file with unexpected uid')
266
267 class Test_wrong_tar_archive_gid(Main):
268 def __init__(self, q):
269 self._queue = q
270 self._testname = self.__class__.__name__
271 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-archive-gid')
272 self._resultfile = os.path.join(self._testdir, 'a.out')
273 self._main('1 file with unexpected gid')
274
275 class Test_wrong_tar_gz_archive_gid(Main):
276 def __init__(self, q):
277 self._queue = q
278 self._testname = self.__class__.__name__
279 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-gz-archive-gid')
280 self._resultfile = os.path.join(self._testdir, 'a.out')
281 self._main('1 file with unexpected gid')
282
283 class Test_wrong_tar_bz2_archive_gid(Main):
284 def __init__(self, q):
285 self._queue = q
286 self._testname = self.__class__.__name__
287 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-bz2-archive-gid')
288 self._resultfile = os.path.join(self._testdir, 'a.out')
289 self._main('1 file with unexpected gid')
290
291 class Test_wrong_tar_xz_archive_gid(Main):
292 def __init__(self, q):
293 self._queue = q
294 self._testname = self.__class__.__name__
295 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-xz-archive-gid')
296 self._resultfile = os.path.join(self._testdir, 'a.out')
297 self._main('1 file with unexpected gid')
298
299 class Test_wrong_gzip_archive_gid(Main):
300 def __init__(self, q):
301 self._queue = q
302 self._testname = self.__class__.__name__
303 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-gz-archive-gid')
304 self._resultfile = os.path.join(self._testdir, 'a.out')
305 self._main('1 file with unexpected gid')
306
307 class Test_wrong_bzip2_archive_gid(Main):
308 def __init__(self, q):
309 self._queue = q
310 self._testname = self.__class__.__name__
311 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-bz2-archive-gid')
312 self._resultfile = os.path.join(self._testdir, 'a.out')
313 self._main('1 file with unexpected gid')
314
315 class Test_wrong_xz_archive_gid(Main):
316 def __init__(self, q):
317 self._queue = q
318 self._testname = self.__class__.__name__
319 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-xz-archive-gid')
320 self._resultfile = os.path.join(self._testdir, 'a.out')
321 self._main('1 file with unexpected gid')
322
323 class Test_wrong_zip_archive_gid(Main):
324 def __init__(self, q):
325 self._queue = q
326 self._testname = self.__class__.__name__
327 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-zip-archive-gid')
328 self._resultfile = os.path.join(self._testdir, 'a.out')
329 self._main('1 file with unexpected gid')
330
331 class Test_wrong_tar_archive_md5_hash(Main):
332 def __init__(self, q):
333 self._queue = q
334 self._testname = self.__class__.__name__
335 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-archive-md5-hash')
336 self._resultfile = os.path.join(self._testdir, 'a.out')
337 self._main('1 file with unexpected hash')
338
339 class Test_wrong_tar_archive_sha1_hash(Main):
340 def __init__(self, q):
341 self._queue = q
342 self._testname = self.__class__.__name__
343 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-archive-sha1-hash')
344 self._resultfile = os.path.join(self._testdir, 'a.out')
345 self._main('1 file with unexpected hash')
346
347 class Test_wrong_tar_archive_sha224_hash(Main):
348 def __init__(self, q):
349 self._queue = q
350 self._testname = self.__class__.__name__
351 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-archive-sha224-hash')
352 self._resultfile = os.path.join(self._testdir, 'a.out')
353 self._main('1 file with unexpected hash')
354
355 class Test_wrong_tar_archive_sha256_hash(Main):
356 def __init__(self, q):
357 self._queue = q
358 self._testname = self.__class__.__name__
359 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-archive-sha256-hash')
360 self._resultfile = os.path.join(self._testdir, 'a.out')
361 self._main('1 file with unexpected hash')
362
363 class Test_wrong_tar_archive_sha384_hash(Main):
364 def __init__(self, q):
365 self._queue = q
366 self._testname = self.__class__.__name__
367 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-archive-sha384-hash')
368 self._resultfile = os.path.join(self._testdir, 'a.out')
369 self._main('1 file with unexpected hash')
370
371 class Test_wrong_tar_archive_sha512_hash(Main):
372 def __init__(self, q):
373 self._queue = q
374 self._testname = self.__class__.__name__
375 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-archive-sha512-hash')
376 self._resultfile = os.path.join(self._testdir, 'a.out')
377 self._main('1 file with unexpected hash')
378
379 class Test_wrong_tar_gz_archive_md5_hash(Main):
380 def __init__(self, q):
381 self._queue = q
382 self._testname = self.__class__.__name__
383 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-gz-archive-md5-hash')
384 self._resultfile = os.path.join(self._testdir, 'a.out')
385 self._main('1 file with unexpected hash')
386
387 class Test_wrong_tar_gz_archive_sha1_hash(Main):
388 def __init__(self, q):
389 self._queue = q
390 self._testname = self.__class__.__name__
391 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-gz-archive-sha1-hash')
392 self._resultfile = os.path.join(self._testdir, 'a.out')
393 self._main('1 file with unexpected hash')
394
395 class Test_wrong_tar_gz_archive_sha224_hash(Main):
396 def __init__(self, q):
397 self._queue = q
398 self._testname = self.__class__.__name__
399 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-gz-archive-sha224-hash')
400 self._resultfile = os.path.join(self._testdir, 'a.out')
401 self._main('1 file with unexpected hash')
402
403 class Test_wrong_tar_xz_archive_sha224_hash(Main):
404 def __init__(self, q):
405 self._queue = q
406 self._testname = self.__class__.__name__
407 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-xz-archive-sha224-hash')
408 self._resultfile = os.path.join(self._testdir, 'a.out')
409 self._main('1 file with unexpected hash')
410
411 class Test_wrong_tar_gz_archive_sha256_hash(Main):
412 def __init__(self, q):
413 self._queue = q
414 self._testname = self.__class__.__name__
415 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-gz-archive-sha256-hash')
416 self._resultfile = os.path.join(self._testdir, 'a.out')
417 self._main('1 file with unexpected hash')
418
419 class Test_wrong_tar_xz_archive_sha256_hash(Main):
420 def __init__(self, q):
421 self._queue = q
422 self._testname = self.__class__.__name__
423 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-xz-archive-sha256-hash')
424 self._resultfile = os.path.join(self._testdir, 'a.out')
425 self._main('1 file with unexpected hash')
426
427 class Test_wrong_tar_gz_archive_sha384_hash(Main):
428 def __init__(self, q):
429 self._queue = q
430 self._testname = self.__class__.__name__
431 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-gz-archive-sha384-hash')
432 self._resultfile = os.path.join(self._testdir, 'a.out')
433 self._main('1 file with unexpected hash')
434
435 class Test_wrong_tar_xz_archive_sha384_hash(Main):
436 def __init__(self, q):
437 self._queue = q
438 self._testname = self.__class__.__name__
439 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-xz-archive-sha384-hash')
440 self._resultfile = os.path.join(self._testdir, 'a.out')
441 self._main('1 file with unexpected hash')
442
443 class Test_wrong_tar_gz_archive_sha512_hash(Main):
444 def __init__(self, q):
445 self._queue = q
446 self._testname = self.__class__.__name__
447 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-gz-archive-sha512-hash')
448 self._resultfile = os.path.join(self._testdir, 'a.out')
449 self._main('1 file with unexpected hash')
450
451 class Test_wrong_tar_xz_archive_sha512_hash(Main):
452 def __init__(self, q):
453 self._queue = q
454 self._testname = self.__class__.__name__
455 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-xz-archive-sha512-hash')
456 self._resultfile = os.path.join(self._testdir, 'a.out')
457 self._main('1 file with unexpected hash')
458
459 class Test_wrong_tar_bz2_archive_md5_hash(Main):
460 def __init__(self, q):
461 self._queue = q
462 self._testname = self.__class__.__name__
463 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-bz2-archive-md5-hash')
464 self._resultfile = os.path.join(self._testdir, 'a.out')
465 self._main('1 file with unexpected hash')
466
467 class Test_wrong_tar_xz_archive_md5_hash(Main):
468 def __init__(self, q):
469 self._queue = q
470 self._testname = self.__class__.__name__
471 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-xz-archive-md5-hash')
472 self._resultfile = os.path.join(self._testdir, 'a.out')
473 self._main('1 file with unexpected hash')
474
475 class Test_wrong_tar_bz2_archive_sha1_hash(Main):
476 def __init__(self, q):
477 self._queue = q
478 self._testname = self.__class__.__name__
479 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-bz2-archive-sha1-hash')
480 self._resultfile = os.path.join(self._testdir, 'a.out')
481 self._main('1 file with unexpected hash')
482
483 class Test_wrong_tar_xz_archive_sha1_hash(Main):
484 def __init__(self, q):
485 self._queue = q
486 self._testname = self.__class__.__name__
487 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-xz-archive-sha1-hash')
488 self._resultfile = os.path.join(self._testdir, 'a.out')
489 self._main('1 file with unexpected hash')
490
491 class Test_wrong_tar_bz2_archive_sha224_hash(Main):
492 def __init__(self, q):
493 self._queue = q
494 self._testname = self.__class__.__name__
495 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-bz2-archive-sha224-hash')
496 self._resultfile = os.path.join(self._testdir, 'a.out')
497 self._main('1 file with unexpected hash')
498
499 class Test_wrong_tar_bz2_archive_sha256_hash(Main):
500 def __init__(self, q):
501 self._queue = q
502 self._testname = self.__class__.__name__
503 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-bz2-archive-sha256-hash')
504 self._resultfile = os.path.join(self._testdir, 'a.out')
505 self._main('1 file with unexpected hash')
506
507 class Test_wrong_tar_bz2_archive_sha384_hash(Main):
508 def __init__(self, q):
509 self._queue = q
510 self._testname = self.__class__.__name__
511 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-bz2-archive-sha384-hash')
512 self._resultfile = os.path.join(self._testdir, 'a.out')
513 self._main('1 file with unexpected hash')
514
515 class Test_wrong_tar_bz2_archive_sha512_hash(Main):
516 def __init__(self, q):
517 self._queue = q
518 self._testname = self.__class__.__name__
519 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-bz2-archive-sha512-hash')
520 self._resultfile = os.path.join(self._testdir, 'a.out')
521 self._main('1 file with unexpected hash')
522
523 class Test_wrong_gzip_archive_md5_hash(Main):
524 def __init__(self, q):
525 self._queue = q
526 self._testname = self.__class__.__name__
527 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-gz-archive-md5-hash')
528 self._resultfile = os.path.join(self._testdir, 'a.out')
529 self._main('1 file with unexpected hash')
530
531 class Test_wrong_xz_archive_md5_hash(Main):
532 def __init__(self, q):
533 self._queue = q
534 self._testname = self.__class__.__name__
535 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-xz-archive-md5-hash')
536 self._resultfile = os.path.join(self._testdir, 'a.out')
537 self._main('1 file with unexpected hash')
538
539 class Test_wrong_xz_archive_md5_hash(Main):
540 def __init__(self, q):
541 self._queue = q
542 self._testname = self.__class__.__name__
543 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-xz-archive-md5-hash')
544 self._resultfile = os.path.join(self._testdir, 'a.out')
545 self._main('1 file with unexpected hash')
546
547 class Test_wrong_gzip_archive_sha1_hash(Main):
548 def __init__(self, q):
549 self._queue = q
550 self._testname = self.__class__.__name__
551 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-gz-archive-sha1-hash')
552 self._resultfile = os.path.join(self._testdir, 'a.out')
553 self._main('1 file with unexpected hash')
554
555 class Test_wrong_gzip_archive_sha224_hash(Main):
556 def __init__(self, q):
557 self._queue = q
558 self._testname = self.__class__.__name__
559 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-gz-archive-sha224-hash')
560 self._resultfile = os.path.join(self._testdir, 'a.out')
561 self._main('1 file with unexpected hash')
562
563 class Test_wrong_xz_archive_sha224_hash(Main):
564 def __init__(self, q):
565 self._queue = q
566 self._testname = self.__class__.__name__
567 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-xz-archive-sha224-hash')
568 self._resultfile = os.path.join(self._testdir, 'a.out')
569 self._main('1 file with unexpected hash')
570
571 class Test_wrong_gzip_archive_sha256_hash(Main):
572 def __init__(self, q):
573 self._queue = q
574 self._testname = self.__class__.__name__
575 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-gz-archive-sha256-hash')
576 self._resultfile = os.path.join(self._testdir, 'a.out')
577 self._main('1 file with unexpected hash')
578
579 class Test_wrong_xz_archive_sha256_hash(Main):
580 def __init__(self, q):
581 self._queue = q
582 self._testname = self.__class__.__name__
583 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-xz-archive-sha256-hash')
584 self._resultfile = os.path.join(self._testdir, 'a.out')
585 self._main('1 file with unexpected hash')
586
587 class Test_wrong_gzip_archive_sha384_hash(Main):
588 def __init__(self, q):
589 self._queue = q
590 self._testname = self.__class__.__name__
591 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-gz-archive-sha384-hash')
592 self._resultfile = os.path.join(self._testdir, 'a.out')
593 self._main('1 file with unexpected hash')
594
595 class Test_wrong_xz_archive_sha384_hash(Main):
596 def __init__(self, q):
597 self._queue = q
598 self._testname = self.__class__.__name__
599 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-xz-archive-sha384-hash')
600 self._resultfile = os.path.join(self._testdir, 'a.out')
601 self._main('1 file with unexpected hash')
602
603 class Test_wrong_gzip_archive_sha512_hash(Main):
604 def __init__(self, q):
605 self._queue = q
606 self._testname = self.__class__.__name__
607 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-gz-archive-sha512-hash')
608 self._resultfile = os.path.join(self._testdir, 'a.out')
609 self._main('1 file with unexpected hash')
610
611 class Test_wrong_xz_archive_sha512_hash(Main):
612 def __init__(self, q):
613 self._queue = q
614 self._testname = self.__class__.__name__
615 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-xz-archive-sha512-hash')
616 self._resultfile = os.path.join(self._testdir, 'a.out')
617 self._main('1 file with unexpected hash')
618
619 class Test_wrong_bzip2_archive_md5_hash(Main):
620 def __init__(self, q):
621 self._queue = q
622 self._testname = self.__class__.__name__
623 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-bz2-archive-md5-hash')
624 self._resultfile = os.path.join(self._testdir, 'a.out')
625 self._main('1 file with unexpected hash')
626
627 class Test_wrong_bzip2_archive_sha1_hash(Main):
628 def __init__(self, q):
629 self._queue = q
630 self._testname = self.__class__.__name__
631 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-bz2-archive-sha1-hash')
632 self._resultfile = os.path.join(self._testdir, 'a.out')
633 self._main('1 file with unexpected hash')
634
635 class Test_wrong_bzip2_archive_sha224_hash(Main):
636 def __init__(self, q):
637 self._queue = q
638 self._testname = self.__class__.__name__
639 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-bz2-archive-sha224-hash')
640 self._resultfile = os.path.join(self._testdir, 'a.out')
641 self._main('1 file with unexpected hash')
642
643 class Test_wrong_bzip2_archive_sha256_hash(Main):
644 def __init__(self, q):
645 self._queue = q
646 self._testname = self.__class__.__name__
647 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-bz2-archive-sha256-hash')
648 self._resultfile = os.path.join(self._testdir, 'a.out')
649 self._main('1 file with unexpected hash')
650
651 class Test_wrong_bzip2_archive_sha384_hash(Main):
652 def __init__(self, q):
653 self._queue = q
654 self._testname = self.__class__.__name__
655 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-bz2-archive-sha384-hash')
656 self._resultfile = os.path.join(self._testdir, 'a.out')
657 self._main('1 file with unexpected hash')
658
659 class Test_wrong_bzip2_archive_sha512_hash(Main):
660 def __init__(self, q):
661 self._queue = q
662 self._testname = self.__class__.__name__
663 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-bz2-archive-sha512-hash')
664 self._resultfile = os.path.join(self._testdir, 'a.out')
665 self._main('1 file with unexpected hash')
666
667 class Test_wrong_tar_bz2_archive_sha512_hash(Main):
668 def __init__(self, q):
669 self._queue = q
670 self._testname = self.__class__.__name__
671 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-tar-bz2-archive-sha512-hash')
672 self._resultfile = os.path.join(self._testdir, 'a.out')
673 self._main('1 file with unexpected hash')
674
675 class Test_wrong_zip_archive_md5_hash(Main):
676 def __init__(self, q):
677 self._queue = q
678 self._testname = self.__class__.__name__
679 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-zip-archive-md5-hash')
680 self._resultfile = os.path.join(self._testdir, 'a.out')
681 self._main('1 file with unexpected hash')
682
683 class Test_wrong_zip_archive_sha1_hash(Main):
684 def __init__(self, q):
685 self._queue = q
686 self._testname = self.__class__.__name__
687 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-zip-archive-sha1-hash')
688 self._resultfile = os.path.join(self._testdir, 'a.out')
689 self._main('1 file with unexpected hash')
690
691 class Test_wrong_zip_archive_sha224_hash(Main):
692 def __init__(self, q):
693 self._queue = q
694 self._testname = self.__class__.__name__
695 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-zip-archive-sha224-hash')
696 self._resultfile = os.path.join(self._testdir, 'a.out')
697 self._main('1 file with unexpected hash')
698
699 class Test_wrong_zip_archive_sha256_hash(Main):
700 def __init__(self, q):
701 self._queue = q
702 self._testname = self.__class__.__name__
703 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-zip-archive-sha256-hash')
704 self._resultfile = os.path.join(self._testdir, 'a.out')
705 self._main('1 file with unexpected hash')
706
707 class Test_wrong_zip_archive_sha384_hash(Main):
708 def __init__(self, q):
709 self._queue = q
710 self._testname = self.__class__.__name__
711 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-zip-archive-sha384-hash')
712 self._resultfile = os.path.join(self._testdir, 'a.out')
713 self._main('1 file with unexpected hash')
714
715 class Test_wrong_zip_archive_sha512_hash(Main):
716 def __init__(self, q):
717 self._queue = q
718 self._testname = self.__class__.__name__
719 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-zip-archive-sha512-hash')
720 self._resultfile = os.path.join(self._testdir, 'a.out')
721 self._main('1 file with unexpected hash')
722
723 class Test_wrong_file_uid_in_tar_archive(Main):
724 def __init__(self, q):
725 self._queue = q
726 self._testname = self.__class__.__name__
727 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-uid-in-tar-archive')
728 self._resultfile = os.path.join(self._testdir, 'a.out')
729 self._main('1 file with unexpected uid')
730
731 class Test_wrong_file_uid_in_tar_gz_archive(Main):
732 def __init__(self, q):
733 self._queue = q
734 self._testname = self.__class__.__name__
735 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-uid-in-tar-gz-archive')
736 self._resultfile = os.path.join(self._testdir, 'a.out')
737 self._main('1 file with unexpected uid')
738
739 class Test_wrong_file_uid_in_tar_bz2_archive(Main):
740 def __init__(self, q):
741 self._queue = q
742 self._testname = self.__class__.__name__
743 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-uid-in-tar-bz2-archive')
744 self._resultfile = os.path.join(self._testdir, 'a.out')
745 self._main('1 file with unexpected uid')
746
747 class Test_wrong_file_uid_in_tar_xz_archive(Main):
748 def __init__(self, q):
749 self._queue = q
750 self._testname = self.__class__.__name__
751 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-uid-in-tar-xz-archive')
752 self._resultfile = os.path.join(self._testdir, 'a.out')
753 self._main('1 file with unexpected uid')
754
755 class Test_wrong_file_uid_in_zip_archive(Main):
756 def __init__(self, q):
757 self._queue = q
758 self._testname = self.__class__.__name__
759 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-uid-in-zip-archive')
760 self._resultfile = os.path.join(self._testdir, 'a.out')
761 self._main('1 file with unexpected uid')
762
763 class Test_wrong_file_uid_in_tree(Main):
764 def __init__(self, q):
765 self._queue = q
766 self._testname = self.__class__.__name__
767 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-uid-in-tree')
768 self._resultfile = os.path.join(self._testdir, 'a.out')
769 self._main('1 file with unexpected uid')
770
771 class Test_wrong_file_gid_in_tar_archive(Main):
772 def __init__(self, q):
773 self._queue = q
774 self._testname = self.__class__.__name__
775 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-gid-in-tar-archive')
776 self._resultfile = os.path.join(self._testdir, 'a.out')
777 self._main('1 file with unexpected gid')
778
779 class Test_wrong_file_gid_in_tar_gz_archive(Main):
780 def __init__(self, q):
781 self._queue = q
782 self._testname = self.__class__.__name__
783 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-gid-in-tar-gz-archive')
784 self._resultfile = os.path.join(self._testdir, 'a.out')
785 self._main('1 file with unexpected gid')
786
787 class Test_wrong_file_gid_in_tar_bz2_archive(Main):
788 def __init__(self, q):
789 self._queue = q
790 self._testname = self.__class__.__name__
791 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-gid-in-tar-bz2-archive')
792 self._resultfile = os.path.join(self._testdir, 'a.out')
793 self._main('1 file with unexpected gid')
794
795 class Test_wrong_file_gid_in_tar_xz_archive(Main):
796 def __init__(self, q):
797 self._queue = q
798 self._testname = self.__class__.__name__
799 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-gid-in-tar-xz-archive')
800 self._resultfile = os.path.join(self._testdir, 'a.out')
801 self._main('1 file with unexpected gid')
802
803 class Test_wrong_file_gid_in_zip_archive(Main):
804 def __init__(self, q):
805 self._queue = q
806 self._testname = self.__class__.__name__
807 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-gid-in-zip-archive')
808 self._resultfile = os.path.join(self._testdir, 'a.out')
809 self._main('1 file with unexpected gid')
810
811 class Test_wrong_file_gid_in_tree(Main):
812 def __init__(self, q):
813 self._queue = q
814 self._testname = self.__class__.__name__
815 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-gid-in-tree')
816 self._resultfile = os.path.join(self._testdir, 'a.out')
817 self._main('1 file with unexpected gid')
818
819 class Test_unexpected_file_in_tar_archive(Main):
820 def __init__(self, q):
821 self._queue = q
822 self._testname = self.__class__.__name__
823 self._testdir = os.path.join(ABSPATH, 'functional-tests/unexpected-file-in-tar-archive')
824 self._resultfile = os.path.join(self._testdir, 'a.out')
825 self._main('1 unexpected file')
826
827 class Test_unexpected_file_in_tar_gz_archive(Main):
828 def __init__(self, q):
829 self._queue = q
830 self._testname = self.__class__.__name__
831 self._testdir = os.path.join(ABSPATH, 'functional-tests/unexpected-file-in-tar-gz-archive')
832 self._resultfile = os.path.join(self._testdir, 'a.out')
833 self._main('1 unexpected file')
834
835 class Test_unexpected_file_in_tar_bz2_archive(Main):
836 def __init__(self, q):
837 self._queue = q
838 self._testname = self.__class__.__name__
839 self._testdir = os.path.join(ABSPATH, 'functional-tests/unexpected-file-in-tar-bz2-archive')
840 self._resultfile = os.path.join(self._testdir, 'a.out')
841 self._main('1 unexpected file')
842
843 class Test_unexpected_file_in_tar_xz_archive(Main):
844 def __init__(self, q):
845 self._queue = q
846 self._testname = self.__class__.__name__
847 self._testdir = os.path.join(ABSPATH, 'functional-tests/unexpected-file-in-tar-xz-archive')
848 self._resultfile = os.path.join(self._testdir, 'a.out')
849 self._main('1 unexpected file')
850
851
852 class Test_unexpected_file_in_gzip_archive(Main):
853 def __init__(self, q):
854 self._queue = q
855 self._testname = self.__class__.__name__
856 self._testdir = os.path.join(ABSPATH, 'functional-tests/unexpected-file-in-gz-archive')
857 self._resultfile = os.path.join(self._testdir, 'a.out')
858 self._main('1 unexpected file')
859
860 class Test_unexpected_file_in_zip_archive(Main):
861 def __init__(self, q):
862 self._queue = q
863 self._testname = self.__class__.__name__
864 self._testdir = os.path.join(ABSPATH, 'functional-tests/unexpected-file-in-zip-archive')
865 self._resultfile = os.path.join(self._testdir, 'a.out')
866 self._main('1 unexpected file')
867
868 class Test_unexpected_file_in_tree(Main):
869 def __init__(self, q):
870 self._queue = q
871 self._testname = self.__class__.__name__
872 self._testdir = os.path.join(ABSPATH, 'functional-tests/unexpected-file-in-tree')
873 self._resultfile = os.path.join(self._testdir, 'a.out')
874 self._main('1 unexpected file')
875
876 class Test_wrong_file_md5_hash_in_tar_archive(Main):
877 def __init__(self, q):
878 self._queue = q
879 self._testname = self.__class__.__name__
880 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-md5-hash-in-tar-archive')
881 self._resultfile = os.path.join(self._testdir, 'a.out')
882 self._main('1 file with unexpected hash')
883
884 class Test_wrong_file_sha1_hash_in_tar_archive(Main):
885 def __init__(self, q):
886 self._queue = q
887 self._testname = self.__class__.__name__
888 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha1-hash-in-tar-archive')
889 self._resultfile = os.path.join(self._testdir, 'a.out')
890 self._main('1 file with unexpected hash')
891
892 class Test_wrong_file_sha224_hash_in_tar_archive(Main):
893 def __init__(self, q):
894 self._queue = q
895 self._testname = self.__class__.__name__
896 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha224-hash-in-tar-archive')
897 self._resultfile = os.path.join(self._testdir, 'a.out')
898 self._main('1 file with unexpected hash')
899
900 class Test_wrong_file_sha256_hash_in_tar_archive(Main):
901 def __init__(self, q):
902 self._queue = q
903 self._testname = self.__class__.__name__
904 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha256-hash-in-tar-archive')
905 self._resultfile = os.path.join(self._testdir, 'a.out')
906 self._main('1 file with unexpected hash')
907
908 class Test_wrong_file_sha384_hash_in_tar_archive(Main):
909 def __init__(self, q):
910 self._queue = q
911 self._testname = self.__class__.__name__
912 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha384-hash-in-tar-archive')
913 self._resultfile = os.path.join(self._testdir, 'a.out')
914 self._main('1 file with unexpected hash')
915
916 class Test_wrong_file_sha512_hash_in_tar_archive(Main):
917 def __init__(self, q):
918 self._queue = q
919 self._testname = self.__class__.__name__
920 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha512-hash-in-tar-archive')
921 self._resultfile = os.path.join(self._testdir, 'a.out')
922 self._main('1 file with unexpected hash')
923
924 class Test_wrong_file_md5_hash_in_tar_gz_archive(Main):
925 def __init__(self, q):
926 self._queue = q
927 self._testname = self.__class__.__name__
928 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-md5-hash-in-tar-gz-archive')
929 self._resultfile = os.path.join(self._testdir, 'a.out')
930 self._main('1 file with unexpected hash')
931
932 class Test_wrong_file_sha1_hash_in_tar_gz_archive(Main):
933 def __init__(self, q):
934 self._queue = q
935 self._testname = self.__class__.__name__
936 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha1-hash-in-tar-gz-archive')
937 self._resultfile = os.path.join(self._testdir, 'a.out')
938 self._main('1 file with unexpected hash')
939
940 class Test_wrong_file_sha224_hash_in_tar_gz_archive(Main):
941 def __init__(self, q):
942 self._queue = q
943 self._testname = self.__class__.__name__
944 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha224-hash-in-tar-gz-archive')
945 self._resultfile = os.path.join(self._testdir, 'a.out')
946 self._main('1 file with unexpected hash')
947
948 class Test_wrong_file_sha256_hash_in_tar_gz_archive(Main):
949 def __init__(self, q):
950 self._queue = q
951 self._testname = self.__class__.__name__
952 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha256-hash-in-tar-gz-archive')
953 self._resultfile = os.path.join(self._testdir, 'a.out')
954 self._main('1 file with unexpected hash')
955
956 class Test_wrong_file_sha384_hash_in_tar_gz_archive(Main):
957 def __init__(self, q):
958 self._queue = q
959 self._testname = self.__class__.__name__
960 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha384-hash-in-tar-gz-archive')
961 self._resultfile = os.path.join(self._testdir, 'a.out')
962 self._main('1 file with unexpected hash')
963
964 class Test_wrong_file_sha512_hash_in_tar_gz_archive(Main):
965 def __init__(self, q):
966 self._queue = q
967 self._testname = self.__class__.__name__
968 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha512-hash-in-tar-gz-archive')
969 self._resultfile = os.path.join(self._testdir, 'a.out')
970 self._main('1 file with unexpected hash')
971
972 class Test_wrong_file_md5_hash_in_tar_bz2_archive(Main):
973 def __init__(self, q):
974 self._queue = q
975 self._testname = self.__class__.__name__
976 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-md5-hash-in-tar-bz2-archive')
977 self._resultfile = os.path.join(self._testdir, 'a.out')
978 self._main('1 file with unexpected hash')
979
980 class Test_wrong_file_sha1_hash_in_tar_bz2_archive(Main):
981 def __init__(self, q):
982 self._queue = q
983 self._testname = self.__class__.__name__
984 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha1-hash-in-tar-bz2-archive')
985 self._resultfile = os.path.join(self._testdir, 'a.out')
986 self._main('1 file with unexpected hash')
987
988 class Test_wrong_file_sha224_hash_in_tar_bz2_archive(Main):
989 def __init__(self, q):
990 self._queue = q
991 self._testname = self.__class__.__name__
992 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha224-hash-in-tar-bz2-archive')
993 self._resultfile = os.path.join(self._testdir, 'a.out')
994 self._main('1 file with unexpected hash')
995
996 class Test_wrong_file_sha256_hash_in_tar_bz2_archive(Main):
997 def __init__(self, q):
998 self._queue = q
999 self._testname = self.__class__.__name__
1000 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha256-hash-in-tar-bz2-archive')
1001 self._resultfile = os.path.join(self._testdir, 'a.out')
1002 self._main('1 file with unexpected hash')
1003
1004 class Test_wrong_file_sha384_hash_in_tar_bz2_archive(Main):
1005 def __init__(self, q):
1006 self._queue = q
1007 self._testname = self.__class__.__name__
1008 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha384-hash-in-tar-bz2-archive')
1009 self._resultfile = os.path.join(self._testdir, 'a.out')
1010 self._main('1 file with unexpected hash')
1011
1012 class Test_wrong_file_sha512_hash_in_tar_bz2_archive(Main):
1013 def __init__(self, q):
1014 self._queue = q
1015 self._testname = self.__class__.__name__
1016 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha512-hash-in-tar-bz2-archive')
1017 self._resultfile = os.path.join(self._testdir, 'a.out')
1018 self._main('1 file with unexpected hash')
1019
1020 class Test_wrong_file_md5_hash_in_tar_xz_archive(Main):
1021 def __init__(self, q):
1022 self._queue = q
1023 self._testname = self.__class__.__name__
1024 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-md5-hash-in-tar-xz-archive')
1025 self._resultfile = os.path.join(self._testdir, 'a.out')
1026 self._main('1 file with unexpected hash')
1027
1028 class Test_wrong_file_sha1_hash_in_tar_xz_archive(Main):
1029 def __init__(self, q):
1030 self._queue = q
1031 self._testname = self.__class__.__name__
1032 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha1-hash-in-tar-xz-archive')
1033 self._resultfile = os.path.join(self._testdir, 'a.out')
1034 self._main('1 file with unexpected hash')
1035
1036 class Test_wrong_file_sha224_hash_in_tar_xz_archive(Main):
1037 def __init__(self, q):
1038 self._queue = q
1039 self._testname = self.__class__.__name__
1040 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha224-hash-in-tar-xz-archive')
1041 self._resultfile = os.path.join(self._testdir, 'a.out')
1042 self._main('1 file with unexpected hash')
1043
1044 class Test_wrong_file_sha256_hash_in_tar_xz_archive(Main):
1045 def __init__(self, q):
1046 self._queue = q
1047 self._testname = self.__class__.__name__
1048 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha256-hash-in-tar-xz-archive')
1049 self._resultfile = os.path.join(self._testdir, 'a.out')
1050 self._main('1 file with unexpected hash')
1051
1052 class Test_wrong_file_sha384_hash_in_tar_xz_archive(Main):
1053 def __init__(self, q):
1054 self._queue = q
1055 self._testname = self.__class__.__name__
1056 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha384-hash-in-tar-xz-archive')
1057 self._resultfile = os.path.join(self._testdir, 'a.out')
1058 self._main('1 file with unexpected hash')
1059
1060 class Test_wrong_file_sha512_hash_in_tar_xz_archive(Main):
1061 def __init__(self, q):
1062 self._queue = q
1063 self._testname = self.__class__.__name__
1064 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha512-hash-in-tar-xz-archive')
1065 self._resultfile = os.path.join(self._testdir, 'a.out')
1066 self._main('1 file with unexpected hash')
1067
1068 class Test_wrong_file_md5_hash_in_gzip_archive(Main):
1069 def __init__(self, q):
1070 self._queue = q
1071 self._testname = self.__class__.__name__
1072 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-md5-hash-in-gz-archive')
1073 self._resultfile = os.path.join(self._testdir, 'a.out')
1074 self._main('1 file with unexpected hash')
1075
1076 class Test_wrong_file_sha1_hash_in_gzip_archive(Main):
1077 def __init__(self, q):
1078 self._queue = q
1079 self._testname = self.__class__.__name__
1080 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha1-hash-in-gz-archive')
1081 self._resultfile = os.path.join(self._testdir, 'a.out')
1082 self._main('1 file with unexpected hash')
1083
1084 class Test_wrong_file_sha224_hash_in_gzip_archive(Main):
1085 def __init__(self, q):
1086 self._queue = q
1087 self._testname = self.__class__.__name__
1088 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha224-hash-in-gz-archive')
1089 self._resultfile = os.path.join(self._testdir, 'a.out')
1090 self._main('1 file with unexpected hash')
1091
1092 class Test_wrong_file_sha256_hash_in_gzip_archive(Main):
1093 def __init__(self, q):
1094 self._queue = q
1095 self._testname = self.__class__.__name__
1096 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha256-hash-in-gz-archive')
1097 self._resultfile = os.path.join(self._testdir, 'a.out')
1098 self._main('1 file with unexpected hash')
1099
1100 class Test_wrong_file_sha384_hash_in_gzip_archive(Main):
1101 def __init__(self, q):
1102 self._queue = q
1103 self._testname = self.__class__.__name__
1104 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha384-hash-in-gz-archive')
1105 self._resultfile = os.path.join(self._testdir, 'a.out')
1106 self._main('1 file with unexpected hash')
1107
1108 class Test_wrong_file_sha512_hash_in_gzip_archive(Main):
1109 def __init__(self, q):
1110 self._queue = q
1111 self._testname = self.__class__.__name__
1112 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha512-hash-in-gz-archive')
1113 self._resultfile = os.path.join(self._testdir, 'a.out')
1114 self._main('1 file with unexpected hash')
1115
1116 class Test_wrong_file_md5_hash_in_bzip2_archive(Main):
1117 def __init__(self, q):
1118 self._queue = q
1119 self._testname = self.__class__.__name__
1120 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-md5-hash-in-bzip2-archive')
1121 self._resultfile = os.path.join(self._testdir, 'a.out')
1122 self._main('1 file with unexpected hash')
1123
1124 class Test_wrong_file_sha1_hash_in_bzip2_archive(Main):
1125 def __init__(self, q):
1126 self._queue = q
1127 self._testname = self.__class__.__name__
1128 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha1-hash-in-bzip2-archive')
1129 self._resultfile = os.path.join(self._testdir, 'a.out')
1130 self._main('1 file with unexpected hash')
1131
1132 class Test_wrong_file_sha224_hash_in_bzip2_archive(Main):
1133 def __init__(self, q):
1134 self._queue = q
1135 self._testname = self.__class__.__name__
1136 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha224-hash-in-bzip2-archive')
1137 self._resultfile = os.path.join(self._testdir, 'a.out')
1138 self._main('1 file with unexpected hash')
1139
1140 class Test_wrong_file_sha256_hash_in_bzip2_archive(Main):
1141 def __init__(self, q):
1142 self._queue = q
1143 self._testname = self.__class__.__name__
1144 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha256-hash-in-bzip2-archive')
1145 self._resultfile = os.path.join(self._testdir, 'a.out')
1146 self._main('1 file with unexpected hash')
1147
1148 class Test_wrong_file_sha384_hash_in_bzip2_archive(Main):
1149 def __init__(self, q):
1150 self._queue = q
1151 self._testname = self.__class__.__name__
1152 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha384-hash-in-bzip2-archive')
1153 self._resultfile = os.path.join(self._testdir, 'a.out')
1154 self._main('1 file with unexpected hash')
1155
1156 class Test_wrong_file_sha512_hash_in_bzip2_archive(Main):
1157 def __init__(self, q):
1158 self._queue = q
1159 self._testname = self.__class__.__name__
1160 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha512-hash-in-bzip2-archive')
1161 self._resultfile = os.path.join(self._testdir, 'a.out')
1162 self._main('1 file with unexpected hash')
1163
1164 class Test_wrong_file_md5_hash_in_xz_archive(Main):
1165 def __init__(self, q):
1166 self._queue = q
1167 self._testname = self.__class__.__name__
1168 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-md5-hash-in-xz-archive')
1169 self._resultfile = os.path.join(self._testdir, 'a.out')
1170 self._main('1 file with unexpected hash')
1171
1172 class Test_wrong_file_sha1_hash_in_xz_archive(Main):
1173 def __init__(self, q):
1174 self._queue = q
1175 self._testname = self.__class__.__name__
1176 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha1-hash-in-xz-archive')
1177 self._resultfile = os.path.join(self._testdir, 'a.out')
1178 self._main('1 file with unexpected hash')
1179
1180 class Test_wrong_file_sha224_hash_in_xz_archive(Main):
1181 def __init__(self, q):
1182 self._queue = q
1183 self._testname = self.__class__.__name__
1184 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha224-hash-in-xz-archive')
1185 self._resultfile = os.path.join(self._testdir, 'a.out')
1186 self._main('1 file with unexpected hash')
1187
1188 class Test_wrong_file_sha256_hash_in_xz_archive(Main):
1189 def __init__(self, q):
1190 self._queue = q
1191 self._testname = self.__class__.__name__
1192 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha256-hash-in-xz-archive')
1193 self._resultfile = os.path.join(self._testdir, 'a.out')
1194 self._main('1 file with unexpected hash')
1195
1196 class Test_wrong_file_sha384_hash_in_xz_archive(Main):
1197 def __init__(self, q):
1198 self._queue = q
1199 self._testname = self.__class__.__name__
1200 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha384-hash-in-xz-archive')
1201 self._resultfile = os.path.join(self._testdir, 'a.out')
1202 self._main('1 file with unexpected hash')
1203
1204 class Test_wrong_file_sha512_hash_in_xz_archive(Main):
1205 def __init__(self, q):
1206 self._queue = q
1207 self._testname = self.__class__.__name__
1208 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha512-hash-in-xz-archive')
1209 self._resultfile = os.path.join(self._testdir, 'a.out')
1210 self._main('1 file with unexpected hash')
1211
1212 class Test_wrong_file_md5_hash_in_zip_archive(Main):
1213 def __init__(self, q):
1214 self._queue = q
1215 self._testname = self.__class__.__name__
1216 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-md5-hash-in-zip-archive')
1217 self._resultfile = os.path.join(self._testdir, 'a.out')
1218 self._main('1 file with unexpected hash')
1219
1220 class Test_wrong_file_sha1_hash_in_zip_archive(Main):
1221 def __init__(self, q):
1222 self._queue = q
1223 self._testname = self.__class__.__name__
1224 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha1-hash-in-zip-archive')
1225 self._resultfile = os.path.join(self._testdir, 'a.out')
1226 self._main('1 file with unexpected hash')
1227
1228 class Test_wrong_file_sha224_hash_in_zip_archive(Main):
1229 def __init__(self, q):
1230 self._queue = q
1231 self._testname = self.__class__.__name__
1232 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha224-hash-in-zip-archive')
1233 self._resultfile = os.path.join(self._testdir, 'a.out')
1234 self._main('1 file with unexpected hash')
1235
1236 class Test_wrong_file_sha256_hash_in_zip_archive(Main):
1237 def __init__(self, q):
1238 self._queue = q
1239 self._testname = self.__class__.__name__
1240 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha256-hash-in-zip-archive')
1241 self._resultfile = os.path.join(self._testdir, 'a.out')
1242 self._main('1 file with unexpected hash')
1243
1244 class Test_wrong_file_sha384_hash_in_zip_archive(Main):
1245 def __init__(self, q):
1246 self._queue = q
1247 self._testname = self.__class__.__name__
1248 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha384-hash-in-zip-archive')
1249 self._resultfile = os.path.join(self._testdir, 'a.out')
1250 self._main('1 file with unexpected hash')
1251
1252
1253 class Test_wrong_file_sha512_hash_in_zip_archive(Main):
1254 def __init__(self, q):
1255 self._queue = q
1256 self._testname = self.__class__.__name__
1257 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha512-hash-in-zip-archive')
1258 self._resultfile = os.path.join(self._testdir, 'a.out')
1259 self._main('1 file with unexpected hash')
1260
1261 class Test_wrong_file_md5_hash_in_tree(Main):
1262 def __init__(self, q):
1263 self._queue = q
1264 self._testname = self.__class__.__name__
1265 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-md5-hash-in-tree')
1266 self._resultfile = os.path.join(self._testdir, 'a.out')
1267 self._main('1 file with unexpected hash')
1268
1269 class Test_wrong_file_sha1_hash_in_tree(Main):
1270 def __init__(self, q):
1271 self._queue = q
1272 self._testname = self.__class__.__name__
1273 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha1-hash-in-tree')
1274 self._resultfile = os.path.join(self._testdir, 'a.out')
1275 self._main('1 file with unexpected hash')
1276
1277 class Test_wrong_file_sha224_hash_in_tree(Main):
1278 def __init__(self, q):
1279 self._queue = q
1280 self._testname = self.__class__.__name__
1281 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha224-hash-in-tree')
1282 self._resultfile = os.path.join(self._testdir, 'a.out')
1283 self._main('1 file with unexpected hash')
1284
1285 class Test_wrong_file_sha256_hash_in_tree(Main):
1286 def __init__(self, q):
1287 self._queue = q
1288 self._testname = self.__class__.__name__
1289 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha256-hash-in-tree')
1290 self._resultfile = os.path.join(self._testdir, 'a.out')
1291 self._main('1 file with unexpected hash')
1292
1293 class Test_wrong_file_sha384_hash_in_tree(Main):
1294 def __init__(self, q):
1295 self._queue = q
1296 self._testname = self.__class__.__name__
1297 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha384-hash-in-tree')
1298 self._resultfile = os.path.join(self._testdir, 'a.out')
1299 self._main('1 file with unexpected hash')
1300
1301 class Test_wrong_file_sha512_hash_in_tree(Main):
1302 def __init__(self, q):
1303 self._queue = q
1304 self._testname = self.__class__.__name__
1305 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-sha512-hash-in-tree')
1306 self._resultfile = os.path.join(self._testdir, 'a.out')
1307 self._main('1 file with unexpected hash')
1308
1309 class Test_wrong_file_mode_in_tar_gz_archive(Main):
1310 def __init__(self, q):
1311 self._queue = q
1312 self._testname = self.__class__.__name__
1313 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-mode-in-tar-gz-archive')
1314 self._resultfile = os.path.join(self._testdir, 'a.out')
1315 self._main('1 file with unexpected mode')
1316
1317 class Test_wrong_file_mode_in_tar_bz2_archive(Main):
1318 def __init__(self, q):
1319 self._queue = q
1320 self._testname = self.__class__.__name__
1321 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-mode-in-tar-bz2-archive')
1322 self._resultfile = os.path.join(self._testdir, 'a.out')
1323 self._main('1 file with unexpected mode')
1324
1325 class Test_wrong_file_mode_in_tar_xz_archive(Main):
1326 def __init__(self, q):
1327 self._queue = q
1328 self._testname = self.__class__.__name__
1329 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-mode-in-tar-xz-archive')
1330 self._resultfile = os.path.join(self._testdir, 'a.out')
1331 self._main('1 file with unexpected mode')
1332
1333 class Test_wrong_file_mode_in_zip_archive(Main):
1334 def __init__(self, q):
1335 self._queue = q
1336 self._testname = self.__class__.__name__
1337 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-mode-in-zip-archive')
1338 self._resultfile = os.path.join(self._testdir, 'a.out')
1339 self._main('1 file with unexpected mode')
1340
1341 class Test_wrong_file_mode_in_tree(Main):
1342 def __init__(self, q):
1343 self._queue = q
1344 self._testname = self.__class__.__name__
1345 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-mode-in-tree')
1346 self._resultfile = os.path.join(self._testdir, 'a.out')
1347 self._main('1 file with unexpected mode')
1348
1349 class Test_wrong_file_type_f_in_tar_gz_archive(Main):
1350 def __init__(self, q):
1351 self._queue = q
1352 self._testname = self.__class__.__name__
1353 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-f-in-tar-gz-archive')
1354 self._resultfile = os.path.join(self._testdir, 'a.out')
1355 self._main('1 file with unexpected type')
1356
1357 class Test_wrong_file_type_f_in_tar_bz2_archive(Main):
1358 def __init__(self, q):
1359 self._queue = q
1360 self._testname = self.__class__.__name__
1361 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-f-in-tar-bz2-archive')
1362 self._resultfile = os.path.join(self._testdir, 'a.out')
1363 self._main('1 file with unexpected type')
1364
1365 class Test_wrong_file_type_f_in_tar_xz_archive(Main):
1366 def __init__(self, q):
1367 self._queue = q
1368 self._testname = self.__class__.__name__
1369 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-f-in-tar-xz-archive')
1370 self._resultfile = os.path.join(self._testdir, 'a.out')
1371 self._main('1 file with unexpected type')
1372
1373 class Test_wrong_file_type_f_in_zip_archive(Main):
1374 def __init__(self, q):
1375 self._queue = q
1376 self._testname = self.__class__.__name__
1377 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-f-in-zip-archive')
1378 self._resultfile = os.path.join(self._testdir, 'a.out')
1379 self._main('1 file with unexpected type')
1380
1381
1382 class Test_wrong_file_type_f_in_tree(Main):
1383 def __init__(self, q):
1384 self._queue = q
1385 self._testname = self.__class__.__name__
1386 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-f-in-tree')
1387 self._resultfile = os.path.join(self._testdir, 'a.out')
1388 self._main('1 file with unexpected type')
1389
1390 class Test_wrong_file_type_d_in_tar_gz_archive(Main):
1391 def __init__(self, q):
1392 self._queue = q
1393 self._testname = self.__class__.__name__
1394 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-d-in-tar-gz-archive')
1395 self._resultfile = os.path.join(self._testdir, 'a.out')
1396 self._main('1 file with unexpected type')
1397
1398 class Test_wrong_file_type_d_in_tar_bz2_archive(Main):
1399 def __init__(self, q):
1400 self._queue = q
1401 self._testname = self.__class__.__name__
1402 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-d-in-tar-bz2-archive')
1403 self._resultfile = os.path.join(self._testdir, 'a.out')
1404 self._main('1 file with unexpected type')
1405
1406 class Test_wrong_file_type_d_in_tar_xz_archive(Main):
1407 def __init__(self, q):
1408 self._queue = q
1409 self._testname = self.__class__.__name__
1410 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-d-in-tar-xz-archive')
1411 self._resultfile = os.path.join(self._testdir, 'a.out')
1412 self._main('1 file with unexpected type')
1413
1414 class Test_wrong_file_type_d_in_zip_archive(Main):
1415 def __init__(self, q):
1416 self._queue = q
1417 self._testname = self.__class__.__name__
1418 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-d-in-zip-archive')
1419 self._resultfile = os.path.join(self._testdir, 'a.out')
1420 self._main('1 file with unexpected type')
1421
1422 class Test_wrong_file_type_d_in_tree(Main):
1423 def __init__(self, q):
1424 self._queue = q
1425 self._testname = self.__class__.__name__
1426 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-d-in-tree')
1427 self._resultfile = os.path.join(self._testdir, 'a.out')
1428 self._main('1 file with unexpected type')
1429
1430 class Test_wrong_file_type_s_in_tar_gz_archive(Main):
1431 def __init__(self, q):
1432 self._queue = q
1433 self._testname = self.__class__.__name__
1434 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-s-in-tar-gz-archive')
1435 self._resultfile = os.path.join(self._testdir, 'a.out')
1436 self._main('1 file with unexpected type')
1437
1438 class Test_wrong_file_type_s_in_tar_bz2_archive(Main):
1439 def __init__(self, q):
1440 self._queue = q
1441 self._testname = self.__class__.__name__
1442 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-s-in-tar-bz2-archive')
1443 self._resultfile = os.path.join(self._testdir, 'a.out')
1444 self._main('1 file with unexpected type')
1445
1446 class Test_wrong_file_type_s_in_tar_xz_archive(Main):
1447 def __init__(self, q):
1448 self._queue = q
1449 self._testname = self.__class__.__name__
1450 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-s-in-tar-xz-archive')
1451 self._resultfile = os.path.join(self._testdir, 'a.out')
1452 self._main('1 file with unexpected type')
1453
1454
1455 class Test_wrong_file_type_s_in_tree(Main):
1456 def __init__(self, q):
1457 self._queue = q
1458 self._testname = self.__class__.__name__
1459 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-s-in-tree')
1460 self._resultfile = os.path.join(self._testdir, 'a.out')
1461 self._main('1 file with unexpected type')
1462
1463 class Test_wrong_file_type_l_in_tar_gz_archive(Main):
1464 def __init__(self, q):
1465 self._queue = q
1466 self._testname = self.__class__.__name__
1467 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-l-in-tar-gz-archive')
1468 self._resultfile = os.path.join(self._testdir, 'a.out')
1469 self._main('1 file with unexpected type')
1470
1471 class Test_wrong_file_type_l_in_tar_bz2_archive(Main):
1472 def __init__(self, q):
1473 self._queue = q
1474 self._testname = self.__class__.__name__
1475 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-l-in-tar-bz2-archive')
1476 self._resultfile = os.path.join(self._testdir, 'a.out')
1477 self._main('1 file with unexpected type')
1478
1479 class Test_wrong_file_type_l_in_tar_xz_archive(Main):
1480 def __init__(self, q):
1481 self._queue = q
1482 self._testname = self.__class__.__name__
1483 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-l-in-tar-xz-archive')
1484 self._resultfile = os.path.join(self._testdir, 'a.out')
1485 self._main('1 file with unexpected type')
1486
1487
1488 class Test_wrong_file_type_l_in_tree(Main):
1489 def __init__(self, q):
1490 self._queue = q
1491 self._testname = self.__class__.__name__
1492 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-l-in-tree')
1493 __testsubdir = os.path.join(ABSPATH, 'functional-tests/wrong-file-type-l-in-tree/wrong-file-type-l-in-tree')
1494 __mockfile = os.path.join(__testsubdir, 'foo')
1495 __mocklink = os.path.join(__testsubdir, 'bar')
1496 if os.path.exists(__testsubdir):
1497 shutil.rmtree(__testsubdir)
1498 os.mkdir(__testsubdir)
1499 else:
1500 os.mkdir(__testsubdir)
1501 open(__mockfile, 'w')
1502 link(__mockfile, __mocklink)
1503 self._resultfile = os.path.join(self._testdir, 'a.out')
1504 self._main('1 file with unexpected type')
1505
1506 class Test_corrupted_tar_gz_archive(Main):
1507 def __init__(self, q):
1508 self._queue = q
1509 self._testname = self.__class__.__name__
1510 self._testdir = os.path.join(ABSPATH, 'functional-tests/corrupted-tar-gz-archive')
1511 self._resultfile = os.path.join(self._testdir, 'a.out')
1512 self._main('data corruption')
1513
1514 class Test_corrupted_tar_bz2_archive(Main):
1515 def __init__(self, q):
1516 self._queue = q
1517 self._testname = self.__class__.__name__
1518 self._testdir = os.path.join(ABSPATH, 'functional-tests/corrupted-tar-bz2-archive')
1519 self._resultfile = os.path.join(self._testdir, 'a.out')
1520 self._main('data corruption')
1521
1522 class Test_corrupted_tar_xz_archive(Main):
1523 def __init__(self, q):
1524 self._queue = q
1525 self._testname = self.__class__.__name__
1526 self._testdir = os.path.join(ABSPATH, 'functional-tests/corrupted-tar-xz-archive')
1527 self._resultfile = os.path.join(self._testdir, 'a.out')
1528 self._main('data corruption')
1529
1530 class Test_corrupted_gzip_archive(Main):
1531 def __init__(self, q):
1532 self._queue = q
1533 self._testname = self.__class__.__name__
1534 self._testdir = os.path.join(ABSPATH, 'functional-tests/corrupted-gz-archive')
1535 self._resultfile = os.path.join(self._testdir, 'a.out')
1536 self._main('data corruption')
1537
1538 class Test_corrupted_xz_archive(Main):
1539 def __init__(self, q):
1540 self._queue = q
1541 self._testname = self.__class__.__name__
1542 self._testdir = os.path.join(ABSPATH, 'functional-tests/corrupted-xz-archive')
1543 self._resultfile = os.path.join(self._testdir, 'a.out')
1544 self._main('data corruption')
1545
1546 class Test_corrupted_zip_archive(Main):
1547 def __init__(self, q):
1548 self._queue = q
1549 self._testname = self.__class__.__name__
1550 self._testdir = os.path.join(ABSPATH, 'functional-tests/corrupted-zip-archive')
1551 self._resultfile = os.path.join(self._testdir, 'a.out')
1552 self._main('data corruption')
1553
1554 class Test_two_confs_with_the_same_name(Main):
1555 def __init__(self, q):
1556 self.__queue = q
1557 self.__testname = self.__class__.__name__
1558 self.__testdir = os.path.join(ABSPATH, 'functional-tests/two_confs_with_the_same_name')
1559 self.__resultfile = os.path.join(self.__testdir, 'a.out')
1560 if 'PYTHONEXE' in environ:
1561 __command = ' '.join([PYTHONEXE, EXE, OPTCONFIG, self.__testdir, OPTLOG, self.__resultfile])
1562 else:
1563 __command = ' '.join([EXE, OPTCONFIG, self.__testdir, OPTLOG, self.__resultfile])
1564 __result = subprocess.getstatusoutput(__command)
1565 if __result[0] != 0 and 'Please rename it.' in __result[1]:
1566 self.__queue.put('{} - {}'.format(self.__testname, OKMSG))
1567 else:
1568 self.__queue.put('{} - {}return code:{}'.format(self.__testname, KOMSG, str(__result[0])))
1569
1570 class Test_expected_file_greater_than_file_in_tar_archive(Main):
1571 def __init__(self, q):
1572 self._queue = q
1573 self._testname = self.__class__.__name__
1574 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-greater-than-file-in-tar-archive')
1575 self._resultfile = os.path.join(self._testdir, 'a.out')
1576 self._main('1 file smaller than expected')
1577
1578 class Test_expected_file_greater_than_file_in_tar_gz_archive(Main):
1579 def __init__(self, q):
1580 self._queue = q
1581 self._testname = self.__class__.__name__
1582 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-greater-than-file-in-tar-gz-archive')
1583 self._resultfile = os.path.join(self._testdir, 'a.out')
1584 self._main('1 file smaller than expected')
1585
1586 class Test_expected_file_greater_than_file_in_tar_bz2_archive(Main):
1587 def __init__(self, q):
1588 self._queue = q
1589 self._testname = self.__class__.__name__
1590 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-greater-than-file-in-tar-bz2-archive')
1591 self._resultfile = os.path.join(self._testdir, 'a.out')
1592 self._main('1 file smaller than expected')
1593
1594 class Test_expected_file_greater_than_file_in_tar_xz_archive(Main):
1595 def __init__(self, q):
1596 self._queue = q
1597 self._testname = self.__class__.__name__
1598 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-greater-than-file-in-tar-xz-archive')
1599 self._resultfile = os.path.join(self._testdir, 'a.out')
1600 self._main('1 file smaller than expected')
1601
1602 class Test_expected_file_greater_than_file_in_gzip_archive(Main):
1603 def __init__(self, q):
1604 self._queue = q
1605 self._testname = self.__class__.__name__
1606 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-greater-than-file-in-gz-archive')
1607 self._resultfile = os.path.join(self._testdir, 'a.out')
1608 self._main('1 file smaller than expected')
1609
1610 class Test_expected_file_greater_than_file_in_zip_archive(Main):
1611 def __init__(self, q):
1612 self._queue = q
1613 self._testname = self.__class__.__name__
1614 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-greater-than-file-in-zip-archive')
1615 self._resultfile = os.path.join(self._testdir, 'a.out')
1616 self._main('1 file smaller than expected')
1617
1618 class Test_expected_file_greater_than_file_in_tree(Main):
1619 def __init__(self, q):
1620 self._queue = q
1621 self._testname = self.__class__.__name__
1622 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-greater-than-file-in-tree')
1623 self._resultfile = os.path.join(self._testdir, 'a.out')
1624 self._main('1 file smaller than expected')
1625
1626 class Test_expected_file_smaller_than_file_in_tar_archive(Main):
1627 def __init__(self, q):
1628 self._queue = q
1629 self._testname = self.__class__.__name__
1630 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-smaller-than-file-in-tar-archive')
1631 self._resultfile = os.path.join(self._testdir, 'a.out')
1632 self._main('1 file bigger than expected')
1633
1634 class Test_expected_file_smaller_than_file_in_tar_gz_archive(Main):
1635 def __init__(self, q):
1636 self._queue = q
1637 self._testname = self.__class__.__name__
1638 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-smaller-than-file-in-tar-gz-archive')
1639 self._resultfile = os.path.join(self._testdir, 'a.out')
1640 self._main('1 file bigger than expected')
1641
1642 class Test_expected_file_smaller_than_file_in_tar_bz2_archive(Main):
1643 def __init__(self, q):
1644 self._queue = q
1645 self._testname = self.__class__.__name__
1646 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-smaller-than-file-in-tar-bz2-archive')
1647 self._resultfile = os.path.join(self._testdir, 'a.out')
1648 self._main('1 file bigger than expected')
1649
1650 class Test_expected_file_smaller_than_file_in_tar_xz_archive(Main):
1651 def __init__(self, q):
1652 self._queue = q
1653 self._testname = self.__class__.__name__
1654 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-smaller-than-file-in-tar-xz-archive')
1655 self._resultfile = os.path.join(self._testdir, 'a.out')
1656 self._main('1 file bigger than expected')
1657
1658 class Test_expected_file_smaller_than_file_in_gzip_archive(Main):
1659 def __init__(self, q):
1660 self._queue = q
1661 self._testname = self.__class__.__name__
1662 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-smaller-than-file-in-gz-archive')
1663 self._resultfile = os.path.join(self._testdir, 'a.out')
1664 self._main('1 file bigger than expected')
1665
1666 class Test_expected_file_smaller_than_file_in_zip_archive(Main):
1667 def __init__(self, q):
1668 self._queue = q
1669 self._testname = self.__class__.__name__
1670 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-smaller-than-file-in-zip-archive')
1671 self._resultfile = os.path.join(self._testdir, 'a.out')
1672 self._main('1 file bigger than expected')
1673
1674 class Test_expected_file_smaller_than_file_in_tree(Main):
1675 def __init__(self, q):
1676 self._queue = q
1677 self._testname = self.__class__.__name__
1678 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-smaller-than-file-in-tree')
1679 self._resultfile = os.path.join(self._testdir, 'a.out')
1680 self._main('1 file bigger than expected')
1681
1682 class Test_expected_file_not_equals_file_in_tar_archive(Main):
1683 def __init__(self, q):
1684 self._queue = q
1685 self._testname = self.__class__.__name__
1686 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-not-equals-file-in-tar-archive')
1687 self._resultfile = os.path.join(self._testdir, 'a.out')
1688 self._main('1 file with unexpected size')
1689
1690 class Test_expected_file_not_equals_file_in_tar_gz_archive(Main):
1691 def __init__(self, q):
1692 self._queue = q
1693 self._testname = self.__class__.__name__
1694 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-not-equals-file-in-tar-gz-archive')
1695 self._resultfile = os.path.join(self._testdir, 'a.out')
1696 self._main('1 file with unexpected size')
1697
1698 class Test_expected_file_not_equals_file_in_tar_bz2_archive(Main):
1699 def __init__(self, q):
1700 self._queue = q
1701 self._testname = self.__class__.__name__
1702 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-not-equals-file-in-tar-bz2-archive')
1703 self._resultfile = os.path.join(self._testdir, 'a.out')
1704 self._main('1 file with unexpected size')
1705
1706 class Test_expected_file_not_equals_file_in_tar_xz_archive(Main):
1707 def __init__(self, q):
1708 self._queue = q
1709 self._testname = self.__class__.__name__
1710 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-not-equals-file-in-tar-xz-archive')
1711 self._resultfile = os.path.join(self._testdir, 'a.out')
1712 self._main('1 file with unexpected size')
1713
1714 class Test_expected_file_not_equals_file_in_gzip_archive(Main):
1715 def __init__(self, q):
1716 self._queue = q
1717 self._testname = self.__class__.__name__
1718 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-not-equals-file-in-gz-archive')
1719 self._resultfile = os.path.join(self._testdir, 'a.out')
1720 self._main('1 file with unexpected size')
1721
1722 class Test_expected_file_not_equals_file_in_zip_archive(Main):
1723 def __init__(self, q):
1724 self._queue = q
1725 self._testname = self.__class__.__name__
1726 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-not-equals-file-in-zip-archive')
1727 self._resultfile = os.path.join(self._testdir, 'a.out')
1728 self._main('1 file with unexpected size')
1729
1730 class Test_expected_file_not_equals_file_in_tree(Main):
1731 def __init__(self, q):
1732 self._queue = q
1733 self._testname = self.__class__.__name__
1734 self._testdir = os.path.join(ABSPATH, 'functional-tests/expected-file-not-equals-file-in-tree')
1735 self._resultfile = os.path.join(self._testdir, 'a.out')
1736 self._main('1 file with unexpected size')
1737
1738 class Test_mixing_dir_path_and_archive_type_in_conf(Main):
1739 '''Check if the configuration path indicates a directory while
1740 the type of the backup is an archive
1741 '''
1742 def __init__(self, q):
1743 self.__queue = q
1744 self.__testname = self.__class__.__name__
1745 self.__testdir = os.path.join(ABSPATH, 'functional-tests/mixing-dir-path-and-archive-type-in-conf')
1746 self.__resultfile = os.path.join(self.__testdir, 'a.out')
1747 if 'PYTHONEXE' in environ:
1748 __command = ' '.join([PYTHONEXE, EXE, OPTCONFIG, self.__testdir, OPTLOG, self.__resultfile])
1749 else:
1750 __command = ' '.join([EXE, OPTCONFIG, self.__testdir, OPTLOG, self.__resultfile])
1751 __result = subprocess.getstatusoutput(__command)
1752 if __result[0] != 0 and 'is a directory but appears as an archive' in __result[1]:
1753 self.__queue.put('{} - {}'.format(self.__testname, OKMSG))
1754 else:
1755 self.__queue.put('{} - {}return code:{}'.format(self.__testname, KOMSG, str(__result[0])))
1756
1757 class Test_full_criteria_multiple_backups:
1758 '''Check all the itemps for a tar.gz, tar.bz2, gzip, zip and tree'''
1759 def __init__(self, q):
1760 __queue = q
1761 __res = True
1762 __testname = self.__class__.__name__
1763 __testdir = os.path.join(ABSPATH, 'functional-tests/full-criteria-multiple-backups')
1764 __resultfile = os.path.join(__testdir, 'a.out')
1765 if 'PYTHONEXE' in environ:
1766 __retcode = subprocess.call([PYTHONEXE, EXE, OPTCONFIG, __testdir, OPTLOG, __resultfile])
1767 else:
1768 __retcode = subprocess.call([EXE, OPTCONFIG, __testdir, OPTLOG, __resultfile])
1769 if __retcode != 0:
1770 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
1771 else:
1772 with open(__resultfile, 'r') as __file:
1773 __conditions = {'file missing in': 0,
1774 'with unexpected mode': 0,
1775 'with unexpected uid': 0,
1776 'with unexpected gid': 0,
1777 'with unexpected hash while checking': 0,
1778 'bigger than': 0,
1779 }
1780 for __line in __file.readlines():
1781 for __condition in __conditions:
1782 if __condition in __line:
1783 __conditions[__condition] += 1
1784 for __condition in __conditions:
1785 if __conditions[__condition] != 5:
1786 __res = False
1787 if __res:
1788 __queue.put('{} - {}'.format(__testname, OKMSG))
1789 else:
1790 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
1791
1792 class Test_name_in_gzip_and_gzip_archive_are_not_the_same(Main):
1793 def __init__(self, q):
1794 self._queue = q
1795 self._testname = self.__class__.__name__
1796 self._testdir = os.path.join(ABSPATH, 'functional-tests/name-in-gzip-and-gzip-archive-are-not-the-same')
1797 self._resultfile = os.path.join(self._testdir, 'a.out')
1798 self._main('unexpected file checking')
1799
1800 class Test_unsupported_parameters_for_gz_archive:
1801 '''Check for unsupported parameters for a gz archive'''
1802 def __init__(self, q):
1803 __queue = q
1804 __res = True
1805 __testname = self.__class__.__name__
1806 __testdir = os.path.join(ABSPATH, 'functional-tests/unsupported-parameters-gz-archive')
1807 __resultfile = os.path.join(__testdir, 'a.out')
1808 if 'PYTHONEXE' in environ:
1809 __retcode = subprocess.call([PYTHONEXE, EXE, OPTCONFIG, __testdir, OPTLOG, __resultfile])
1810 else:
1811 __retcode = subprocess.call([EXE, OPTCONFIG, __testdir, OPTLOG, __resultfile])
1812 if __retcode != 0:
1813 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
1814 else:
1815 with open(__resultfile, 'r') as __file:
1816 __conditions = {'Ignoring it': 0,
1817 }
1818 for __line in __file.readlines():
1819 for __condition in __conditions:
1820 if __condition in __line:
1821 __conditions[__condition] += 1
1822 for __condition in __conditions:
1823 if __conditions[__condition] != 3:
1824 __res = False
1825 if __res:
1826 __queue.put('{} - {}'.format(__testname, OKMSG))
1827 else:
1828 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
1829
1830 class Test_unsupported_parameters_for_bz2_archive:
1831 '''Check for unsupported parameters for a bzip2 archive'''
1832 def __init__(self, q):
1833 __queue = q
1834 __res = True
1835 __testname = self.__class__.__name__
1836 __testdir = os.path.join(ABSPATH, 'functional-tests/unsupported-parameters-bz2-archive')
1837 __resultfile = os.path.join(__testdir, 'a.out')
1838 if 'PYTHONEXE' in environ:
1839 __retcode = subprocess.call([PYTHONEXE, EXE, OPTCONFIG, __testdir, OPTLOG, __resultfile])
1840 else:
1841 __retcode = subprocess.call([EXE, OPTCONFIG, __testdir, OPTLOG, __resultfile])
1842 if __retcode != 0:
1843 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
1844 else:
1845 with open(__resultfile, 'r') as __file:
1846 __conditions = {'Ignoring it': 0,
1847 }
1848 for __line in __file.readlines():
1849 for __condition in __conditions:
1850 if __condition in __line:
1851 __conditions[__condition] += 1
1852 for __condition in __conditions:
1853 if __conditions[__condition] != 4:
1854 __res = False
1855 if __res:
1856 __queue.put('{} - {}'.format(__testname, OKMSG))
1857 else:
1858 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
1859
1860 class Test_unsupported_parameters_for_xz_archive:
1861 '''Check for unsupported parameters for a xz archive'''
1862 def __init__(self, q):
1863 __queue = q
1864 __res = True
1865 __testname = self.__class__.__name__
1866 __testdir = os.path.join(ABSPATH, 'functional-tests/unsupported-parameters-xz-archive')
1867 __resultfile = os.path.join(__testdir, 'a.out')
1868 if 'PYTHONEXE' in environ:
1869 __retcode = subprocess.call([PYTHONEXE, EXE, OPTCONFIG, __testdir, OPTLOG, __resultfile])
1870 else:
1871 __retcode = subprocess.call([EXE, OPTCONFIG, __testdir, OPTLOG, __resultfile])
1872 if __retcode != 0:
1873 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
1874 else:
1875 with open(__resultfile, 'r') as __file:
1876 __conditions = {'Ignoring it': 0,
1877 }
1878 for __line in __file.readlines():
1879 for __condition in __conditions:
1880 if __condition in __line:
1881 __conditions[__condition] += 1
1882 for __condition in __conditions:
1883 if __conditions[__condition] != 4:
1884 __res = False
1885 if __res:
1886 __queue.put('{} - {}'.format(__testname, OKMSG))
1887 else:
1888 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
1889
1890 class Test_unsupported_parameters_for_zip_archive:
1891 '''Check for unsupported parameters for a zip archive'''
1892 def __init__(self, q):
1893 __queue = q
1894 __res = True
1895 __testname = self.__class__.__name__
1896 __testdir = os.path.join(ABSPATH, 'functional-tests/unsupported-parameters-zip-archive')
1897 __resultfile = os.path.join(__testdir, 'a.out')
1898 if 'PYTHONEXE' in environ:
1899 __retcode = subprocess.call([PYTHONEXE, EXE, OPTCONFIG, __testdir, OPTLOG, __resultfile])
1900 else:
1901 __retcode = subprocess.call([EXE, OPTCONFIG, __testdir, OPTLOG, __resultfile])
1902 if __retcode != 0:
1903 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
1904 else:
1905 with open(__resultfile, 'r') as __file:
1906 __conditions = {'Ignoring it': 0,
1907 }
1908 for __line in __file.readlines():
1909 for __condition in __conditions:
1910 if __condition in __line:
1911 __conditions[__condition] += 1
1912 for __condition in __conditions:
1913 if __conditions[__condition] != 1:
1914 __res = False
1915 if __res:
1916 __queue.put('{} - {}'.format(__testname, OKMSG))
1917 else:
1918 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
1919
1920 class Test_generate_list_for_tar_archive:
1921 '''Check the expected result for list of files generated from a tar archive'''
1922 def __init__(self, q):
1923 __queue = q
1924 __res = True
1925 __testname = self.__class__.__name__
1926 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-from-tar-archive')
1927 __archive = os.path.join(__testdir, 'generate-list-from-tar-archive.tar.gz')
1928 __resultfile = os.path.join(__testdir, 'generate-list-from-tar-archive.list')
1929 if 'PYTHONEXE' in environ:
1930 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
1931 else:
1932 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
1933 if __retcode != 0:
1934 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
1935 else:
1936 with open(__resultfile, 'r') as __file:
1937 __conditions = {'=': 0,
1938 'uid': 0,
1939 'gid': 0,
1940 'type': 0,
1941 'mode': 0,
1942 'md5': 2
1943 }
1944 for __line in __file.readlines():
1945 for __condition in __conditions:
1946 if __condition in __line:
1947 __conditions[__condition] += 1
1948 for __condition in __conditions:
1949 if __conditions[__condition] != 6:
1950 __res = False
1951 if __res:
1952 __queue.put('{} - {}'.format(__testname, OKMSG))
1953 else:
1954 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
1955
1956 class Test_generate_list_for_zip_archive:
1957 '''Check the expected result for list of files generated from a zip archive'''
1958 def __init__(self, q):
1959 __queue = q
1960 __res = True
1961 __testname = self.__class__.__name__
1962 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-from-zip-archive')
1963 __archive = os.path.join(__testdir, 'generate-list-from-zip-archive.zip')
1964 __resultfile = os.path.join(__testdir, 'generate-list-from-zip-archive.list')
1965 if 'PYTHONEXE' in environ:
1966 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
1967 else:
1968 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
1969 if __retcode != 0:
1970 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
1971 else:
1972 with open(__resultfile, 'r') as __file:
1973 __conditions = {'=': 0,
1974 'uid': 0,
1975 'gid': 0,
1976 'type': 0,
1977 'mode': 0
1978 }
1979 for __line in __file.readlines():
1980 for __condition in __conditions:
1981 if __condition in __line:
1982 __conditions[__condition] += 1
1983 for __condition in __conditions:
1984 if __conditions[__condition] != 6:
1985 __res = False
1986 if __res:
1987 __queue.put('{} - {}'.format(__testname, OKMSG))
1988 else:
1989 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
1990
1991 class Test_generate_list_for_tree:
1992 '''Check the expected result for list of files generated from a tree of files'''
1993 def __init__(self, q):
1994 __queue = q
1995 __res = True
1996 __testname = self.__class__.__name__
1997 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-from-tree')
1998 __archive = os.path.join(__testdir, 'generate-list-from-tree')
1999 __resultfile = os.path.join(__testdir, 'generate-list-from-tree.list')
2000 if 'PYTHONEXE' in environ:
2001 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2002 else:
2003 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2004 if __retcode != 0:
2005 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2006 else:
2007 with open(__resultfile, 'r') as __file:
2008 __conditions = {'=': 0,
2009 'uid': 0,
2010 'gid': 0,
2011 'type': 0,
2012 'mode': 0
2013 }
2014 for __line in __file.readlines():
2015 for __condition in __conditions:
2016 if __condition in __line:
2017 __conditions[__condition] += 1
2018 for __condition in __conditions:
2019 if __conditions[__condition] != 5:
2020 __res = False
2021 if __res:
2022 __queue.put('{} - {}'.format(__testname, OKMSG))
2023 else:
2024 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2025
2026 class Test_generate_list_for_bzip2:
2027 '''Check the expected result for list of files generated from a bzip2 archive'''
2028 def __init__(self, q):
2029 __queue = q
2030 __res = True
2031 __testname = self.__class__.__name__
2032 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-from-bzip2-archive')
2033 __archive = os.path.join(__testdir, 'generate-list-from-bzip2-archive.bz2')
2034 __resultfile = os.path.join(__testdir, 'generate-list-from-bzip2-archive.list')
2035 if 'PYTHONEXE' in environ:
2036 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2037 else:
2038 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2039 if __retcode != 0:
2040 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2041 else:
2042 with open(__resultfile, 'r') as __file:
2043 __conditions = {'type': 0,
2044 'md5':0
2045 }
2046 for __line in __file.readlines():
2047 for __condition in __conditions:
2048 if __condition in __line:
2049 __conditions[__condition] += 1
2050 for __condition in __conditions:
2051 if __conditions[__condition] != 1:
2052 __res = False
2053 if __res:
2054 __queue.put('{} - {}'.format(__testname, OKMSG))
2055 else:
2056 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2057
2058 class Test_generate_list_for_xz:
2059 '''Check the expected result for list of files generated from a xz archive'''
2060 def __init__(self, q):
2061 __queue = q
2062 __res = True
2063 __testname = self.__class__.__name__
2064 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-from-xz-archive')
2065 __archive = os.path.join(__testdir, 'generate-list-from-xz-archive.xz')
2066 __resultfile = os.path.join(__testdir, 'generate-list-from-xz-archive.list')
2067 if 'PYTHONEXE' in environ:
2068 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2069 else:
2070 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2071 if __retcode != 0:
2072 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2073 else:
2074 with open(__resultfile, 'r') as __file:
2075 __conditions = {'type': 0,
2076 'md5':0
2077 }
2078 for __line in __file.readlines():
2079 for __condition in __conditions:
2080 if __condition in __line:
2081 __conditions[__condition] += 1
2082 for __condition in __conditions:
2083 if __conditions[__condition] != 1:
2084 __res = False
2085 if __res:
2086 __queue.put('{} - {}'.format(__testname, OKMSG))
2087 else:
2088 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2089
2090 class Test_generate_list_for_gzip:
2091 '''Check the expected result for list of files generated from a gzip archive'''
2092 def __init__(self, q):
2093 __queue = q
2094 __res = True
2095 __testname = self.__class__.__name__
2096 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-from-gzip-archive')
2097 __archive = os.path.join(__testdir, 'generate-list-from-gzip-archive.gz')
2098 __resultfile = os.path.join(__testdir, 'generate-list-from-gzip-archive.list')
2099 if 'PYTHONEXE' in environ:
2100 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2101 else:
2102 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2103 if __retcode != 0:
2104 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2105 else:
2106 with open(__resultfile, 'r') as __file:
2107 __conditions = {'=': 0,
2108 'type': 0,
2109 'md5':0
2110 }
2111 for __line in __file.readlines():
2112 for __condition in __conditions:
2113 if __condition in __line:
2114 __conditions[__condition] += 1
2115 for __condition in __conditions:
2116 if __conditions[__condition] != 1:
2117 __res = False
2118 if __res:
2119 __queue.put('{} - {}'.format(__testname, OKMSG))
2120 else:
2121 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2122
2123 class Test_expected_generated_list_for_tar_archive:
2124 '''Compare the generated list and the expected list for a tar archive'''
2125 def __init__(self, q):
2126 __queue = q
2127 __res = True
2128 __testname = self.__class__.__name__
2129 __testdir = os.path.join(ABSPATH, 'functional-tests/expected-generated-list-for-tar-archive')
2130 __archive = os.path.join(__testdir, 'expected-generated-list-for-tar-archive.tar.gz')
2131 __resultfile = os.path.join(__testdir, 'expected-generated-list-for-tar-archive.list')
2132 if 'PYTHONEXE' in environ:
2133 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2134 else:
2135 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2136 if __retcode != 0:
2137 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2138 else:
2139 if hashlib.md5(open(__resultfile, 'rb').read()).hexdigest() != hashlib.md5(open(os.path.join(__testdir, 'expectedlist.list'), 'rb').read()).hexdigest():
2140 __res = False
2141 else:
2142 __res = True
2143 if __res:
2144 __queue.put('{} - {}'.format(__testname, OKMSG))
2145 else:
2146 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2147
2148 class Test_expected_generated_list_for_gzip_archive:
2149 '''Compare the generated list and the expected list for a gzip archive'''
2150 def __init__(self, q):
2151 __queue = q
2152 __res = True
2153 __testname = self.__class__.__name__
2154 __testdir = os.path.join(ABSPATH, 'functional-tests/expected-generated-list-for-gzip-archive')
2155 __archive = os.path.join(__testdir, 'expected-generated-list-for-gzip-archive.gz')
2156 __resultfile = os.path.join(__testdir, 'expected-generated-list-for-gzip-archive.list')
2157 if 'PYTHONEXE' in environ:
2158 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2159 else:
2160 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2161 if __retcode != 0:
2162 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2163 else:
2164 if hashlib.md5(open(__resultfile, 'rb').read()).hexdigest() != hashlib.md5(open(os.path.join(__testdir, 'expectedlist.list'), 'rb').read()).hexdigest():
2165 __res = False
2166 else:
2167 __res = True
2168 if __res:
2169 __queue.put('{} - {}'.format(__testname, OKMSG))
2170 else:
2171 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2172
2173 class Test_expected_generated_list_for_xz_archive:
2174 '''Compare the generated list and the expected list for a xz archive'''
2175 def __init__(self, q):
2176 __queue = q
2177 __res = True
2178 __testname = self.__class__.__name__
2179 __testdir = os.path.join(ABSPATH, 'functional-tests/expected-generated-list-for-xz-archive')
2180 __archive = os.path.join(__testdir, 'expected-generated-list-for-xz-archive.xz')
2181 __resultfile = os.path.join(__testdir, 'expected-generated-list-for-xz-archive.list')
2182 if 'PYTHONEXE' in environ:
2183 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2184 else:
2185 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2186 if __retcode != 0:
2187 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2188 else:
2189 if hashlib.md5(open(__resultfile, 'rb').read()).hexdigest() != hashlib.md5(open(os.path.join(__testdir, 'expectedlist.list'), 'rb').read()).hexdigest():
2190 __res = False
2191 else:
2192 __res = True
2193 if __res:
2194 __queue.put('{} - {}'.format(__testname, OKMSG))
2195 else:
2196 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2197
2198 class Test_expected_generated_list_for_bzip2_archive:
2199 '''Compare the generated list and the expected list for a bzip2 archive'''
2200 def __init__(self, q):
2201 __queue = q
2202 __res = True
2203 __testname = self.__class__.__name__
2204 __testdir = os.path.join(ABSPATH, 'functional-tests/expected-generated-list-for-bzip2-archive')
2205 __archive = os.path.join(__testdir, 'expected-generated-list-for-bzip2-archive.bz2')
2206 __resultfile = os.path.join(__testdir, 'expected-generated-list-for-bzip2-archive.list')
2207 if 'PYTHONEXE' in environ:
2208 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2209 else:
2210 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2211 if __retcode != 0:
2212 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2213 else:
2214 if hashlib.md5(open(__resultfile, 'rb').read()).hexdigest() != hashlib.md5(open(os.path.join(__testdir, 'expectedlist.list'), 'rb').read()).hexdigest():
2215 __res = False
2216 else:
2217 __res = True
2218 if __res:
2219 __queue.put('{} - {}'.format(__testname, OKMSG))
2220 else:
2221 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2222
2223 class Test_generate_list_and_parse_tar_archive(MainGenerateParse):
2224 '''Generate a list of files inside the tar archive and parse this one right after'''
2225 def __init__(self, q):
2226 __queue = q
2227 __res = True
2228 __testname = self.__class__.__name__
2229 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-and-parse-tar-archive')
2230 __archive = os.path.join(__testdir, 'generate-list-and-parse-tar-archive.tar.gz')
2231 __resultfile = os.path.join(__testdir, 'generate-list-and-parse-tar-archive.list')
2232 if 'PYTHONEXE' in environ:
2233 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2234 else:
2235 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2236 if __retcode != 0:
2237 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2238 else:
2239 self._queue = q
2240 self._testname = __testname
2241 self._testdir = __testdir
2242 self._resultfile = os.path.join(self._testdir, 'a.out')
2243 self._main('')
2244
2245 class Test_generate_list_and_parse_tgz_archive(MainGenerateParse):
2246 '''Generate a list of files inside the tgz (same as tar.gz) archive and parse this one right after'''
2247 def __init__(self, q):
2248 __queue = q
2249 __res = True
2250 __testname = self.__class__.__name__
2251 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-and-parse-tgz-archive')
2252 __archive = os.path.join(__testdir, 'generate-list-and-parse-tgz-archive.tgz')
2253 __resultfile = os.path.join(__testdir, 'generate-list-and-parse-tgz-archive.list')
2254 if 'PYTHONEXE' in environ:
2255 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2256 else:
2257 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2258 if __retcode != 0:
2259 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2260 else:
2261 self._queue = q
2262 self._testname = __testname
2263 self._testdir = __testdir
2264 self._resultfile = os.path.join(self._testdir, 'a.out')
2265 self._main('')
2266
2267 class Test_generate_list_and_parse_tbz_archive(MainGenerateParse):
2268 '''Generate a list of files inside the tbz (same as tar.bz2) archive and parse this one right after'''
2269 def __init__(self, q):
2270 __queue = q
2271 __res = True
2272 __testname = self.__class__.__name__
2273 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-and-parse-tbz-archive')
2274 __archive = os.path.join(__testdir, 'generate-list-and-parse-tbz-archive.tbz')
2275 __resultfile = os.path.join(__testdir, 'generate-list-and-parse-tbz-archive.list')
2276 if 'PYTHONEXE' in environ:
2277 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2278 else:
2279 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2280 if __retcode != 0:
2281 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2282 else:
2283 self._queue = q
2284 self._testname = __testname
2285 self._testdir = __testdir
2286 self._resultfile = os.path.join(self._testdir, 'a.out')
2287 self._main('')
2288
2289 class Test_generate_list_and_parse_tbz2_archive(MainGenerateParse):
2290 '''Generate a list of files inside the tbz2 (same as tar.bz2) archive and parse this one right after'''
2291 def __init__(self, q):
2292 __queue = q
2293 __res = True
2294 __testname = self.__class__.__name__
2295 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-and-parse-tbz2-archive')
2296 __archive = os.path.join(__testdir, 'generate-list-and-parse-tbz2-archive.tbz2')
2297 __resultfile = os.path.join(__testdir, 'generate-list-and-parse-tbz2-archive.list')
2298 if 'PYTHONEXE' in environ:
2299 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2300 else:
2301 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2302 if __retcode != 0:
2303 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2304 else:
2305 self._queue = q
2306 self._testname = __testname
2307 self._testdir = __testdir
2308 self._resultfile = os.path.join(self._testdir, 'a.out')
2309 self._main('')
2310
2311 class Test_generate_list_and_parse_zip_archive(MainGenerateParse):
2312 '''Generate a list of files inside the zip archive and parse this one right after'''
2313 def __init__(self, q):
2314 __queue = q
2315 __res = True
2316 __testname = self.__class__.__name__
2317 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-and-parse-zip-archive')
2318 __archive = os.path.join(__testdir, 'generate-list-and-parse-zip-archive.zip')
2319 __resultfile = os.path.join(__testdir, 'generate-list-and-parse-zip-archive.list')
2320 if 'PYTHONEXE' in environ:
2321 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2322 else:
2323 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2324 if __retcode != 0:
2325 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2326 else:
2327 self._queue = q
2328 self._testname = __testname
2329 self._testdir = __testdir
2330 self._resultfile = os.path.join(self._testdir, 'a.out')
2331 self._main('')
2332
2333 class Test_generate_list_and_parse_tree(MainGenerateParse):
2334 '''Generate a list of files inside a tree of files and parse this one right after'''
2335 def __init__(self, q):
2336 __queue = q
2337 __res = True
2338 __testname = self.__class__.__name__
2339 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-and-parse-tree')
2340 __archive = os.path.join(__testdir, 'generate-list-and-parse-tree')
2341 __resultfile = os.path.join(__testdir, 'generate-list-and-parse-tree.list')
2342 if 'PYTHONEXE' in environ:
2343 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2344 else:
2345 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2346 if __retcode != 0:
2347 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2348 else:
2349 self._queue = q
2350 self._testname = __testname
2351 self._testdir = __testdir
2352 self._resultfile = os.path.join(self._testdir, 'a.out')
2353 self._main('')
2354
2355 class Test_generate_list_and_parse_gzip_archive(MainGenerateParse):
2356 '''Generate a list of files inside a gzip archive and parse this one right after'''
2357 def __init__(self, q):
2358 __queue = q
2359 __res = True
2360 __testname = self.__class__.__name__
2361 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-and-parse-gzip-archive')
2362 __archive = os.path.join(__testdir, 'generate-list-and-parse-gzip-archive.gz')
2363 __resultfile = os.path.join(__testdir, 'generate-list-and-parse-gzip-archive.list')
2364 if 'PYTHONEXE' in environ:
2365 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2366 else:
2367 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2368 if __retcode != 0:
2369 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2370 else:
2371 self._queue = q
2372 self._testname = __testname
2373 self._testdir = __testdir
2374 self._resultfile = os.path.join(self._testdir, 'a.out')
2375 self._main('')
2376
2377 class Test_generate_list_and_parse_bzip2_archive(MainGenerateParse):
2378 '''Generate a list of files inside a bzip2 archive and parse this one right after'''
2379 def __init__(self, q):
2380 __queue = q
2381 __res = True
2382 __testname = self.__class__.__name__
2383 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-and-parse-bzip2-archive')
2384 __archive = os.path.join(__testdir, 'generate-list-and-parse-bzip2-archive.bz2')
2385 __resultfile = os.path.join(__testdir, 'generate-list-and-parse-bzip2-archive.list')
2386 if 'PYTHONEXE' in environ:
2387 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2388 else:
2389 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2390 if __retcode != 0:
2391 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2392 else:
2393 self._queue = q
2394 self._testname = __testname
2395 self._testdir = __testdir
2396 self._resultfile = os.path.join(self._testdir, 'a.out')
2397 self._main('')
2398
2399 class Test_generate_list_and_parse_xz_archive(MainGenerateParse):
2400 '''Generate a list of files inside a xz archive and parse this one right after'''
2401 def __init__(self, q):
2402 __queue = q
2403 __res = True
2404 __testname = self.__class__.__name__
2405 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-and-parse-xz-archive')
2406 __archive = os.path.join(__testdir, 'generate-list-and-parse-xz-archive.xz')
2407 __resultfile = os.path.join(__testdir, 'generate-list-and-parse-xz-archive.list')
2408 if 'PYTHONEXE' in environ:
2409 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
2410 else:
2411 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
2412 if __retcode != 0:
2413 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2414 else:
2415 self._queue = q
2416 self._testname = __testname
2417 self._testdir = __testdir
2418 self._resultfile = os.path.join(self._testdir, 'a.out')
2419 self._main('')
2420
2421 class Test_user_specified_delimiter(Main):
2422 '''Test if a file is missing in a tar archive with a user-specified delimiter in the file of filenames'''
2423 def __init__(self, q):
2424 self._queue = q
2425 self._testname = self.__class__.__name__
2426 self._testdir = os.path.join(ABSPATH, 'functional-tests/user-specified-delimiter')
2427 self._resultfile = os.path.join(self._testdir, 'a.out')
2428 self._main('1 file missing in')
2429
2430 class Test_tar_archive_size_not_equals_expected_size(Main):
2431 def __init__(self, q):
2432 self._queue = q
2433 self._testname = self.__class__.__name__
2434 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-archive-size-not-equals-expected-size')
2435 self._resultfile = os.path.join(self._testdir, 'a.out')
2436 self._main('1 file with unexpected size')
2437
2438 class Test_tar_gz_archive_size_not_equals_expected_size(Main):
2439 def __init__(self, q):
2440 self._queue = q
2441 self._testname = self.__class__.__name__
2442 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-gz-archive-size-not-equals-expected-size')
2443 self._resultfile = os.path.join(self._testdir, 'a.out')
2444 self._main('1 file with unexpected size')
2445
2446 class Test_tar_bz2_archive_size_not_equals_expected_size(Main):
2447 def __init__(self, q):
2448 self._queue = q
2449 self._testname = self.__class__.__name__
2450 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-bz2-archive-size-not-equals-expected-size')
2451 self._resultfile = os.path.join(self._testdir, 'a.out')
2452 self._main('1 file with unexpected size')
2453
2454 class Test_tar_xz_archive_size_not_equals_expected_size(Main):
2455 def __init__(self, q):
2456 self._queue = q
2457 self._testname = self.__class__.__name__
2458 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-xz-archive-size-not-equals-expected-size')
2459 self._resultfile = os.path.join(self._testdir, 'a.out')
2460 self._main('1 file with unexpected size')
2461
2462 class Test_gzip_archive_size_not_equals_expected_size(Main):
2463 def __init__(self, q):
2464 self._queue = q
2465 self._testname = self.__class__.__name__
2466 self._testdir = os.path.join(ABSPATH, 'functional-tests/gzip-archive-size-not-equals-expected-size')
2467 self._resultfile = os.path.join(self._testdir, 'a.out')
2468 self._main('1 file with unexpected size')
2469
2470 class Test_bzip2_archive_size_not_equals_expected_size(Main):
2471 def __init__(self, q):
2472 self._queue = q
2473 self._testname = self.__class__.__name__
2474 self._testdir = os.path.join(ABSPATH, 'functional-tests/bzip2-archive-size-not-equals-expected-size')
2475 self._resultfile = os.path.join(self._testdir, 'a.out')
2476 self._main('1 file with unexpected size')
2477
2478 class Test_zip_archive_size_not_equals_expected_size(Main):
2479 def __init__(self, q):
2480 self._queue = q
2481 self._testname = self.__class__.__name__
2482 self._testdir = os.path.join(ABSPATH, 'functional-tests/zip-archive-size-not-equals-expected-size')
2483 self._resultfile = os.path.join(self._testdir, 'a.out')
2484 self._main('1 file with unexpected size')
2485
2486 class Test_tar_archive_size_bigger_than_expected_size(Main):
2487 def __init__(self, q):
2488 self._queue = q
2489 self._testname = self.__class__.__name__
2490 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-archive-size-bigger-than-expected-size')
2491 self._resultfile = os.path.join(self._testdir, 'a.out')
2492 self._main('1 file bigger than')
2493
2494 class Test_tar_gz_archive_size_bigger_than_expected_size(Main):
2495 def __init__(self, q):
2496 self._queue = q
2497 self._testname = self.__class__.__name__
2498 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-gz-archive-size-bigger-than-expected-size')
2499 self._resultfile = os.path.join(self._testdir, 'a.out')
2500 self._main('1 file bigger than')
2501
2502 class Test_tar_bz2_archive_size_bigger_than_expected_size(Main):
2503 def __init__(self, q):
2504 self._queue = q
2505 self._testname = self.__class__.__name__
2506 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-bz2-archive-size-bigger-than-expected-size')
2507 self._resultfile = os.path.join(self._testdir, 'a.out')
2508 self._main('1 file bigger than')
2509
2510 class Test_tar_xz_archive_size_bigger_than_expected_size(Main):
2511 def __init__(self, q):
2512 self._queue = q
2513 self._testname = self.__class__.__name__
2514 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-xz-archive-size-bigger-than-expected-size')
2515 self._resultfile = os.path.join(self._testdir, 'a.out')
2516 self._main('1 file bigger than')
2517
2518 class Test_gzip_archive_size_bigger_than_expected_size(Main):
2519 def __init__(self, q):
2520 self._queue = q
2521 self._testname = self.__class__.__name__
2522 self._testdir = os.path.join(ABSPATH, 'functional-tests/gzip-archive-size-bigger-than-expected-size')
2523 self._resultfile = os.path.join(self._testdir, 'a.out')
2524 self._main('1 file bigger than')
2525
2526 class Test_bzip2_archive_size_bigger_than_expected_size(Main):
2527 def __init__(self, q):
2528 self._queue = q
2529 self._testname = self.__class__.__name__
2530 self._testdir = os.path.join(ABSPATH, 'functional-tests/bzip2-archive-size-bigger-than-expected-size')
2531 self._resultfile = os.path.join(self._testdir, 'a.out')
2532 self._main('1 file bigger than')
2533
2534 class Test_zip_archive_size_bigger_than_expected_size(Main):
2535 def __init__(self, q):
2536 self._queue = q
2537 self._testname = self.__class__.__name__
2538 self._testdir = os.path.join(ABSPATH, 'functional-tests/zip-archive-size-bigger-than-expected-size')
2539 self._resultfile = os.path.join(self._testdir, 'a.out')
2540 self._main('1 file bigger than')
2541
2542 class Test_tar_archive_size_smaller_than_expected_size(Main):
2543 def __init__(self, q):
2544 self._queue = q
2545 self._testname = self.__class__.__name__
2546 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-archive-size-smaller-than-expected-size')
2547 self._resultfile = os.path.join(self._testdir, 'a.out')
2548 self._main('1 file smaller than')
2549
2550 class Test_tar_gz_archive_size_smaller_than_expected_size(Main):
2551 def __init__(self, q):
2552 self._queue = q
2553 self._testname = self.__class__.__name__
2554 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-gz-archive-size-smaller-than-expected-size')
2555 self._resultfile = os.path.join(self._testdir, 'a.out')
2556 self._main('1 file smaller than')
2557
2558 class Test_tar_bz2_archive_size_smaller_than_expected_size(Main):
2559 def __init__(self, q):
2560 self._queue = q
2561 self._testname = self.__class__.__name__
2562 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-bz2-archive-size-smaller-than-expected-size')
2563 self._resultfile = os.path.join(self._testdir, 'a.out')
2564 self._main('1 file smaller than')
2565
2566 class Test_tar_xz_archive_size_smaller_than_expected_size(Main):
2567 def __init__(self, q):
2568 self._queue = q
2569 self._testname = self.__class__.__name__
2570 self._testdir = os.path.join(ABSPATH, 'functional-tests/tar-xz-archive-size-smaller-than-expected-size')
2571 self._resultfile = os.path.join(self._testdir, 'a.out')
2572 self._main('1 file smaller than')
2573
2574 class Test_zip_archive_size_smaller_than_expected_size(Main):
2575 def __init__(self, q):
2576 self._queue = q
2577 self._testname = self.__class__.__name__
2578 self._testdir = os.path.join(ABSPATH, 'functional-tests/zip-archive-size-smaller-than-expected-size')
2579 self._resultfile = os.path.join(self._testdir, 'a.out')
2580 self._main('1 file smaller than')
2581
2582 class Test_gzip_archive_size_smaller_than_expected_size(Main):
2583 def __init__(self, q):
2584 self._queue = q
2585 self._testname = self.__class__.__name__
2586 self._testdir = os.path.join(ABSPATH, 'functional-tests/gzip-archive-size-smaller-than-expected-size')
2587 self._resultfile = os.path.join(self._testdir, 'a.out')
2588 self._main('1 file smaller than')
2589
2590 class Test_bzip2_archive_size_smaller_than_expected_size(Main):
2591 def __init__(self, q):
2592 self._queue = q
2593 self._testname = self.__class__.__name__
2594 self._testdir = os.path.join(ABSPATH, 'functional-tests/bzip2-archive-size-smaller-than-expected-size')
2595 self._resultfile = os.path.join(self._testdir, 'a.out')
2596 self._main('1 file smaller than')
2597
2598 class Test_checkarchive_supported_types_equals_listtype_supported_types:
2599 '''Test if the supported types in checkarchives.py equals the ones in
2600 listtype.py
2601 This is not exactly a functional test but it triggered bug #24 so
2602 it needs to be tested
2603 '''
2604 def __init__(self, q):
2605 # extract supported extensions from the code
2606 # store them in sets and compare them
2607 __queue = q
2608 __testname = self.__class__.__name__
2609 with open('brebis/checkbackups/checkbackups.py') as __f1:
2610 __checkarchivescode = __f1.readlines()
2611 with open('brebis/listtype.py') as __f2:
2612 __listtypecode = __f2.readlines()
2613 __checkarchivestypes = set()
2614 __listtypetypes = set()
2615 for __line in __checkarchivescode:
2616 if 'endswith' in __line:
2617 __checkarchivestypes.add(__line.split(".endswith('")[1].split("'")[0])
2618 for __line in __listtypecode:
2619 if 'endswith' in __line:
2620 __listtypetypes.add(__line.split(".endswith('")[1].split("'")[0])
2621 # symmetrical differences of the two sets
2622 __unsupportedtypes = __checkarchivestypes ^ __listtypetypes
2623 if not __unsupportedtypes:
2624 __queue.put('{} - {}'.format(__testname, OKMSG))
2625 else:
2626 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2627
2628 class Test_generate_list_changing_default_separator_for_tar_gz:
2629 '''Generate a list of files changing the default separator for tar gz archive'''
2630 def __init__(self, q):
2631 __queue = q
2632 __res = True
2633 __testname = self.__class__.__name__
2634 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-changing-default-separator/tar.gz')
2635 __archive = os.path.join(__testdir, 'generate-list-changing-default-separator-for-tar-gz.tar.gz')
2636 __resultfile = os.path.join(__testdir, 'generate-list-changing-default-separator-for-tar-gz.list')
2637 __output = os.path.join(__testdir, 'a.out')
2638 if 'PYTHONEXE' in environ:
2639 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2640 else:
2641 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2642 if __retcode != 0:
2643 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2644 else:
2645 # check now the newly modified list of files with the new delimiter
2646 if 'PYTHONEXE' in environ:
2647 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2648 else:
2649 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2650 if __retcode != 0:
2651 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2652 else:
2653 with open(__output, 'r') as __file:
2654 if '' in __file.read():
2655 __queue.put('{} - {}'.format(__testname, OKMSG))
2656 else:
2657 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2658
2659 class Test_generate_list_changing_default_separator_for_tar_bz2:
2660 '''Generate a list of files changing the default separator for tar bz2 archive'''
2661 def __init__(self, q):
2662 __queue = q
2663 __res = True
2664 __testname = self.__class__.__name__
2665 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-changing-default-separator/tar.bz2')
2666 __archive = os.path.join(__testdir, 'generate-list-changing-default-separator-for-tar-bz2.tar.bz2')
2667 __resultfile = os.path.join(__testdir, 'generate-list-changing-default-separator-for-tar-bz2.list')
2668 __output = os.path.join(__testdir, 'a.out')
2669 if 'PYTHONEXE' in environ:
2670 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2671 else:
2672 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2673 if __retcode != 0:
2674 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2675 else:
2676 # check now the newly modified list of files with the new delimiter
2677 if 'PYTHONEXE' in environ:
2678 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2679 else:
2680 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2681 if __retcode != 0:
2682 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2683 else:
2684 with open(__output, 'r') as __file:
2685 if '' in __file.read():
2686 __queue.put('{} - {}'.format(__testname, OKMSG))
2687 else:
2688 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2689
2690 class Test_generate_list_changing_default_separator_for_tar_xz:
2691 '''Generate a list of files changing the default separator for tar xz archive'''
2692 def __init__(self, q):
2693 __queue = q
2694 __res = True
2695 __testname = self.__class__.__name__
2696 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-changing-default-separator/tar.xz')
2697 __archive = os.path.join(__testdir, 'generate-list-changing-default-separator-for-tar-xz.tar.xz')
2698 __resultfile = os.path.join(__testdir, 'generate-list-changing-default-separator-for-tar-xz.list')
2699 __output = os.path.join(__testdir, 'a.out')
2700 if 'PYTHONEXE' in environ:
2701 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2702 else:
2703 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2704 if __retcode != 0:
2705 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2706 else:
2707 # check now the newly modified list of files with the new delimiter
2708 if 'PYTHONEXE' in environ:
2709 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2710 else:
2711 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2712 if __retcode != 0:
2713 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2714 else:
2715 with open(__output, 'r') as __file:
2716 if '' in __file.read():
2717 __queue.put('{} - {}'.format(__testname, OKMSG))
2718 else:
2719 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2720
2721 class Test_generate_list_changing_default_separator_for_gzip:
2722 '''Generate a list of files changing the default separator for gzip archive'''
2723 def __init__(self, q):
2724 __queue = q
2725 __res = True
2726 __testname = self.__class__.__name__
2727 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-changing-default-separator/gzip')
2728 __archive = os.path.join(__testdir, 'generate-list-changing-default-separator-for-gzip.gz')
2729 __resultfile = os.path.join(__testdir, 'generate-list-changing-default-separator-for-gzip.list')
2730 __output = os.path.join(__testdir, 'a.out')
2731 if 'PYTHONEXE' in environ:
2732 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2733 else:
2734 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2735 if __retcode != 0:
2736 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2737 else:
2738 # check now the newly modified list of files with the new delimiter
2739 if 'PYTHONEXE' in environ:
2740 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2741 else:
2742 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2743 if __retcode != 0:
2744 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2745 else:
2746 with open(__output, 'r') as __file:
2747 if '' in __file.read():
2748 __queue.put('{} - {}'.format(__testname, OKMSG))
2749 else:
2750 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2751
2752 class Test_generate_list_changing_default_separator_for_bzip2:
2753 '''Generate a list of files changing the default separator for bzip2 archive'''
2754 def __init__(self, q):
2755 __queue = q
2756 __res = True
2757 __testname = self.__class__.__name__
2758 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-changing-default-separator/bzip2')
2759 __archive = os.path.join(__testdir, 'generate-list-changing-default-separator-for-bzip2.bz2')
2760 __resultfile = os.path.join(__testdir, 'generate-list-changing-default-separator-for-bzip2.list')
2761 __output = os.path.join(__testdir, 'a.out')
2762 if 'PYTHONEXE' in environ:
2763 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2764 else:
2765 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2766 if __retcode != 0:
2767 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2768 else:
2769 # check now the newly modified list of files with the new delimiter
2770 if 'PYTHONEXE' in environ:
2771 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2772 else:
2773 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2774 if __retcode != 0:
2775 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2776 else:
2777 with open(__output, 'r') as __file:
2778 if '' in __file.read():
2779 __queue.put('{} - {}'.format(__testname, OKMSG))
2780 else:
2781 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2782
2783 class Test_generate_list_changing_default_separator_for_zip:
2784 '''Generate a list of files changing the default separator for zip archive'''
2785 def __init__(self, q):
2786 __queue = q
2787 __res = True
2788 __testname = self.__class__.__name__
2789 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-changing-default-separator/zip')
2790 __archive = os.path.join(__testdir, 'generate-list-changing-default-separator-for-zip.zip')
2791 __resultfile = os.path.join(__testdir, 'generate-list-changing-default-separator-for-zip.list')
2792 __output = os.path.join(__testdir, 'a.out')
2793 if 'PYTHONEXE' in environ:
2794 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2795 else:
2796 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2797 if __retcode != 0:
2798 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2799 else:
2800 # check now the newly modified list of files with the new delimiter
2801 if 'PYTHONEXE' in environ:
2802 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2803 else:
2804 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2805 if __retcode != 0:
2806 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2807 else:
2808 with open(__output, 'r') as __file:
2809 if '' in __file.read():
2810 __queue.put('{} - {}'.format(__testname, OKMSG))
2811 else:
2812 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2813
2814 class Test_generate_list_changing_default_separator_for_tree:
2815 '''Generate a list of files changing the default separator for a tree of files'''
2816 def __init__(self, q):
2817 __queue = q
2818 __res = True
2819 __testname = self.__class__.__name__
2820 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-list-changing-default-separator/tree')
2821 __archive = os.path.join(__testdir, 'generate-list-changing-default-separator-for-tree')
2822 __resultfile = os.path.join(__testdir, 'generate-list-changing-default-separator-for-tree.list')
2823 __output = os.path.join(__testdir, 'a.out')
2824 if 'PYTHONEXE' in environ:
2825 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2826 else:
2827 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTHASHES, OPTGEN, __archive])
2828 if __retcode != 0:
2829 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2830 else:
2831 # check now the newly modified list of files with the new delimiter
2832 if 'PYTHONEXE' in environ:
2833 __retcode = subprocess.call([PYTHONEXE, EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2834 else:
2835 __retcode = subprocess.call([EXE, OPTDEL, ALTERNATEDELIMITER, OPTCONFIG, __testdir, OPTLOG, __output])
2836 if __retcode != 0:
2837 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2838 else:
2839 with open(__output, 'r') as __file:
2840 if '' in __file.read():
2841 __queue.put('{} - {}'.format(__testname, OKMSG))
2842 else:
2843 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2844
2845 class Test_expecting_hard_link_for_tar_gz(Main):
2846 '''Test if an expecting hard link in a tar.gz archive fails on a regular file'''
2847 def __init__(self, q):
2848 self._queue = q
2849 self._testname = self.__class__.__name__
2850 self._testdir = os.path.join(ABSPATH, 'functional-tests/expecting-hard-link-for-tar-gz')
2851 self._resultfile = os.path.join(self._testdir, 'a.out')
2852 self._main('is a regular file. Should have been a hard link')
2853
2854 class Test_wrong_target_in_tar_gz_archive(Main):
2855 '''Test if the target of a symlink is wrong in a tar gz archive'''
2856 def __init__(self, q):
2857 self._queue = q
2858 self._testname = self.__class__.__name__
2859 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-target-in-tar-gz-archive')
2860 self._resultfile = os.path.join(self._testdir, 'a.out')
2861 self._main(' target is')
2862
2863 class Test_wrong_target_in_tar_bz2_archive(Main):
2864 '''Test if the target of a symlink is wrong in a tar bz2 archive'''
2865 def __init__(self, q):
2866 self._queue = q
2867 self._testname = self.__class__.__name__
2868 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-target-in-tar-bz2-archive')
2869 self._resultfile = os.path.join(self._testdir, 'a.out')
2870 self._main(' target is')
2871
2872 class Test_wrong_target_in_tar_xz_archive(Main):
2873 '''Test if the target of a symlink is wrong in a tar xz archive'''
2874 def __init__(self, q):
2875 self._queue = q
2876 self._testname = self.__class__.__name__
2877 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-target-in-tar-xz-archive')
2878 self._resultfile = os.path.join(self._testdir, 'a.out')
2879 self._main(' target is')
2880
2881 class Test_wrong_target_in_tree(Main):
2882 '''Test if the target of a symlink is wrong in a tree of files'''
2883 def __init__(self, q):
2884 self._queue = q
2885 self._testname = self.__class__.__name__
2886 self._testdir = os.path.join(ABSPATH, 'functional-tests/wrong-target-in-tree')
2887 self._resultfile = os.path.join(self._testdir, 'a.out')
2888 self._main(' target is')
2889
2890
2891 class Test_generate_conf_and_file_list_tar:
2892 '''Compare the generated list and the expected list and the configuration file and the expected configuration file for a tar archive'''
2893 def __init__(self, q):
2894 __queue = q
2895 __res = True
2896 __testname = self.__class__.__name__
2897 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-conf-and-file-list-tar')
2898 __archive = os.path.join(__testdir, 'generate-conf-and-file-list-tar.tar')
2899 __conffile = os.path.join(__testdir, 'conf.conf')
2900 __listfile = os.path.join(__testdir, 'list.list')
2901 __origconffile = os.path.join(__testdir, 'conf.conf.bck')
2902 __resultconffile = os.path.join(__testdir, 'generate-conf-and-file-list-tar.conf')
2903 __resultlistfile = os.path.join(__testdir, 'generate-conf-and-file-list-tar.list')
2904 __newconffile = []
2905 # prepare the environment
2906 shutil.copyfile(__origconffile, __conffile)
2907 # switch flags expected conf and list files to good environment variables
2908 with open(__conffile) as __objconf:
2909 for __line in __objconf.readlines():
2910 if 'PATH' in __line:
2911 __line = __line.replace('PATH', os.path.abspath('functional-tests/generate-conf-and-file-list-tar'))
2912 __newconffile.append(__line)
2913 with open(__conffile, 'w') as __objconf:
2914 __objconf.writelines(__newconffile)
2915
2916 if 'PYTHONEXE' in environ:
2917 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTFULLGEN, __archive])
2918 else:
2919 __retcode = subprocess.call([EXE, OPTHASHES, OPTFULLGEN, __archive])
2920 if __retcode != 0:
2921 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2922 else:
2923 if hashlib.md5(open(__resultconffile, 'rb').read()).hexdigest() != hashlib.md5(open(__conffile, 'rb').read()).hexdigest():
2924 __confres = False
2925 else:
2926 __confres = True
2927 if hashlib.md5(open(__resultlistfile, 'rb').read()).hexdigest() != hashlib.md5(open(__listfile, 'rb').read()).hexdigest():
2928 __listres = False
2929 else:
2930 __listres = True
2931 if __confres and __listres:
2932 __queue.put('{} - {}'.format(__testname, OKMSG))
2933 else:
2934 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2935
2936 class Test_generate_conf_and_file_list_tar_gz:
2937 '''Compare the generated list and the expected list and the configuration file and the expected configuration file for a tar gz archive'''
2938 def __init__(self, q):
2939 __queue = q
2940 __res = True
2941 __testname = self.__class__.__name__
2942 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-conf-and-file-list-tar-gz')
2943 __archive = os.path.join(__testdir, 'generate-conf-and-file-list-tar-gz.tar.gz')
2944 __conffile = os.path.join(__testdir, 'conf.conf')
2945 __listfile = os.path.join(__testdir, 'list.list')
2946 __origconffile = os.path.join(__testdir, 'conf.conf.bck')
2947 __resultconffile = os.path.join(__testdir, 'generate-conf-and-file-list-tar-gz.conf')
2948 __resultlistfile = os.path.join(__testdir, 'generate-conf-and-file-list-tar-gz.list')
2949 __newconffile = []
2950 # prepare the environment
2951 shutil.copyfile(__origconffile, __conffile)
2952 # switch flags expected conf and list files to good environment variables
2953 with open(__conffile) as __objconf:
2954 for __line in __objconf.readlines():
2955 if 'PATH' in __line:
2956 __line = __line.replace('PATH', os.path.abspath('functional-tests/generate-conf-and-file-list-tar-gz'))
2957 __newconffile.append(__line)
2958 with open(__conffile, 'w') as __objconf:
2959 __objconf.writelines(__newconffile)
2960
2961 if 'PYTHONEXE' in environ:
2962 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTFULLGEN, __archive])
2963 else:
2964 __retcode = subprocess.call([EXE, OPTHASHES, OPTFULLGEN, __archive])
2965 if __retcode != 0:
2966 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
2967 else:
2968 if hashlib.md5(open(__resultconffile, 'rb').read()).hexdigest() != hashlib.md5(open(__conffile, 'rb').read()).hexdigest():
2969 __confres = False
2970 else:
2971 __confres = True
2972 if hashlib.md5(open(__resultlistfile, 'rb').read()).hexdigest() != hashlib.md5(open(__listfile, 'rb').read()).hexdigest():
2973 __listres = False
2974 else:
2975 __listres = True
2976 if __confres and __listres:
2977 __queue.put('{} - {}'.format(__testname, OKMSG))
2978 else:
2979 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
2980
2981 class Test_generate_conf_and_file_list_tar_bz2:
2982 '''Compare the generated list and the expected list and the configuration file and the expected configuration file for a tar bz2 archive'''
2983 def __init__(self, q):
2984 __queue = q
2985 __res = True
2986 __testname = self.__class__.__name__
2987 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-conf-and-file-list-tar-bz2')
2988 __archive = os.path.join(__testdir, 'generate-conf-and-file-list-tar-bz2.tar.bz2')
2989 __conffile = os.path.join(__testdir, 'conf.conf')
2990 __listfile = os.path.join(__testdir, 'list.list')
2991 __origconffile = os.path.join(__testdir, 'conf.conf.bck')
2992 __resultconffile = os.path.join(__testdir, 'generate-conf-and-file-list-tar-bz2.conf')
2993 __resultlistfile = os.path.join(__testdir, 'generate-conf-and-file-list-tar-bz2.list')
2994 __newconffile = []
2995 # prepare the environment
2996 shutil.copyfile(__origconffile, __conffile)
2997 # switch flags expected conf and list files to good environment variables
2998 with open(__conffile) as __objconf:
2999 for __line in __objconf.readlines():
3000 if 'PATH' in __line:
3001 __line = __line.replace('PATH', os.path.abspath('functional-tests/generate-conf-and-file-list-tar-bz2'))
3002 __newconffile.append(__line)
3003 with open(__conffile, 'w') as __objconf:
3004 __objconf.writelines(__newconffile)
3005
3006 if 'PYTHONEXE' in environ:
3007 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTFULLGEN, __archive])
3008 else:
3009 __retcode = subprocess.call([EXE, OPTHASHES, OPTFULLGEN, __archive])
3010 if __retcode != 0:
3011 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3012 else:
3013 if hashlib.md5(open(__resultconffile, 'rb').read()).hexdigest() != hashlib.md5(open(__conffile, 'rb').read()).hexdigest():
3014 __confres = False
3015 else:
3016 __confres = True
3017 if hashlib.md5(open(__resultlistfile, 'rb').read()).hexdigest() != hashlib.md5(open(__listfile, 'rb').read()).hexdigest():
3018 __listres = False
3019 else:
3020 __listres = True
3021 if __confres and __listres:
3022 __queue.put('{} - {}'.format(__testname, OKMSG))
3023 else:
3024 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3025
3026 class Test_generate_conf_and_file_list_tar_xz:
3027 '''Compare the generated list and the expected list and the configuration file and the expected configuration file for a tar xz archive'''
3028 def __init__(self, q):
3029 __queue = q
3030 __res = True
3031 __testname = self.__class__.__name__
3032 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-conf-and-file-list-tar-xz')
3033 __archive = os.path.join(__testdir, 'generate-conf-and-file-list-tar-xz.tar.xz')
3034 __conffile = os.path.join(__testdir, 'conf.conf')
3035 __listfile = os.path.join(__testdir, 'list.list')
3036 __origconffile = os.path.join(__testdir, 'conf.conf.bck')
3037 __resultconffile = os.path.join(__testdir, 'generate-conf-and-file-list-tar-xz.conf')
3038 __resultlistfile = os.path.join(__testdir, 'generate-conf-and-file-list-tar-xz.list')
3039 __newconffile = []
3040 # prepare the environment
3041 shutil.copyfile(__origconffile, __conffile)
3042 # switch flags expected conf and list files to good environment variables
3043 with open(__conffile) as __objconf:
3044 for __line in __objconf.readlines():
3045 if 'PATH' in __line:
3046 __line = __line.replace('PATH', os.path.abspath('functional-tests/generate-conf-and-file-list-tar-xz'))
3047 __newconffile.append(__line)
3048 with open(__conffile, 'w') as __objconf:
3049 __objconf.writelines(__newconffile)
3050
3051 if 'PYTHONEXE' in environ:
3052 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTFULLGEN, __archive])
3053 else:
3054 __retcode = subprocess.call([EXE, OPTHASHES, OPTFULLGEN, __archive])
3055 if __retcode != 0:
3056 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3057 else:
3058 if hashlib.md5(open(__resultconffile, 'rb').read()).hexdigest() != hashlib.md5(open(__conffile, 'rb').read()).hexdigest():
3059 __confres = False
3060 else:
3061 __confres = True
3062 if hashlib.md5(open(__resultlistfile, 'rb').read()).hexdigest() != hashlib.md5(open(__listfile, 'rb').read()).hexdigest():
3063 __listres = False
3064 else:
3065 __listres = True
3066 if __confres and __listres:
3067 __queue.put('{} - {}'.format(__testname, OKMSG))
3068 else:
3069 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3070
3071 class Test_generate_conf_and_file_list_gz:
3072 '''Compare the generated list and the expected list and the configuration file and the expected configuration file for a gz archive'''
3073 def __init__(self, q):
3074 __queue = q
3075 __res = True
3076 __testname = self.__class__.__name__
3077 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-conf-and-file-list-gz')
3078 __archive = os.path.join(__testdir, 'generate-conf-and-file-list-gz.gz')
3079 __conffile = os.path.join(__testdir, 'conf.conf')
3080 __listfile = os.path.join(__testdir, 'list.list')
3081 __origconffile = os.path.join(__testdir, 'conf.conf.bck')
3082 __resultconffile = os.path.join(__testdir, 'generate-conf-and-file-list-gz.conf')
3083 __resultlistfile = os.path.join(__testdir, 'generate-conf-and-file-list-gz.list')
3084 __newconffile = []
3085 # prepare the environment
3086 shutil.copyfile(__origconffile, __conffile)
3087 # switch flags expected conf and list files to good environment variables
3088 with open(__conffile) as __objconf:
3089 for __line in __objconf.readlines():
3090 if 'PATH' in __line:
3091 __line = __line.replace('PATH', os.path.abspath('functional-tests/generate-conf-and-file-list-gz'))
3092 __newconffile.append(__line)
3093 with open(__conffile, 'w') as __objconf:
3094 __objconf.writelines(__newconffile)
3095
3096 if 'PYTHONEXE' in environ:
3097 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTFULLGEN, __archive])
3098 else:
3099 __retcode = subprocess.call([EXE, OPTHASHES, OPTFULLGEN, __archive])
3100 if __retcode != 0:
3101 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3102 else:
3103 if hashlib.md5(open(__resultconffile, 'rb').read()).hexdigest() != hashlib.md5(open(__conffile, 'rb').read()).hexdigest():
3104 __confres = False
3105 else:
3106 __confres = True
3107 if hashlib.md5(open(__resultlistfile, 'rb').read()).hexdigest() != hashlib.md5(open(__listfile, 'rb').read()).hexdigest():
3108 __listres = False
3109 else:
3110 __listres = True
3111 if __confres and __listres:
3112 __queue.put('{} - {}'.format(__testname, OKMSG))
3113 else:
3114 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3115
3116 class Test_generate_conf_and_file_list_bz2:
3117 '''Compare the generated list and the expected list and the configuration file and the expected configuration file for a bz2 archive'''
3118 def __init__(self, q):
3119 __queue = q
3120 __res = True
3121 __testname = self.__class__.__name__
3122 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-conf-and-file-list-bz2')
3123 __archive = os.path.join(__testdir, 'generate-conf-and-file-list-bz2.bz2')
3124 __conffile = os.path.join(__testdir, 'conf.conf')
3125 __listfile = os.path.join(__testdir, 'list.list')
3126 __origconffile = os.path.join(__testdir, 'conf.conf.bck')
3127 __resultconffile = os.path.join(__testdir, 'generate-conf-and-file-list-bz2.conf')
3128 __resultlistfile = os.path.join(__testdir, 'generate-conf-and-file-list-bz2.list')
3129 __newconffile = []
3130 # prepare the environment
3131 shutil.copyfile(__origconffile, __conffile)
3132 # switch flags expected conf and list files to good environment variables
3133 with open(__conffile) as __objconf:
3134 for __line in __objconf.readlines():
3135 if 'PATH' in __line:
3136 __line = __line.replace('PATH', os.path.abspath('functional-tests/generate-conf-and-file-list-bz2'))
3137 __newconffile.append(__line)
3138 with open(__conffile, 'w') as __objconf:
3139 __objconf.writelines(__newconffile)
3140
3141 if 'PYTHONEXE' in environ:
3142 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTFULLGEN, __archive])
3143 else:
3144 __retcode = subprocess.call([EXE, OPTHASHES, OPTFULLGEN, __archive])
3145 if __retcode != 0:
3146 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3147 else:
3148 if hashlib.md5(open(__resultconffile, 'rb').read()).hexdigest() != hashlib.md5(open(__conffile, 'rb').read()).hexdigest():
3149 __confres = False
3150 else:
3151 __confres = True
3152 if hashlib.md5(open(__resultlistfile, 'rb').read()).hexdigest() != hashlib.md5(open(__listfile, 'rb').read()).hexdigest():
3153 __listres = False
3154 else:
3155 __listres = True
3156 if __confres and __listres:
3157 __queue.put('{} - {}'.format(__testname, OKMSG))
3158 else:
3159 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3160
3161 class Test_generate_conf_and_file_list_xz:
3162 '''Compare the generated list and the expected list and the configuration file and the expected configuration file for a xz archive'''
3163 def __init__(self, q):
3164 __queue = q
3165 __res = True
3166 __testname = self.__class__.__name__
3167 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-conf-and-file-list-xz')
3168 __archive = os.path.join(__testdir, 'generate-conf-and-file-list-xz.xz')
3169 __conffile = os.path.join(__testdir, 'conf.conf')
3170 __listfile = os.path.join(__testdir, 'list.list')
3171 __origconffile = os.path.join(__testdir, 'conf.conf.bck')
3172 __resultconffile = os.path.join(__testdir, 'generate-conf-and-file-list-xz.conf')
3173 __resultlistfile = os.path.join(__testdir, 'generate-conf-and-file-list-xz.list')
3174 __newconffile = []
3175 # prepare the environment
3176 shutil.copyfile(__origconffile, __conffile)
3177 # switch flags expected conf and list files to good environment variables
3178 with open(__conffile) as __objconf:
3179 for __line in __objconf.readlines():
3180 if 'PATH' in __line:
3181 __line = __line.replace('PATH', os.path.abspath('functional-tests/generate-conf-and-file-list-xz'))
3182 __newconffile.append(__line)
3183 with open(__conffile, 'w') as __objconf:
3184 __objconf.writelines(__newconffile)
3185
3186 if 'PYTHONEXE' in environ:
3187 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTFULLGEN, __archive])
3188 else:
3189 __retcode = subprocess.call([EXE, OPTHASHES, OPTFULLGEN, __archive])
3190 if __retcode != 0:
3191 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3192 else:
3193 if hashlib.md5(open(__resultconffile, 'rb').read()).hexdigest() != hashlib.md5(open(__conffile, 'rb').read()).hexdigest():
3194 __confres = False
3195 else:
3196 __confres = True
3197 if hashlib.md5(open(__resultlistfile, 'rb').read()).hexdigest() != hashlib.md5(open(__listfile, 'rb').read()).hexdigest():
3198 __listres = False
3199 else:
3200 __listres = True
3201 if __confres and __listres:
3202 __queue.put('{} - {}'.format(__testname, OKMSG))
3203 else:
3204 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3205
3206 class Test_generate_conf_and_file_list_tree:
3207 '''Compare the generated list and the expected list and the configuration file and the expected configuration file for a tree'''
3208 def __init__(self, q):
3209 __queue = q
3210 __res = True
3211 __testname = self.__class__.__name__
3212 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-conf-and-file-list-tree')
3213 __archive = os.path.join(__testdir, 'generate-conf-and-file-list-tree')
3214 __resultconffile = os.path.join(__testdir, 'generate-conf-and-file-list-tree.conf')
3215 __resultlistfile = os.path.join(__testdir, 'generate-conf-and-file-list-tree.list')
3216 __newconffile = []
3217 if 'PYTHONEXE' in environ:
3218 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTFULLGEN, __archive])
3219 else:
3220 __retcode = subprocess.call([EXE, OPTHASHES, OPTFULLGEN, __archive])
3221 if __retcode != 0:
3222 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3223 else:
3224 # check if the parameter sha512 is available in the configuration file
3225 if 'sha512' in open(__resultconffile).read():
3226 __queue.put('{} - {}'.format(__testname, OKMSG))
3227 else:
3228 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3229
3230 class Test_sha_sum_in_conf(Main):
3231 '''Test if the parameter hash in the configuration file is recognized'''
3232 def __init__(self, q):
3233 self.__queue = q
3234 self.__testname = self.__class__.__name__
3235 self.__testdir = os.path.join(ABSPATH, 'functional-tests/sha-sum-in-conf')
3236 self.__resultfile = os.path.join(self.__testdir, 'a.out')
3237 if 'PYTHONEXE' in environ:
3238 __command = ' '.join([PYTHONEXE, EXE, OPTCONFIG, self.__testdir, OPTLOG, self.__resultfile])
3239 else:
3240 __command = ' '.join([EXE, OPTCONFIG, self.__testdir, OPTLOG, self.__resultfile])
3241 __result = subprocess.getstatusoutput(__command)
3242 if __result[0] != 0:
3243 self.__queue.put('{} - {}'.format(self.__testname, OKMSG))
3244 else:
3245 self.__queue.put('{} - {}return code:{}'.format(self.__testname, KOMSG, str(__result[0])))
3246
3247 class Test_missing_gpg_footer(Main):
3248 '''Test if the pgp/gpg footer is missing in the configuration file'''
3249 def __init__(self, q):
3250 __queue = q
3251 __res = True
3252 __testname = self.__class__.__name__
3253 __testdir = os.path.join(ABSPATH, 'functional-tests/missing-gpg-footer')
3254 __output = os.path.join(__testdir, 'a.out')
3255 if 'PYTHONEXE' in environ:
3256 __retcode = subprocess.getstatusoutput(' '.join([PYTHONEXE, EXE, OPTCONFIG, __testdir, OPTLOG, __output]))
3257 else:
3258 __retcode = subprocess.getstatusoutput(' '.join([EXE, OPTCONFIG, __testdir, OPTLOG, __output]))
3259 if __retcode[0] != 0:
3260 __queue.put('{} - {}'.format(__testname, OKMSG))
3261 else:
3262 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode[0])))
3263
3264 class Test_missing_gpg_header(Main):
3265 '''Test if the gpg/pgp header is missing in the configuration file'''
3266 def __init__(self, q):
3267 __queue = q
3268 __res = True
3269 __testname = self.__class__.__name__
3270 __testdir = os.path.join(ABSPATH, 'functional-tests/missing-gpg-header')
3271 __output = os.path.join(__testdir, 'a.out')
3272 if 'PYTHONEXE' in environ:
3273 __retcode = subprocess.getstatusoutput(' '.join([PYTHONEXE, EXE, OPTCONFIG, __testdir, OPTLOG, __output]))
3274 else:
3275 __retcode = subprocess.getstatusoutput(' '.join([EXE, OPTCONFIG, __testdir, OPTLOG, __output]))
3276 if __retcode[0] != 0:
3277 __queue.put('{} - {}'.format(__testname, OKMSG))
3278 else:
3279 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode[0])))
3280
3281 class Test_strip_gpg_header_tar_gz(Main):
3282 '''Test if the gpg/pgp header is removed effectively on tar gz archive'''
3283 def __init__(self, q):
3284 __queue = q
3285 __res = True
3286 __testname = self.__class__.__name__
3287 __testdir = os.path.join(ABSPATH, 'functional-tests/strip-gpg-header-tar-gz')
3288 __output = os.path.join(__testdir, 'a.out')
3289 if 'PYTHONEXE' in environ:
3290 __retcode = subprocess.getstatusoutput(' '.join([PYTHONEXE, EXE, OPTCONFIG, __testdir, OPTLOG, __output]))
3291 else:
3292 __retcode = subprocess.getstatusoutput(' '.join([EXE, OPTCONFIG, __testdir, OPTLOG, __output]))
3293 if __retcode[0] == 0:
3294 __queue.put('{} - {}'.format(__testname, OKMSG))
3295 else:
3296 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode[1])))
3297
3298 class Test_generate_list_to_check_mtime_in_tar_archive:
3299 '''Generate a list of files to check that mtime in tar archive is written'''
3300 def __init__(self, q):
3301 __queue = q
3302 __res = True
3303 __testname = self.__class__.__name__
3304 __testdir = os.path.join(ABSPATH, 'functional-tests/check-mtime-tar')
3305 __archive = os.path.join(__testdir, 'check-mtime-tar.tar.gz')
3306 __resultfile = os.path.join(__testdir, 'check-mtime-tar.list')
3307 __output = os.path.join(__testdir, 'a.out')
3308 if 'PYTHONEXE' in environ:
3309 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
3310 else:
3311 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
3312 if __retcode != 0:
3313 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3314 else:
3315 # check now the newly modified list of files with the new delimiter
3316 if 'PYTHONEXE' in environ:
3317 __retcode = subprocess.call([PYTHONEXE, EXE, OPTCONFIG, __testdir, OPTLOG, __output])
3318 else:
3319 __retcode = subprocess.call([EXE, OPTCONFIG, __testdir, OPTLOG, __output])
3320 if __retcode != 0:
3321 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3322 else:
3323 with open(__resultfile, 'r') as __file:
3324 if ' mtime|' in __file.read():
3325 __queue.put('{} - {}'.format(__testname, OKMSG))
3326 else:
3327 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3328
3329 class Test_generate_list_to_check_mtime_in_zip_archive:
3330 '''Generate a list of files to check that mtime in zip archive is written'''
3331 def __init__(self, q):
3332 __queue = q
3333 __res = True
3334 __testname = self.__class__.__name__
3335 __testdir = os.path.join(ABSPATH, 'functional-tests/check-mtime-zip')
3336 __archive = os.path.join(__testdir, 'check-mtime-zip.zip')
3337 __resultfile = os.path.join(__testdir, 'check-mtime-zip.list')
3338 __output = os.path.join(__testdir, 'a.out')
3339 if 'PYTHONEXE' in environ:
3340 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
3341 else:
3342 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
3343 if __retcode != 0:
3344 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3345 else:
3346 # check now the newly modified list of files with the new delimiter
3347 if 'PYTHONEXE' in environ:
3348 __retcode = subprocess.call([PYTHONEXE, EXE, OPTCONFIG, __testdir, OPTLOG, __output])
3349 else:
3350 __retcode = subprocess.call([EXE, OPTCONFIG, __testdir, OPTLOG, __output])
3351 if __retcode != 0:
3352 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3353 else:
3354 with open(__resultfile, 'r') as __file:
3355 if ' mtime|' in __file.read():
3356 __queue.put('{} - {}'.format(__testname, OKMSG))
3357 else:
3358 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3359
3360 class Test_generate_list_to_check_mtime_in_tree:
3361 '''Generate a list of files to check that mtime in tree is written'''
3362 def __init__(self, q):
3363 __queue = q
3364 __res = True
3365 __testname = self.__class__.__name__
3366 __testdir = os.path.join(ABSPATH, 'functional-tests/check-mtime-tree')
3367 __archive = os.path.join(__testdir, 'check-mtime-tree')
3368 __resultfile = os.path.join(__testdir, 'check-mtime-tree.list')
3369 __output = os.path.join(__testdir, 'a.out')
3370 if 'PYTHONEXE' in environ:
3371 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
3372 else:
3373 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
3374 if __retcode != 0:
3375 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3376 else:
3377 with open(__resultfile, 'r') as __file:
3378 if ' mtime|' in __file.read():
3379 __queue.put('{} - {}'.format(__testname, OKMSG))
3380 else:
3381 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3382
3383 class Test_generate_apk_conf_files:
3384 '''Generate a apk archive and verify the result'''
3385 def __init__(self, q):
3386 __queue = q
3387 __res = True
3388 __testname = self.__class__.__name__
3389 __testdir = os.path.join(ABSPATH, 'functional-tests/generate-apk-conf-files')
3390 __archive = os.path.join(__testdir, 'generate-apk-conf-files.apk')
3391 __resultconffile = os.path.join(__testdir, 'generate-apk-conf-files.conf')
3392 __resultlistfile = os.path.join(__testdir, 'generate-apk-conf-files.list')
3393 __output = os.path.join(__testdir, 'a.out')
3394 if 'PYTHONEXE' in environ:
3395 __retcode = subprocess.call([PYTHONEXE, EXE, OPTHASHES, OPTGEN, __archive])
3396 else:
3397 __retcode = subprocess.call([EXE, OPTHASHES, OPTGEN, __archive])
3398 if __retcode != 0:
3399 __queue.put('{} - {}return code:{}'.format(__testname, KOMSG, str(__retcode)))
3400 else:
3401 with open(__resultconffile, 'r') as __file:
3402 if 'name=generate-apk-conf-files' in __file.read():
3403 __queue.put('{} - {}'.format(__testname, OKMSG))
3404 else:
3405 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3406 with open(__resultlistfile, 'r') as __file:
3407 if 'res/drawable-hdpi/balloons2.png| =7511 uid|0 gid|0 mtime|1329733756.0' in __file.read():
3408 __queue.put('{} - {}'.format(__testname, OKMSG))
3409 else:
3410 __queue.put('{} - {}value in result file not expected'.format(__testname, KOMSG))
3411
3412 class Test_custom_conf_filelist_tar:
3413 '''Test to define a custom location to write conf and listfile files for tar archives'''
3414 def __init__(self, q):
3415 __queue = q
3416 __res = True
3417 __testname = self.__class__.__name__
3418 __testdir = os.path.join(ABSPATH, 'functional-tests/custom-conf-filelist-tar')
3419 __confdir = os.path.join(__testdir, 'conf')
3420 __listdir = os.path.join(__testdir, 'list')
3421 __bothdir = os.path.join(__testdir, 'both')
3422 __archive = os.path.join(__testdir, 'custom-conf-filelist-tar.tar.gz')
3423 __resultconffile = os.path.join(__testdir, 'conf', 'custom-conf-filelist-tar.conf')
3424 __resultlistfile = os.path.join(__testdir, 'list', 'custom-conf-filelist-tar.list')
3425 __resultbothconffile = os.path.join(__testdir, 'both', 'custom-conf-filelist-tar.conf')
3426 __resultbothlistfile = os.path.join(__testdir, 'both', 'custom-conf-filelist-tar.list')
3427 if not os.path.exists(__confdir):
3428 os.mkdir(__confdir)
3429 if not os.path.exists(__listdir):
3430 os.mkdir(__listdir)
3431 if not os.path.exists(__bothdir):
3432 os.mkdir(__bothdir)
3433 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-tar.conf')):
3434 remove(os.path.join(__testdir, 'custom-conf-filelist-tar.conf'))
3435 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-tar.list')):
3436 remove(os.path.join(__testdir, 'custom-conf-filelist-tar.list'))
3437 if os.path.exists(__resultconffile):
3438 remove(__resultconffile)
3439 if os.path.exists(__resultlistfile):
3440 remove(__resultlistfile)
3441 if os.path.exists(__resultbothconffile):
3442 remove(__resultbothconffile)
3443 if os.path.exists(__resultbothlistfile):
3444 remove(__resultbothlistfile)
3445 if 'PYTHONEXE' in environ:
3446 __retcode1 = subprocess.call([PYTHONEXE, EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3447 else:
3448 __retcode1 = subprocess.call([EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3449 if 'PYTHONEXE' in environ:
3450 __retcode2 = subprocess.call([PYTHONEXE, EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3451 else:
3452 __retcode2 = subprocess.call([EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3453 if 'PYTHONEXE' in environ:
3454 __retcode3 = subprocess.call([PYTHONEXE, EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3455 else:
3456 __retcode3 = subprocess.call([EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3457 if __retcode1 != 0 and __retcode2 != 0 and __retcode3 != 0:
3458 __queue.put('{} - {}return code:{} {} {}'.format(__testname, KOMSG, str(__retcode1), str(__retcode2), str(__retcode3)))
3459 else:
3460 if not os.path.exists(__resultconffile):
3461 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultconffile))
3462 elif not os.path.exists(__resultlistfile):
3463 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultlistfile))
3464 elif not os.path.exists(__resultbothconffile):
3465 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothconffile))
3466 elif not os.path.exists(__resultbothlistfile):
3467 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothlistfile))
3468 else:
3469 __queue.put('{} - {}'.format(__testname, OKMSG))
3470
3471 class Test_custom_conf_filelist_gzip:
3472 '''Test to define a custom location to write conf and listfile files for gzip archives'''
3473 def __init__(self, q):
3474 __queue = q
3475 __res = True
3476 __testname = self.__class__.__name__
3477 __testdir = os.path.join(ABSPATH, 'functional-tests/custom-conf-filelist-gzip')
3478 __confdir = os.path.join(__testdir, 'conf')
3479 __listdir = os.path.join(__testdir, 'list')
3480 __bothdir = os.path.join(__testdir, 'both')
3481 __archive = os.path.join(__testdir, 'custom-conf-filelist-gzip.gz')
3482 __resultconffile = os.path.join(__testdir, 'conf', 'custom-conf-filelist-gzip.conf')
3483 __resultlistfile = os.path.join(__testdir, 'list', 'custom-conf-filelist-gzip.list')
3484 __resultbothconffile = os.path.join(__testdir, 'both', 'custom-conf-filelist-gzip.conf')
3485 __resultbothlistfile = os.path.join(__testdir, 'both', 'custom-conf-filelist-gzip.list')
3486 if not os.path.exists(__confdir):
3487 os.mkdir(__confdir)
3488 if not os.path.exists(__listdir):
3489 os.mkdir(__listdir)
3490 if not os.path.exists(__bothdir):
3491 os.mkdir(__bothdir)
3492 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-gzip.conf')):
3493 remove(os.path.join(__testdir, 'custom-conf-filelist-gzip.conf'))
3494 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-gzip.list')):
3495 remove(os.path.join(__testdir, 'custom-conf-filelist-gzip.list'))
3496 if os.path.exists(__resultconffile):
3497 remove(__resultconffile)
3498 if os.path.exists(__resultlistfile):
3499 remove(__resultlistfile)
3500 if os.path.exists(__resultbothconffile):
3501 remove(__resultbothconffile)
3502 if os.path.exists(__resultbothlistfile):
3503 remove(__resultbothlistfile)
3504 if 'PYTHONEXE' in environ:
3505 __retcode1 = subprocess.call([PYTHONEXE, EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3506 else:
3507 __retcode1 = subprocess.call([EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3508 if 'PYTHONEXE' in environ:
3509 __retcode2 = subprocess.call([PYTHONEXE, EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3510 else:
3511 __retcode2 = subprocess.call([EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3512 if 'PYTHONEXE' in environ:
3513 __retcode3 = subprocess.call([PYTHONEXE, EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3514 else:
3515 __retcode3 = subprocess.call([EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3516 if __retcode1 != 0 and __retcode2 != 0 and __retcode3 != 0:
3517 __queue.put('{} - {}return code:{} {} {}'.format(__testname, KOMSG, str(__retcode1), str(__retcode2), str(__retcode3)))
3518 else:
3519 if not os.path.exists(__resultconffile):
3520 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultconffile))
3521 elif not os.path.exists(__resultlistfile):
3522 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultlistfile))
3523 elif not os.path.exists(__resultbothconffile):
3524 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothconffile))
3525 elif not os.path.exists(__resultbothlistfile):
3526 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothlistfile))
3527 else:
3528 __queue.put('{} - {}'.format(__testname, OKMSG))
3529
3530 class Test_custom_conf_filelist_bzip2:
3531 '''Test to define a custom location to write conf and listfile files for bzip2 archives'''
3532 def __init__(self, q):
3533 __queue = q
3534 __res = True
3535 __testname = self.__class__.__name__
3536 __testdir = os.path.join(ABSPATH, 'functional-tests/custom-conf-filelist-bzip2')
3537 __confdir = os.path.join(__testdir, 'conf')
3538 __listdir = os.path.join(__testdir, 'list')
3539 __bothdir = os.path.join(__testdir, 'both')
3540 __archive = os.path.join(__testdir, 'custom-conf-filelist-bzip2.bz2')
3541 __resultconffile = os.path.join(__testdir, 'conf', 'custom-conf-filelist-bzip2.conf')
3542 __resultlistfile = os.path.join(__testdir, 'list', 'custom-conf-filelist-bzip2.list')
3543 __resultbothconffile = os.path.join(__testdir, 'both', 'custom-conf-filelist-bzip2.conf')
3544 __resultbothlistfile = os.path.join(__testdir, 'both', 'custom-conf-filelist-bzip2.list')
3545 if not os.path.exists(__confdir):
3546 os.mkdir(__confdir)
3547 if not os.path.exists(__listdir):
3548 os.mkdir(__listdir)
3549 if not os.path.exists(__bothdir):
3550 os.mkdir(__bothdir)
3551 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-bzip2.conf')):
3552 remove(os.path.join(__testdir, 'custom-conf-filelist-bzip2.conf'))
3553 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-bzip2.list')):
3554 remove(os.path.join(__testdir, 'custom-conf-filelist-bzip2.list'))
3555 if os.path.exists(__resultconffile):
3556 remove(__resultconffile)
3557 if os.path.exists(__resultlistfile):
3558 remove(__resultlistfile)
3559 if os.path.exists(__resultbothconffile):
3560 remove(__resultbothconffile)
3561 if os.path.exists(__resultbothlistfile):
3562 remove(__resultbothlistfile)
3563 if 'PYTHONEXE' in environ:
3564 __retcode1 = subprocess.call([PYTHONEXE, EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3565 else:
3566 __retcode1 = subprocess.call([EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3567 if 'PYTHONEXE' in environ:
3568 __retcode2 = subprocess.call([PYTHONEXE, EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3569 else:
3570 __retcode2 = subprocess.call([EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3571 if 'PYTHONEXE' in environ:
3572 __retcode3 = subprocess.call([PYTHONEXE, EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3573 else:
3574 __retcode3 = subprocess.call([EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3575 if __retcode1 != 0 and __retcode2 != 0 and __retcode3 != 0:
3576 __queue.put('{} - {}return code:{} {} {}'.format(__testname, KOMSG, str(__retcode1), str(__retcode2), str(__retcode3)))
3577 else:
3578 if not os.path.exists(__resultconffile):
3579 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultconffile))
3580 elif not os.path.exists(__resultlistfile):
3581 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultlistfile))
3582 elif not os.path.exists(__resultbothconffile):
3583 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothconffile))
3584 elif not os.path.exists(__resultbothlistfile):
3585 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothlistfile))
3586 else:
3587 __queue.put('{} - {}'.format(__testname, OKMSG))
3588
3589 class Test_custom_conf_filelist_lzma:
3590 '''Test to define a custom location to write conf and listfile files for lzma archives'''
3591 def __init__(self, q):
3592 __queue = q
3593 __res = True
3594 __testname = self.__class__.__name__
3595 __testdir = os.path.join(ABSPATH, 'functional-tests/custom-conf-filelist-lzma')
3596 __confdir = os.path.join(__testdir, 'conf')
3597 __listdir = os.path.join(__testdir, 'list')
3598 __bothdir = os.path.join(__testdir, 'both')
3599 __archive = os.path.join(__testdir, 'custom-conf-filelist-lzma.xz')
3600 __resultconffile = os.path.join(__testdir, 'conf', 'custom-conf-filelist-lzma.conf')
3601 __resultlistfile = os.path.join(__testdir, 'list', 'custom-conf-filelist-lzma.list')
3602 __resultbothconffile = os.path.join(__testdir, 'both', 'custom-conf-filelist-lzma.conf')
3603 __resultbothlistfile = os.path.join(__testdir, 'both', 'custom-conf-filelist-lzma.list')
3604 if not os.path.exists(__confdir):
3605 os.mkdir(__confdir)
3606 if not os.path.exists(__listdir):
3607 os.mkdir(__listdir)
3608 if not os.path.exists(__bothdir):
3609 os.mkdir(__bothdir)
3610 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-lzma.conf')):
3611 remove(os.path.join(__testdir, 'custom-conf-filelist-lzma.conf'))
3612 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-lzma.list')):
3613 remove(os.path.join(__testdir, 'custom-conf-filelist-lzma.list'))
3614 if os.path.exists(__resultconffile):
3615 remove(__resultconffile)
3616 if os.path.exists(__resultlistfile):
3617 remove(__resultlistfile)
3618 if os.path.exists(__resultbothconffile):
3619 remove(__resultbothconffile)
3620 if os.path.exists(__resultbothlistfile):
3621 remove(__resultbothlistfile)
3622 if 'PYTHONEXE' in environ:
3623 __retcode1 = subprocess.call([PYTHONEXE, EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3624 else:
3625 __retcode1 = subprocess.call([EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3626 if 'PYTHONEXE' in environ:
3627 __retcode2 = subprocess.call([PYTHONEXE, EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3628 else:
3629 __retcode2 = subprocess.call([EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3630 if 'PYTHONEXE' in environ:
3631 __retcode3 = subprocess.call([PYTHONEXE, EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3632 else:
3633 __retcode3 = subprocess.call([EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3634 if __retcode1 != 0 and __retcode2 != 0 and __retcode3 != 0:
3635 __queue.put('{} - {}return code:{} {} {}'.format(__testname, KOMSG, str(__retcode1), str(__retcode2), str(__retcode3)))
3636 else:
3637 if not os.path.exists(__resultconffile):
3638 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultconffile))
3639 elif not os.path.exists(__resultlistfile):
3640 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultlistfile))
3641 elif not os.path.exists(__resultbothconffile):
3642 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothconffile))
3643 elif not os.path.exists(__resultbothlistfile):
3644 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothlistfile))
3645 else:
3646 __queue.put('{} - {}'.format(__testname, OKMSG))
3647
3648 class Test_custom_conf_filelist_zip:
3649 '''Test to define a custom location to write conf and listfile files for zip archives'''
3650 def __init__(self, q):
3651 __queue = q
3652 __res = True
3653 __testname = self.__class__.__name__
3654 __testdir = os.path.join(ABSPATH, 'functional-tests/custom-conf-filelist-zip')
3655 __confdir = os.path.join(__testdir, 'conf')
3656 __listdir = os.path.join(__testdir, 'list')
3657 __bothdir = os.path.join(__testdir, 'both')
3658 __archive = os.path.join(__testdir, 'custom-conf-filelist-zip.zip')
3659 __resultconffile = os.path.join(__testdir, 'conf', 'custom-conf-filelist-zip.conf')
3660 __resultlistfile = os.path.join(__testdir, 'list', 'custom-conf-filelist-zip.list')
3661 __resultbothconffile = os.path.join(__testdir, 'both', 'custom-conf-filelist-zip.conf')
3662 __resultbothlistfile = os.path.join(__testdir, 'both', 'custom-conf-filelist-zip.list')
3663 if not os.path.exists(__confdir):
3664 os.mkdir(__confdir)
3665 if not os.path.exists(__listdir):
3666 os.mkdir(__listdir)
3667 if not os.path.exists(__bothdir):
3668 os.mkdir(__bothdir)
3669 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-zip.conf')):
3670 remove(os.path.join(__testdir, 'custom-conf-filelist-zip.conf'))
3671 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-zip.list')):
3672 remove(os.path.join(__testdir, 'custom-conf-filelist-zip.list'))
3673 if os.path.exists(__resultconffile):
3674 remove(__resultconffile)
3675 if os.path.exists(__resultlistfile):
3676 remove(__resultlistfile)
3677 if os.path.exists(__resultbothconffile):
3678 remove(__resultbothconffile)
3679 if os.path.exists(__resultbothlistfile):
3680 remove(__resultbothlistfile)
3681 if 'PYTHONEXE' in environ:
3682 __retcode1 = subprocess.call([PYTHONEXE, EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3683 else:
3684 __retcode1 = subprocess.call([EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3685 if 'PYTHONEXE' in environ:
3686 __retcode2 = subprocess.call([PYTHONEXE, EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3687 else:
3688 __retcode2 = subprocess.call([EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3689 if 'PYTHONEXE' in environ:
3690 __retcode3 = subprocess.call([PYTHONEXE, EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3691 else:
3692 __retcode3 = subprocess.call([EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3693 if __retcode1 != 0 and __retcode2 != 0 and __retcode3 != 0:
3694 __queue.put('{} - {}return code:{} {} {}'.format(__testname, KOMSG, str(__retcode1), str(__retcode2), str(__retcode3)))
3695 else:
3696 if not os.path.exists(__resultconffile):
3697 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultconffile))
3698 elif not os.path.exists(__resultlistfile):
3699 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultlistfile))
3700 elif not os.path.exists(__resultbothconffile):
3701 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothconffile))
3702 elif not os.path.exists(__resultbothlistfile):
3703 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothlistfile))
3704 else:
3705 __queue.put('{} - {}'.format(__testname, OKMSG))
3706
3707 class Test_custom_conf_filelist_tree:
3708 '''Test to define a custom location to write conf and listfile files for a tree of files'''
3709 def __init__(self, q):
3710 __queue = q
3711 __res = True
3712 __testname = self.__class__.__name__
3713 __testdir = os.path.join(ABSPATH, 'functional-tests/custom-conf-filelist-tree')
3714 __confdir = os.path.join(__testdir, 'conf')
3715 __listdir = os.path.join(__testdir, 'list')
3716 __bothdir = os.path.join(__testdir, 'both')
3717 __archive = os.path.join(__testdir, 'custom-conf-filelist-tree')
3718 __resultconffile = os.path.join(__testdir, 'conf', 'custom-conf-filelist-tree.conf')
3719 __resultlistfile = os.path.join(__testdir, 'list', 'custom-conf-filelist-tree.list')
3720 __resultbothconffile = os.path.join(__testdir, 'both', 'custom-conf-filelist-tree.conf')
3721 __resultbothlistfile = os.path.join(__testdir, 'both', 'custom-conf-filelist-tree.list')
3722 if not os.path.exists(__confdir):
3723 os.mkdir(__confdir)
3724 if not os.path.exists(__listdir):
3725 os.mkdir(__listdir)
3726 if not os.path.exists(__bothdir):
3727 os.mkdir(__bothdir)
3728 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-tree.conf')):
3729 remove(os.path.join(__testdir, 'custom-conf-filelist-tree.conf'))
3730 if os.path.exists(os.path.join(__testdir, 'custom-conf-filelist-tree.list')):
3731 remove(os.path.join(__testdir, 'custom-conf-filelist-tree.list'))
3732 if os.path.exists(__resultconffile):
3733 remove(__resultconffile)
3734 if os.path.exists(__resultlistfile):
3735 remove(__resultlistfile)
3736 if os.path.exists(__resultbothconffile):
3737 remove(__resultbothconffile)
3738 if os.path.exists(__resultbothlistfile):
3739 remove(__resultbothlistfile)
3740 if 'PYTHONEXE' in environ:
3741 __retcode1 = subprocess.call([PYTHONEXE, EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3742 else:
3743 __retcode1 = subprocess.call([EXE, '-C', os.path.join(__testdir, 'conf/'), OPTHASHES, OPTFULLGEN, __archive])
3744 if 'PYTHONEXE' in environ:
3745 __retcode2 = subprocess.call([PYTHONEXE, EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3746 else:
3747 __retcode2 = subprocess.call([EXE, '-L', os.path.join(__testdir, 'list/'), OPTHASHES, OPTFULLGEN, __archive])
3748 if 'PYTHONEXE' in environ:
3749 __retcode3 = subprocess.call([PYTHONEXE, EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3750 else:
3751 __retcode3 = subprocess.call([EXE, '-O', os.path.join(__testdir, 'both/'), OPTHASHES, OPTFULLGEN, __archive])
3752 if __retcode1 != 0 and __retcode2 != 0 and __retcode3 != 0:
3753 __queue.put('{} - {}return code:{} {} {}'.format(__testname, KOMSG, str(__retcode1), str(__retcode2), str(__retcode3)))
3754 else:
3755 if not os.path.exists(__resultconffile):
3756 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultconffile))
3757 elif not os.path.exists(__resultlistfile):
3758 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultlistfile))
3759 elif not os.path.exists(__resultbothconffile):
3760 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothconffile))
3761 elif not os.path.exists(__resultbothlistfile):
3762 __queue.put('{} - {}missing {}'.format(__testname, KOMSG, __resultbothlistfile))
3763 else:
3764 __queue.put('{} - {}'.format(__testname, OKMSG))
3765
3766 class Test_hashtype_option:
3767 '''Test the hashtype option'''
3768 def __init__(self, q):
3769 __queue = q
3770 __res = True
3771 __testname = self.__class__.__name__
3772 __testdir = os.path.join(ABSPATH, 'functional-tests/hashtype-option')
3773 __targzdir = os.path.join(__testdir, 'tar-gz')
3774 __gzipdir = os.path.join(__testdir, 'gzip')
3775 __bzip2dir = os.path.join(__testdir, 'bzip2')
3776 __lzmadir = os.path.join(__testdir, 'lzma')
3777 __treedir = os.path.join(__testdir, 'tree')
3778 __zipdir = os.path.join(__testdir, 'zip')
3779 __resulttargzfile = os.path.join(__targzdir, 'hashtype-option.list')
3780 __resultgzipfile = os.path.join(__gzipdir, 'hashtype-option.list')
3781 __resultbzip2file = os.path.join(__bzip2dir, 'hashtype-option.list')
3782 __resultlzmafile = os.path.join(__lzmadir, 'hashtype-option.list')
3783 __resultzipfile = os.path.join(__zipdir, 'hashtype-option.list')
3784 __resulttreefile = os.path.join(__treedir, 'hashtype-option.list')
3785 __targzarchive = os.path.join(__targzdir, 'hashtype-option.tar.gz')
3786 __gziparchive = os.path.join(__gzipdir, 'hashtype-option.gz')
3787 __bzip2archive = os.path.join(__bzip2dir, 'hashtype-option.bz2')
3788 __lzmaarchive = os.path.join(__lzmadir, 'hashtype-option.xz')
3789 __treearchive = os.path.join(__treedir, 'hashtype-option')
3790 __ziparchive = os.path.join(__zipdir, 'hashtype-option.zip')
3791 if os.path.exists(__resulttargzfile):
3792 remove(__resulttargzfile)
3793 if os.path.exists(__resultgzipfile):
3794 remove(__resultgzipfile)
3795 if os.path.exists(__resultbzip2file):
3796 remove(__resultbzip2file)
3797 if os.path.exists(__resultlzmafile):
3798 remove(__resultlzmafile)
3799 if os.path.exists(__resultzipfile):
3800 remove(__resultzipfile)
3801 if os.path.exists(__resulttreefile):
3802 remove(__resulttreefile)
3803 # sha1
3804 if 'PYTHONEXE' in environ:
3805 __retcode1 = subprocess.call([PYTHONEXE, EXE, '-O', __targzdir, OPTHASHTYPE, 'sha1', OPTHASHES, OPTFULLGEN, __targzarchive])
3806 else:
3807 __retcode1 = subprocess.call([EXE, '-O', __targzdir, OPTHASHTYPE, 'sha1', OPTHASHES, OPTFULLGEN, __targzarchive])
3808 # sha224
3809 if 'PYTHONEXE' in environ:
3810 __retcode2 = subprocess.call([PYTHONEXE, EXE, '-O', __gzipdir, OPTHASHTYPE, 'sha224', OPTHASHES, OPTFULLGEN, __gziparchive])
3811 else:
3812 __retcode2 = subprocess.call([EXE, '-O', __gzipdir, OPTHASHTYPE, 'sha224', OPTHASHES, OPTFULLGEN, __gziparchive])
3813 # sha256
3814 if 'PYTHONEXE' in environ:
3815 __retcode3 = subprocess.call([PYTHONEXE, EXE, '-O', __bzip2dir, OPTHASHTYPE, 'sha256', OPTHASHES, OPTFULLGEN, __bzip2archive])
3816 else:
3817 __retcode3 = subprocess.call([EXE, '-O', __bzip2dir, OPTHASHTYPE, 'sha256', OPTHASHES, OPTFULLGEN, __bzip2archive])
3818 # sha384
3819 if 'PYTHONEXE' in environ:
3820 __retcode4 = subprocess.call([PYTHONEXE, EXE, '-O', __lzmadir, OPTHASHTYPE, 'sha384', OPTHASHES, OPTFULLGEN, __lzmaarchive])
3821 else:
3822 __retcode4 = subprocess.call([EXE, '-O', __lzmadir, OPTHASHTYPE, 'sha384', OPTHASHES, OPTFULLGEN, __lzmaarchive])
3823 # sha512
3824 if 'PYTHONEXE' in environ:
3825 __retcode5 = subprocess.call([PYTHONEXE, EXE, '-O', __zipdir, OPTHASHTYPE, 'sha512', OPTHASHES, OPTFULLGEN, __ziparchive])
3826 else:
3827 __retcode5 = subprocess.call([EXE, '-O', __zipdir, OPTHASHTYPE, 'sha512', OPTHASHES, OPTFULLGEN, __ziparchive])
3828 # sha1 again
3829 if 'PYTHONEXE' in environ:
3830 __retcode6 = subprocess.call([PYTHONEXE, EXE, '-O', __treedir, OPTHASHTYPE, 'sha1', OPTHASHES, OPTFULLGEN, __treearchive])
3831 else:
3832 __retcode6 = subprocess.call([EXE, '-O', __treedir, OPTHASHTYPE, 'sha1', OPTHASHES, OPTFULLGEN, __treearchive])
3833 if __retcode1 != 0 and __retcode2 != 0 and __retcode3 != 0 and __retcode4 != 0 and __retcode5 != 0:
3834 __queue.put('{} - {}return code:{} {} {} {} {}'.format(__testname, KOMSG, str(__retcode1), str(__retcode2), str(__retcode3), str(__retcode4), str(__retcode5), str(__retcode6)))
3835 else:
3836 __returnok = True
3837 for __test in [(__resulttargzfile, 'sha1'), (__resultgzipfile, 'sha224'), (__resultbzip2file, 'sha256'), (__resultlzmafile, 'sha384'), (__resultzipfile, 'sha512'), (__resulttreefile, 'sha1')]:
3838 with open(__test[0], 'r') as __file:
3839 __content = __file.read()
3840 if __test[1] not in __content:
3841 __returnok = False
3842 __queue.put('{} - {} - {} not in {}'.format(__testname, KOMSG, __test[0], __test[1]))
3843 if __returnok:
3844 __queue.put('{} - {}'.format(__testname, OKMSG))
3845
3846 class Test_exceptions_file_option:
3847 '''Test the exceptions file option'''
3848 def __init__(self, q):
3849 __queue = q
3850 __res = True
3851 __testname = self.__class__.__name__
3852 __testdir = os.path.join(ABSPATH, 'functional-tests/exceptions-file-option')
3853 __targzdir = os.path.join(__testdir, 'tar-gz')
3854 __zipdir = os.path.join(__testdir, 'zip')
3855 __gzipdir = os.path.join(__testdir, 'gzip')
3856 __bzip2dir = os.path.join(__testdir, 'bzip2')
3857 __lzmadir = os.path.join(__testdir, 'lzma')
3858 __treedir = os.path.join(__testdir, 'tree')
3859 __resulttargzfile = os.path.join(__targzdir, 'exceptions-file-option.list')
3860 __resultzipfile = os.path.join(__zipdir, 'exceptions-file-option.list')
3861 __resultgzipfile = os.path.join(__gzipdir, 'exceptions-file-option.list')
3862 __resultbzip2file = os.path.join(__bzip2dir, 'exceptions-file-option.list')
3863 __resultlzmafile = os.path.join(__lzmadir, 'exceptions-file-option.list')
3864 __resulttreefile = os.path.join(__treedir, 'exceptions-file-option.list')
3865 __targzexceptionsfile = os.path.join(__targzdir, 'targzexceptionsfile')
3866 __zipexceptionsfile = os.path.join(__zipdir, 'zipexceptionsfile')
3867 __gzipexceptionsfile = os.path.join(__gzipdir, 'gzipexceptionsfile')
3868 __bzip2exceptionsfile = os.path.join(__bzip2dir, 'bzip2exceptionsfile')
3869 __lzmaexceptionsfile = os.path.join(__lzmadir, 'lzmaexceptionsfile')
3870 __treeexceptionsfile = os.path.join(__treedir, 'treeexceptionsfile')
3871 __targzarchive = os.path.join(__targzdir, 'exceptions-file-option.tar.gz')
3872 __ziparchive = os.path.join(__zipdir, 'exceptions-file-option.zip')
3873 __gziparchive = os.path.join(__gzipdir, 'exceptions-file-option.gz')
3874 __bzip2archive = os.path.join(__bzip2dir, 'exceptions-file-option.bz2')
3875 __lzmaarchive = os.path.join(__lzmadir, 'exceptions-file-option.xz')
3876 __treearchive = os.path.join(__treedir, 'exceptions-file-option')
3877 if os.path.exists(__resulttargzfile):
3878 remove(__resulttargzfile)
3879 if os.path.exists(__resultzipfile):
3880 remove(__resultzipfile)
3881 if os.path.exists(__resultgzipfile):
3882 remove(__resultgzipfile)
3883 if os.path.exists(__resultbzip2file):
3884 remove(__resultbzip2file)
3885 if os.path.exists(__resultlzmafile):
3886 remove(__resultlzmafile)
3887 if os.path.exists(__resulttreefile):
3888 remove(__resulttreefile)
3889 # tar.gz
3890 if 'PYTHONEXE' in environ:
3891 __retcode1 = subprocess.call([PYTHONEXE, EXE, '-O', __targzdir, OPTEXCEPTIONSFILE, __targzexceptionsfile, OPTFULLGEN, __targzarchive])
3892 else:
3893 __retcode1 = subprocess.call([EXE, '-O', __targzdir, OPTEXCEPTIONSFILE, __targzexceptionsfile, OPTFULLGEN, __targzarchive])
3894 # zip
3895 if 'PYTHONEXE' in environ:
3896 __retcode2 = subprocess.call([PYTHONEXE, EXE, '-O', __zipdir, OPTEXCEPTIONSFILE, __zipexceptionsfile, OPTFULLGEN, __ziparchive])
3897 else:
3898 __retcode2 = subprocess.call([EXE, '-O', __zipdir, OPTEXCEPTIONSFILE, __zipexceptionsfile, OPTFULLGEN, __ziparchive])
3899 # gzip
3900 if 'PYTHONEXE' in environ:
3901 __retcode3 = subprocess.call([PYTHONEXE, EXE, '-O', __gzipdir, OPTEXCEPTIONSFILE, __gzipexceptionsfile, OPTFULLGEN, __gziparchive])
3902 else:
3903 __retcode3 = subprocess.call([EXE, '-O', __gzipdir, OPTEXCEPTIONSFILE, __gzipexceptionsfile, OPTFULLGEN, __gziparchive])
3904 # bzip2
3905 if 'PYTHONEXE' in environ:
3906 __retcode4 = subprocess.call([PYTHONEXE, EXE, '-O', __bzip2dir, OPTEXCEPTIONSFILE, __bzip2exceptionsfile, OPTFULLGEN, __bzip2archive])
3907 else:
3908 __retcode4 = subprocess.call([EXE, '-O', __bzip2dir, OPTEXCEPTIONSFILE, __bzip2exceptionsfile, OPTFULLGEN, __bzip2archive])
3909 # lzma
3910 if 'PYTHONEXE' in environ:
3911 __retcode5 = subprocess.call([PYTHONEXE, EXE, '-O', __lzmadir, OPTEXCEPTIONSFILE, __lzmaexceptionsfile, OPTFULLGEN, __lzmaarchive])
3912 else:
3913 __retcode5 = subprocess.call([EXE, '-O', __lzmadir, OPTEXCEPTIONSFILE, __lzmaexceptionsfile, OPTFULLGEN, __lzmaarchive])
3914 # tree
3915 if 'PYTHONEXE' in environ:
3916 __retcode6 = subprocess.call([PYTHONEXE, EXE, '-O', __treedir, OPTEXCEPTIONSFILE, __treeexceptionsfile, OPTFULLGEN, __treearchive])
3917 else:
3918 __retcode6 = subprocess.call([EXE, '-O', __treedir, OPTEXCEPTIONSFILE, __treeexceptionsfile, OPTFULLGEN, __treearchive])
3919 if __retcode1 != 0 and __retcode2 != 0 and __retcode3 != 0 and __retcode4 != 0 and __retcode5 != 0 and __retcode6 != 0 :
3920 __queue.put('{} - {}return code:{} {} {} {} {}'.format(__testname, KOMSG, str(__retcode1), str(__retcode2), str(__retcode3), str(__retcode4), str(__retcode5), str(__retcode6)))
3921 else:
3922 __returnok = True
3923 for __test in [(__resulttargzfile, 'sha1'), (__resultgzipfile, 'sha224'), (__resultbzip2file, 'sha384'), (__resultlzmafile, 'sha512'), (__resultzipfile, 'sha224'), (__resulttreefile, 'sha1')]:
3924 with open(__test[0], 'r') as __file:
3925 __content = __file.read()
3926 if __test[1] not in __content:
3927 __returnok = False
3928 __queue.put('{} - {} - {} not in {}'.format(__testname, KOMSG, __test[0], __test[1]))
3929 if __returnok:
3930 __queue.put('{} - {}'.format(__testname, OKMSG))
3931
3932 if __name__ == '__main__':
3933 processes = []
3934 results = []
3935 koresults = []
3936 q = Queue()
3937
3938 for element in dir(functionaltests):
3939 if 'Test' in element:
3940 processes.append(Process(target=getattr(functionaltests, element), args=(q,)))
3941 processes[-1].start()
3942 for p in processes:
3943 results.append(q.get())
3944 p.join()
3945 # Establishing list of KOs
3946 for result in results:
3947 if KOMSG in result:
3948 koresults.append(result)
3949 if len(koresults) != 0:
3950 print(linesep.join(koresults))
3951 sys.exit(1)
3952 else:
3953 print(linesep.join(results))
3954