work around false positives in deltatar fs checks during rpmbuild
[python-delta-tar] / runtests.py
CommitLineData
be60ffd0 1#!/usr/bin/env python3
ae48acc8 2
866c42e6
DGM
3# Copyright (C) 2013 Intra2net AG
4#
494b38aa
DGM
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published
7# by the Free Software Foundation; either version 3 of the License, or
866c42e6
DGM
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
494b38aa 13# GNU Lesser General Public License for more details.
866c42e6
DGM
14#
15# You should have received a copy of the GNU General Public License
494b38aa
DGM
16# along with this program. If not, see
17# <http://www.gnu.org/licenses/lgpl-3.0.html>
866c42e6
DGM
18
19
ae48acc8
ERE
20import unittest
21
3ba1441c 22from testing.test_crypto import HeaderTest, AESGCMTest
8ab92b45 23from testing.test_multivol import MultivolGnuFormatTest, MultivolPaxFormatTest
5fdff89f 24from testing.test_concat_compress import ConcatCompressTest
00b8c150
PG
25from testing.test_recover import \
26 RecoverCorruptPayloadTest \
27 , RecoverCorruptPayloadGZTest \
28 , RecoverCorruptPayloadGZAESTest \
0349168a 29 , RecoverCorruptHeaderTest \
00b8c150 30 , RecoverCorruptHeaderGZTest \
da8996f0
PG
31 , RecoverCorruptHeaderGZAESTest \
32 , RecoverCorruptEntireHeaderTest \
33 , RecoverCorruptEntireHeaderGZTest \
517d35b7
PG
34 , RecoverCorruptEntireHeaderGZAESTest \
35 , RecoverCorruptTrailingDataTest \
36 , RecoverCorruptTrailingDataGZTest \
37 , RecoverCorruptTrailingDataGZAESTest
0112ba0d 38from testing.test_rescue_tar import RescueTarTest
6e812ad9 39from testing.test_encryption import EncryptionTest
1a985013
ERE
40from testing.test_deltatar import (DeltaTarTest, DeltaTar2Test,
41 DeltaTarStreamTest, DeltaTarGzipTest, DeltaTarGzipStreamTest,
42 DeltaTarGzipConcatTest, DeltaTarGzipAes128ConcatTest,
5ed1df9a 43 DeltaTarAes128ConcatTest
ac5e4184 44 )
08bb4b4a 45from testing.test_compression_level import suite
ae48acc8
ERE
46
47if __name__ == "__main__":
0165ca3c
PG
48 import sys
49 if len (sys.argv) == 1:
50 unittest.TextTestRunner().run(suite())
51 unittest.main()
52 else:
53 suite = unittest.TestSuite ()
54 def add (n):
55 ret = False
56 for group in [#testing.test_multivol
57 MultivolGnuFormatTest, MultivolPaxFormatTest
58 # testing.test_concat_compress
59 , ConcatCompressTest
60 # testing.test_rescue_tar
61 , RescueTarTest
62 # testing.test_encryption
63 , EncryptionTest
64 # testing.test_deltatar
65 , DeltaTarTest, DeltaTar2Test
66 , DeltaTarStreamTest, DeltaTarGzipTest
67 , DeltaTarGzipStreamTest, DeltaTarGzipConcatTest
68 , DeltaTarGzipAes128ConcatTest
5ed1df9a 69 , DeltaTarAes128ConcatTest
3ba1441c 70 , HeaderTest, AESGCMTest
96fe6399 71 # testing.test_recover
00b8c150
PG
72 , RecoverCorruptPayloadTest
73 , RecoverCorruptPayloadGZTest
74 , RecoverCorruptPayloadGZAESTest
0349168a 75 , RecoverCorruptHeaderTest
00b8c150
PG
76 , RecoverCorruptHeaderGZTest
77 , RecoverCorruptHeaderGZAESTest
da8996f0
PG
78 , RecoverCorruptEntireHeaderTest
79 , RecoverCorruptEntireHeaderGZTest
80 , RecoverCorruptEntireHeaderGZAESTest
517d35b7
PG
81 , RecoverCorruptTrailingDataTest
82 , RecoverCorruptTrailingDataGZTest
83 , RecoverCorruptTrailingDataGZAESTest
0165ca3c
PG
84 ]:
85 try:
86 t = group (n)
87 except ValueError: # no such test
88 continue
89 print ("including ā€œ%sā€" % n)
90 suite.addTest(t)
91 ret = True
92 return ret
93 n = 0
94 for arg in sys.argv [1:]:
95 if add (arg) is True:
96 n += 1
97 if n == 0:
98 print ("ERROR: no valid test name specified, please double-check",
99 file=sys.stderr)
100 sys.exit (-1)
101 runner = unittest.TextTestRunner ()
102 runner.run (suite)
103