Skip to content

Commit b900317

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 33c1446 commit b900317

32 files changed

+14
-15
lines changed
File renamed without changes.

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

+1-1
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.

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

+1-1
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.
File renamed without changes.

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -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)
File renamed without changes.
File renamed without changes.

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

-1
Original file line numberDiff line numberDiff line change
@@ -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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -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

File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/test_utils.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_simple_https_server_startup(self) -> None:
6363
good_cert_path = os.path.join("ssl_certs", "ssl_cert.crt")
6464
server_process_handler = utils.TestServerProcess(
6565
log=logger,
66-
server="simple_https_server.py",
66+
server="simple_https_server_old.py",
6767
extra_cmd_args=[good_cert_path],
6868
)
6969

@@ -73,7 +73,7 @@ def test_simple_https_server_startup(self) -> None:
7373

7474
# Test when no cert file is provided
7575
server_process_handler = utils.TestServerProcess(
76-
log=logger, server="simple_https_server.py"
76+
log=logger, server="simple_https_server_old.py"
7777
)
7878

7979
# Make sure we can connect to the server
@@ -84,7 +84,7 @@ def test_simple_https_server_startup(self) -> None:
8484
non_existing_cert_path = os.path.join("ssl_certs", "non_existing.crt")
8585
server_process_handler = utils.TestServerProcess(
8686
log=logger,
87-
server="simple_https_server.py",
87+
server="simple_https_server_old.py",
8888
extra_cmd_args=[non_existing_cert_path],
8989
)
9090

@@ -95,7 +95,7 @@ def test_simple_https_server_startup(self) -> None:
9595
def test_slow_retrieval_server_startup(self) -> None:
9696
# Test normal case
9797
server_process_handler = utils.TestServerProcess(
98-
log=logger, server="slow_retrieval_server.py"
98+
log=logger, server="slow_retrieval_server_old.py"
9999
)
100100

101101
# Make sure we can connect to the server

tuf/ATTACKS.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,14 @@ exception or error when it detects that a malicious server is serving it data
289289
at a slow enough rate.
290290

291291
We first spawn the server that slowly streams data to the client. The
292-
'slow_retrieval_server.py' module (can be found in the tests/ directory of the
292+
'slow_retrieval_server_old.py' module (can be found in the tests/ directory of the
293293
source code) should be copied over to the server's 'repository/' directory from
294294
which to launch it.
295295
296296
```Bash
297-
# Before launching the slow retrieval server, copy 'slow_retrieval_server.py'
297+
# Before launching the slow retrieval server, copy 'slow_retrieval_server_old.py'
298298
# to the 'repository/' directory and run it from that directory as follows:
299-
$ python3 slow_retrieval_server.py 8002 mode_2
299+
$ python3 slow_retrieval_server_old.py 8002 mode_2
300300
```
301301
302302
The client may now make a request to the slow retrieval server on port 8002.

0 commit comments

Comments
 (0)