Commit | Line | Data |
---|---|---|
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 |
20 | import unittest |
21 | ||
3ba1441c | 22 | from testing.test_crypto import HeaderTest, AESGCMTest |
8ab92b45 | 23 | from testing.test_multivol import MultivolGnuFormatTest, MultivolPaxFormatTest |
5fdff89f | 24 | from testing.test_concat_compress import ConcatCompressTest |
00b8c150 | 25 | from testing.test_recover import \ |
e25f31ac PG |
26 | RecoverCorruptPayloadSingleTest \ |
27 | , RecoverCorruptPayloadMultiTest \ | |
28 | , RecoverCorruptPayloadGZSingleTest \ | |
29 | , RecoverCorruptPayloadGZMultiTest \ | |
30 | , RecoverCorruptPayloadGZAESSingleTest \ | |
31 | , RecoverCorruptPayloadGZAESMultiTest \ | |
32 | , RecoverCorruptHeaderSingleTest \ | |
33 | , RecoverCorruptHeaderMultiTest \ | |
34 | , RecoverCorruptHeaderGZSingleTest \ | |
35 | , RecoverCorruptHeaderGZMultiTest \ | |
36 | , RecoverCorruptHeaderGZAESSingleTest \ | |
37 | , RecoverCorruptHeaderGZAESMultiTest \ | |
afb2d647 | 38 | , RescueCorruptHeaderCTSizeGZAESTest \ |
e25f31ac PG |
39 | , RecoverCorruptEntireHeaderSingleTest \ |
40 | , RecoverCorruptEntireHeaderMultiTest \ | |
41 | , RecoverCorruptEntireHeaderGZSingleTest \ | |
42 | , RecoverCorruptEntireHeaderGZMultiTest \ | |
43 | , RecoverCorruptEntireHeaderGZAESSingleTest \ | |
44 | , RecoverCorruptEntireHeaderGZAESMultiTest \ | |
afb2d647 PG |
45 | , RescueCorruptLeadingGarbageSingleTest \ |
46 | , RescueCorruptLeadingGarbageMultiTest \ | |
e25f31ac PG |
47 | , RecoverCorruptTrailingDataSingleTest \ |
48 | , RecoverCorruptTrailingDataMultiTest \ | |
49 | , RecoverCorruptTrailingDataGZSingleTest \ | |
50 | , RecoverCorruptTrailingDataGZMultiTest \ | |
51 | , RecoverCorruptTrailingDataGZAESSingleTest \ | |
20e1d773 PG |
52 | , RecoverCorruptTrailingDataGZAESMultiTest \ |
53 | , RecoverCorruptVolumeTest \ | |
54 | , RecoverCorruptVolumeGZTest \ | |
3692fd82 PG |
55 | , RecoverCorruptVolumeGZAESTest \ |
56 | , RecoverCorruptHoleTest \ | |
57 | , RecoverCorruptHoleGZTest \ | |
2fe5f6e7 PG |
58 | , RecoverCorruptHoleGZAESTest \ |
59 | , RescueCorruptHoleTest \ | |
60 | , RescueCorruptHoleGZTest \ | |
61 | , RescueCorruptHoleGZAESTest \ | |
047239f3 PG |
62 | , GenIndexIntactSingleTest \ |
63 | , GenIndexIntactSingleGZTest \ | |
64 | , GenIndexIntactSingleGZAESTest \ | |
65 | , GenIndexIntactMultiTest \ | |
66 | , GenIndexIntactMultiGZTest \ | |
6e1f5355 PG |
67 | , GenIndexIntactMultiGZAESTest \ |
68 | , GenIndexCorruptHoleTest \ | |
69 | , GenIndexCorruptHoleGZTest \ | |
70 | , GenIndexCorruptHoleGZAESTest \ | |
71 | , GenIndexCorruptEntireHeaderTest \ | |
72 | , GenIndexCorruptEntireHeaderGZTest \ | |
73 | , GenIndexCorruptEntireHeaderGZAESTest | |
74 | ||
0112ba0d | 75 | from testing.test_rescue_tar import RescueTarTest |
6e812ad9 | 76 | from testing.test_encryption import EncryptionTest |
1a985013 ERE |
77 | from testing.test_deltatar import (DeltaTarTest, DeltaTar2Test, |
78 | DeltaTarStreamTest, DeltaTarGzipTest, DeltaTarGzipStreamTest, | |
79 | DeltaTarGzipConcatTest, DeltaTarGzipAes128ConcatTest, | |
5ed1df9a | 80 | DeltaTarAes128ConcatTest |
ac5e4184 | 81 | ) |
08bb4b4a | 82 | from testing.test_compression_level import suite |
ae48acc8 ERE |
83 | |
84 | if __name__ == "__main__": | |
0165ca3c PG |
85 | import sys |
86 | if len (sys.argv) == 1: | |
87 | unittest.TextTestRunner().run(suite()) | |
88 | unittest.main() | |
89 | else: | |
90 | suite = unittest.TestSuite () | |
91 | def add (n): | |
92 | ret = False | |
93 | for group in [#testing.test_multivol | |
94 | MultivolGnuFormatTest, MultivolPaxFormatTest | |
95 | # testing.test_concat_compress | |
96 | , ConcatCompressTest | |
97 | # testing.test_rescue_tar | |
98 | , RescueTarTest | |
99 | # testing.test_encryption | |
100 | , EncryptionTest | |
101 | # testing.test_deltatar | |
102 | , DeltaTarTest, DeltaTar2Test | |
103 | , DeltaTarStreamTest, DeltaTarGzipTest | |
104 | , DeltaTarGzipStreamTest, DeltaTarGzipConcatTest | |
105 | , DeltaTarGzipAes128ConcatTest | |
5ed1df9a | 106 | , DeltaTarAes128ConcatTest |
3ba1441c | 107 | , HeaderTest, AESGCMTest |
e25f31ac | 108 | |
20e1d773 | 109 | # testing.test_recover |
e25f31ac PG |
110 | , RecoverCorruptPayloadSingleTest |
111 | , RecoverCorruptPayloadMultiTest | |
112 | , RecoverCorruptPayloadGZSingleTest | |
113 | , RecoverCorruptPayloadGZMultiTest | |
114 | , RecoverCorruptPayloadGZAESSingleTest | |
115 | , RecoverCorruptPayloadGZAESMultiTest | |
116 | , RecoverCorruptHeaderSingleTest | |
117 | , RecoverCorruptHeaderMultiTest | |
118 | , RecoverCorruptHeaderGZSingleTest | |
119 | , RecoverCorruptHeaderGZMultiTest | |
120 | , RecoverCorruptHeaderGZAESSingleTest | |
121 | , RecoverCorruptHeaderGZAESMultiTest | |
afb2d647 | 122 | , RescueCorruptHeaderCTSizeGZAESTest |
e25f31ac PG |
123 | , RecoverCorruptEntireHeaderSingleTest |
124 | , RecoverCorruptEntireHeaderMultiTest | |
125 | , RecoverCorruptEntireHeaderGZSingleTest | |
126 | , RecoverCorruptEntireHeaderGZMultiTest | |
127 | , RecoverCorruptEntireHeaderGZAESSingleTest | |
128 | , RecoverCorruptEntireHeaderGZAESMultiTest | |
afb2d647 PG |
129 | , RescueCorruptLeadingGarbageSingleTest |
130 | , RescueCorruptLeadingGarbageMultiTest | |
e25f31ac PG |
131 | , RecoverCorruptTrailingDataSingleTest |
132 | , RecoverCorruptTrailingDataMultiTest | |
133 | , RecoverCorruptTrailingDataGZSingleTest | |
134 | , RecoverCorruptTrailingDataGZMultiTest | |
135 | , RecoverCorruptTrailingDataGZAESSingleTest | |
20e1d773 PG |
136 | , RecoverCorruptVolumeTest |
137 | , RecoverCorruptVolumeGZTest | |
138 | , RecoverCorruptVolumeGZAESTest | |
3692fd82 PG |
139 | , RecoverCorruptHoleTest |
140 | , RecoverCorruptHoleGZTest | |
141 | , RecoverCorruptHoleGZAESTest | |
2fe5f6e7 PG |
142 | , RescueCorruptHoleTest |
143 | , RescueCorruptHoleGZTest | |
144 | , RescueCorruptHoleGZAESTest | |
047239f3 PG |
145 | , GenIndexIntactSingleTest |
146 | , GenIndexIntactSingleGZTest | |
147 | , GenIndexIntactSingleGZAESTest | |
148 | , GenIndexIntactMultiTest | |
149 | , GenIndexIntactMultiGZTest | |
150 | , GenIndexIntactMultiGZAESTest | |
6e1f5355 PG |
151 | , GenIndexCorruptHoleTest |
152 | , GenIndexCorruptHoleGZTest | |
153 | , GenIndexCorruptHoleGZAESTest | |
154 | , GenIndexCorruptEntireHeaderTest | |
155 | , GenIndexCorruptEntireHeaderGZTest | |
156 | , GenIndexCorruptEntireHeaderGZAESTest | |
0165ca3c PG |
157 | ]: |
158 | try: | |
159 | t = group (n) | |
160 | except ValueError: # no such test | |
161 | continue | |
162 | print ("including ā%sā" % n) | |
163 | suite.addTest(t) | |
164 | ret = True | |
165 | return ret | |
166 | n = 0 | |
167 | for arg in sys.argv [1:]: | |
168 | if add (arg) is True: | |
169 | n += 1 | |
170 | if n == 0: | |
171 | print ("ERROR: no valid test name specified, please double-check", | |
172 | file=sys.stderr) | |
173 | sys.exit (-1) | |
174 | runner = unittest.TextTestRunner () | |
175 | runner.run (suite) | |
176 |