add test for corruption of encrypted files
[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
96fe6399 25from testing.test_recover import RecoverTest, RecoverGZTest, RecoverGZAESTest
0112ba0d 26from testing.test_rescue_tar import RescueTarTest
6e812ad9 27from testing.test_encryption import EncryptionTest
1a985013
ERE
28from testing.test_deltatar import (DeltaTarTest, DeltaTar2Test,
29 DeltaTarStreamTest, DeltaTarGzipTest, DeltaTarGzipStreamTest,
30 DeltaTarGzipConcatTest, DeltaTarGzipAes128ConcatTest,
5ed1df9a 31 DeltaTarAes128ConcatTest
ac5e4184 32 )
08bb4b4a 33from testing.test_compression_level import suite
ae48acc8
ERE
34
35if __name__ == "__main__":
0165ca3c
PG
36 import sys
37 if len (sys.argv) == 1:
38 unittest.TextTestRunner().run(suite())
39 unittest.main()
40 else:
41 suite = unittest.TestSuite ()
42 def add (n):
43 ret = False
44 for group in [#testing.test_multivol
45 MultivolGnuFormatTest, MultivolPaxFormatTest
46 # testing.test_concat_compress
47 , ConcatCompressTest
48 # testing.test_rescue_tar
49 , RescueTarTest
50 # testing.test_encryption
51 , EncryptionTest
52 # testing.test_deltatar
53 , DeltaTarTest, DeltaTar2Test
54 , DeltaTarStreamTest, DeltaTarGzipTest
55 , DeltaTarGzipStreamTest, DeltaTarGzipConcatTest
56 , DeltaTarGzipAes128ConcatTest
5ed1df9a 57 , DeltaTarAes128ConcatTest
3ba1441c 58 , HeaderTest, AESGCMTest
96fe6399
PG
59 # testing.test_recover
60 , RecoverTest, RecoverGZTest, RecoverGZAESTest
0165ca3c
PG
61 ]:
62 try:
63 t = group (n)
64 except ValueError: # no such test
65 continue
66 print ("including ā€œ%sā€" % n)
67 suite.addTest(t)
68 ret = True
69 return ret
70 n = 0
71 for arg in sys.argv [1:]:
72 if add (arg) is True:
73 n += 1
74 if n == 0:
75 print ("ERROR: no valid test name specified, please double-check",
76 file=sys.stderr)
77 sys.exit (-1)
78 runner = unittest.TextTestRunner ()
79 runner.run (suite)
80