Skip to content

Commit 22fe1e6

Browse files
committed
Rename old test files by adding old suffix
Rename test files testing the old code by adding an "old" suffix. This is done, so we can easily exclude them from linting. Signed-off-by: Martin Vrachev <[email protected]>
1 parent 5aa547d commit 22fe1e6

33 files changed

+53
-53
lines changed

docs/CONTRIBUTORS.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ Individual tests can also be executed. Optional '-v' flags can be added to
139139
increase log level up to DEBUG ('-vvvv').
140140
::
141141

142-
$ python3 test_updater.py # run a specific test file
143-
$ python3 test_updater.py TestUpdater.test_4_refresh # run a specific test
144-
$ python3 test_updater.py -vvvv TestUpdater.test_4_refresh # run test with DEBUG log level
142+
$ python3 test_updater_ng.py # run a specific test file
143+
$ python3 test_updater_ng.py TestUpdater.test_refresh_and_download # run a specific test
144+
$ python3 test_updater_ng.py -vvvv TestUpdater.test_refresh_and_download # run test with DEBUG log level
145145

146146

147147
All of the log levels and the corresponding options that could be used for testing are:
File renamed without changes.

tests/repository_data/generate_project_data.py renamed to tests/repository_data/generate_project_data_old.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
See LICENSE-MIT.txt OR LICENSE-APACHE.txt for licensing information.
1818
1919
<Purpose>
20-
Generate a pre-fabricated set of metadata files for 'test_developer_tool.py'
21-
test cases.
20+
Generate a pre-fabricated set of metadata files for
21+
'test_developer_tool_old.py' test cases.
2222
"""
2323

2424
import shutil

tests/simple_https_server.py renamed to tests/simple_https_server_old.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program>
8-
simple_https_server.py
8+
simple_https_server_old.py
99
1010
<Author>
1111
Vladimir Diaz.
@@ -53,7 +53,7 @@
5353
print(port_message)
5454

5555
if len(sys.argv) > 1 and certfile != sys.argv[1]:
56-
print('simple_https_server: cert file was not found: ' + sys.argv[1] +
56+
print('simple_https_server_old: cert file was not found: ' + sys.argv[1] +
5757
'; using default: ' + certfile + " certfile")
5858

5959
httpd.serve_forever()

tests/slow_retrieval_server.py renamed to tests/slow_retrieval_server_old.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
slow_retrieval_server.py
8+
slow_retrieval_server_old.py
99
1010
<Author>
1111
Konstantin Andrianov.
@@ -18,7 +18,7 @@
1818
1919
<Purpose>
2020
Server that throttles data by sending one byte at a time (specified time
21-
interval 'DELAY'). The server is used in 'test_slow_retrieval_attack.py'.
21+
interval 'DELAY'). The server is used in 'test_slow_retrieval_attack_old.py'.
2222
"""
2323

2424
import os

tests/test_arbitrary_package_attack.py renamed to tests/test_arbitrary_package_attack_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_arbitrary_package_attack.py
8+
test_arbitrary_package_attack_old.py
99
1010
<Author>
1111
Konstantin Andrianov.

tests/test_developer_tool.py renamed to tests/test_developer_tool_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_developer_tool.py.
8+
test_developer_tool_old.py.
99
1010
<Authors>
1111
Santiago Torres Arias <[email protected]>

tests/test_download.py renamed to tests/test_download_old.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program>
8-
test_download.py
8+
test_download_old.py
99
1010
<Author>
1111
Konstantin Andrianov.
@@ -19,7 +19,7 @@
1919
<Purpose>
2020
Unit test for 'download.py'.
2121
22-
NOTE: Make sure test_download.py is ran in 'tuf/tests/' directory.
22+
NOTE: Make sure test_download_old.py is ran in 'tuf/tests/' directory.
2323
Otherwise, module that launches simple server would not be found.
2424
2525
TODO: Adopt the environment variable management from test_proxy_use.py here.
@@ -274,16 +274,16 @@ def test_https_connection(self):
274274

275275

276276
good_https_server_handler = utils.TestServerProcess(log=logger,
277-
server='simple_https_server.py',
277+
server='simple_https_server_old.py',
278278
extra_cmd_args=[good_cert_fname])
279279
good2_https_server_handler = utils.TestServerProcess(log=logger,
280-
server='simple_https_server.py',
280+
server='simple_https_server_old.py',
281281
extra_cmd_args=[good2_cert_fname])
282282
bad_https_server_handler = utils.TestServerProcess(log=logger,
283-
server='simple_https_server.py',
283+
server='simple_https_server_old.py',
284284
extra_cmd_args=[bad_cert_fname])
285285
expd_https_server_handler = utils.TestServerProcess(log=logger,
286-
server='simple_https_server.py',
286+
server='simple_https_server_old.py',
287287
extra_cmd_args=[expired_cert_fname])
288288

289289
suffix = '/' + os.path.basename(target_filepath)

tests/test_endless_data_attack.py renamed to tests/test_endless_data_attack_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_endless_data_attack.py
8+
test_endless_data_attack_old.py
99
1010
<Author>
1111
Konstantin Andrianov.

tests/test_extraneous_dependencies_attack.py renamed to tests/test_extraneous_dependencies_attack_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_extraneous_dependencies_attack.py
8+
test_extraneous_dependencies_attack_old.py
99
1010
<Author>
1111
Zane Fisher.
File renamed without changes.

tests/test_formats.py renamed to tests/test_formats_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_formats.py
8+
test_formats_old.py
99
1010
<Author>
1111
Vladimir Diaz <[email protected]>

tests/test_indefinite_freeze_attack.py renamed to tests/test_indefinite_freeze_attack_old.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_indefinite_freeze_attack.py
8+
test_indefinite_freeze_attack_old.py
99
1010
<Author>
1111
Konstantin Andrianov.
@@ -36,7 +36,6 @@
3636
metadata without the client being aware.
3737
"""
3838

39-
import datetime
4039
import os
4140
import time
4241
import tempfile

tests/test_key_revocation_integration.py renamed to tests/test_key_revocation_integration_old.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_key_revocation_integration.py
8+
test_key_revocation_integration_old.py
99
1010
<Author>
1111
Vladimir Diaz.
@@ -18,7 +18,7 @@
1818
1919
<Purpose>
2020
Integration test that verifies top-level roles are updated after all of their
21-
keys have been revoked. There are unit tests in 'test_repository_tool.py'
21+
keys have been revoked. There are unit tests in 'test_repository_tool_old.py'
2222
that verify key and role revocation of specific roles, but these should be
2323
expanded to verify key revocations over the span of multiple snapshots of the
2424
repository.

tests/test_keydb.py renamed to tests/test_keydb_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_keydb.py
8+
test_keydb_old.py
99
1010
<Author>
1111
Vladimir Diaz <[email protected]>

tests/test_log.py renamed to tests/test_log_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_log.py
8+
test_log_old.py
99
1010
<Authors>
1111
Vladimir Diaz <[email protected]>

tests/test_mirrors.py renamed to tests/test_mirrors_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program>
8-
test_mirrors.py
8+
test_mirrors_old.py
99
1010
<Author>
1111
Konstantin Andrianov.

tests/test_mix_and_match_attack.py renamed to tests/test_mix_and_match_attack_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_mix_and_match_attack.py
8+
test_mix_and_match_attack_old.py
99
1010
<Author>
1111
Konstantin Andrianov.

tests/test_multiple_repositories_integration.py renamed to tests/test_multiple_repositories_integration_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_multiple_repositories_integration.py
8+
test_multiple_repositories_integration_old.py
99
1010
<Author>
1111
Vladimir Diaz <[email protected]>

tests/test_replay_attack.py renamed to tests/test_replay_attack_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_replay_attack.py
8+
test_replay_attack_old.py
99
1010
<Author>
1111
Konstantin Andrianov.

tests/test_repository_lib.py renamed to tests/test_repository_lib_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_repository_lib.py
8+
test_repository_lib_old.py
99
1010
<Author>
1111
Vladimir Diaz <[email protected]>

tests/test_repository_tool.py renamed to tests/test_repository_tool_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_repository_tool.py
8+
test_repository_tool_old.py
99
1010
<Author>
1111
Vladimir Diaz <[email protected]>

tests/test_roledb.py renamed to tests/test_roledb_old.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_roledb.py
8+
test_roledb_old.py
99
1010
<Author>
1111
Vladimir Diaz <[email protected]>
@@ -776,7 +776,7 @@ def setUpModule():
776776
def tearDownModule():
777777
# tearDownModule() is called after all the tests have run.
778778
# Ensure we clean up roledb. Courtesy is contagious, and it begins with
779-
# test_roledb.py.
779+
# test_roledb_old.py.
780780
tuf.roledb.clear_roledb()
781781

782782

tests/test_root_versioning_integration.py renamed to tests/test_root_versioning_integration_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_root_versioning_integration.py
8+
test_root_versioning_integration_old.py
99
1010
<Author>
1111
Evan Cordell.

tests/test_sig.py renamed to tests/test_sig_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_sig.py
8+
test_sig_old.py
99
1010
<Author>
1111
Geremy Condra

tests/test_slow_retrieval_attack.py renamed to tests/test_slow_retrieval_attack_old.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_slow_retrieval_attack.py
8+
test_slow_retrieval_attack_old.py
99
1010
<Author>
1111
Konstantin Andrianov.
@@ -152,7 +152,7 @@ def setUp(self):
152152
repository_basepath = self.repository_directory[len(os.getcwd()):]
153153

154154
self.server_process_handler = utils.TestServerProcess(log=logger,
155-
server='slow_retrieval_server.py')
155+
server='slow_retrieval_server_old.py')
156156

157157
logger.info('Slow Retrieval Server process started.')
158158

tests/test_tutorial.py renamed to tests/test_tutorial_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
"""
44
<Program Name>
5-
test_tutorial.py
5+
test_tutorial_old.py
66
77
<Copyright>
88
See LICENSE-MIT OR LICENSE for licensing information.

tests/test_unittest_toolbox.py renamed to tests/test_unittest_toolbox_old.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_unittest_toolbox.py
8+
test_unittest_toolbox_old.py
99
1010
<Author>
1111
Vladimir Diaz

tests/test_updater.py renamed to tests/test_updater_old.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_updater.py
8+
test_updater_old.py
99
1010
<Author>
1111
Konstantin Andrianov.
@@ -21,7 +21,7 @@
2121
See LICENSE-MIT OR LICENSE for licensing information.
2222
2323
<Purpose>
24-
'test_updater.py' provides a collection of methods that test the public /
24+
'test_updater.py_old' provides a collection of methods that test the public /
2525
non-public methods and functions of 'tuf.client.updater.py'.
2626
2727
The 'unittest_toolbox.py' module was created to provide additional testing
@@ -89,7 +89,7 @@ def setUpClass(cls):
8989
# Launch a SimpleHTTPServer (serves files in the current directory).
9090
# Test cases will request metadata and target files that have been
9191
# pre-generated in 'tuf/tests/repository_data', which will be served
92-
# by the SimpleHTTPServer launched here. The test cases of 'test_updater.py'
92+
# by the SimpleHTTPServer launched here. The test cases of 'test_updater_old.py'
9393
# assume the pre-generated metadata files have a specific structure, such
9494
# as a delegated role 'targets/role1', three target files, five key files,
9595
# etc.

tests/test_updater_root_rotation_integration.py renamed to tests/test_updater_root_rotation_integration_old.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""
77
<Program Name>
8-
test_updater_root_rotation_integration.py
8+
test_updater_root_rotation_integration_old.py
99
1010
<Author>
1111
Evan Cordell.
@@ -71,8 +71,9 @@ def setUpClass(cls):
7171
# Launch a SimpleHTTPServer (serves files in the current directory). Test
7272
# cases will request metadata and target files that have been pre-generated
7373
# in 'tuf/tests/repository_data', which will be served by the
74-
# SimpleHTTPServer launched here. The test cases of 'test_updater.py'
75-
# assume the pre-generated metadata files have a specific structure, such
74+
# SimpleHTTPServer launched here. The test cases of
75+
# 'test_updater_root_rotation_integration_old.py' assume the
76+
# pre-generated metadata files have a specific structure, such
7677
# as a delegated role 'targets/role1', three target files, five key files,
7778
# etc.
7879
cls.server_process_handler = utils.TestServerProcess(log=logger)

0 commit comments

Comments
 (0)