Skip to content

Commit a23eb49

Browse files
authored
test(integv2): remove dynamic record sizing test and related cleanup (#5644)
1 parent 67dc64e commit a23eb49

File tree

8 files changed

+2
-204
lines changed

8 files changed

+2
-204
lines changed

codebuild/spec/buildspec_integv2_nix.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ phases:
131131
nix develop $NIXDEV_ARGS $NIXDEV_LIBCRYPTO --command bash -c "source ./nix/shell.sh; build"
132132
fi
133133
post_build:
134-
# Dynamic_record_sizes is being excluded in nix/shell.sh and needs a rewrite.
135134
commands:
136135
- |
137136
set -e

codebuild/spec/buildspec_ubuntu_integrationv2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ batch:
4141
- "test_version_negotiation test_ocsp test_renegotiate test_serialization test_record_padding
4242
test_npn test_cross_compatibility test_renegotiate_apache test_hello_retry_requests
4343
test_sni_match test_pq_handshake test_fragmentation test_key_update
44-
test_client_authentication test_dynamic_record_sizes test_sslyze test_sslv2_client_hello"
44+
test_client_authentication test_sslyze test_sslv2_client_hello"
4545

4646
env:
4747
variables:

flake.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
# We're not including openssl1.1.1 in our package list to avoid confusing cmake.
3131
# It will be in the PATH of our devShell for use in tests.
3232
pkgs.corretto21
33-
pkgs.iproute2
3433
pkgs.apacheHttpd
3534
pkgs.procps
3635
# stress testing tool for linux

nix/shell.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ function uvinteg {(
8686
set -eu
8787
TESTS="${1:-all}"
8888
apache2_start
89-
# TODO: Dynamic Record Sizes needs a rewrite; skip for now.
90-
PYTEST_ARGS="--provider-version $S2N_LIBCRYPTO -x -n auto --durations=10 -rpfs --ignore-glob=*test_dynamic_record_sizes*"
89+
PYTEST_ARGS="--provider-version $S2N_LIBCRYPTO -x -n auto --durations=10 -rpfs"
9190
cd ./tests/integrationv2
9291
echo -n "Comparing the current list of integ tests against what is checked-in..."
9392
PYTHONPATH="" uv run pytest --collect-only $PYTEST_ARGS | grep Module > /tmp/uvinteg_tests.txt

tests/integrationv2/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ ubuntu@host:s2n_root/ $ make -C tests/integrationv2 all
5959
The Makefile automatically sets your PATH and LD_LIBRARY_PATH environment. It will execute `tox` to setup your
6060
Python environment. Then all the integration tests will be collected and executed.
6161

62-
**Note** If you are running the dynamic record size test you will need to use `sudo`.
63-
6462
## Run one test
6563

6664
If you only want to run a single test, you can set the `TOX_TEST_NAME` environment variable:

tests/integrationv2/fixtures.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
3-
import os
43
import pytest
5-
import subprocess
64

75
from processes import ManagedProcess
86
from providers import Provider, S2N
@@ -122,45 +120,3 @@ def _fn(
122120
p.kill()
123121
else:
124122
p.join()
125-
126-
127-
def _swap_mtu(device, new_mtu):
128-
"""
129-
Swap the device's current MTU for the requested MTU.
130-
Return the original MTU so it can be reset later.
131-
"""
132-
cmd = ["ip", "link", "show", device]
133-
p = subprocess.Popen(
134-
cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE
135-
)
136-
mtu = 65536
137-
for line in p.stdout.readlines():
138-
s = line.decode("utf-8")
139-
pieces = s.split(" ")
140-
if len(pieces) >= 4 and pieces[3] == "mtu":
141-
mtu = int(pieces[4])
142-
143-
p.wait()
144-
145-
subprocess.call(["ip", "link", "set", device, "mtu", str(new_mtu)])
146-
147-
return int(mtu)
148-
149-
150-
@pytest.fixture(scope="module")
151-
def custom_mtu():
152-
"""
153-
This fixture will swap the loopback's MTU from the default
154-
to 1500, which is more reasonable for a network device.
155-
Using a fixture allows us to reset the MTU even if the test
156-
fails.
157-
158-
These values are all hardcoded because they are only used
159-
from a single test. This simplifies the use of the fixture.
160-
"""
161-
if os.geteuid() != 0:
162-
pytest.skip("Test needs root privileges to modify lo MTU")
163-
164-
original_mtu = _swap_mtu("lo", 1500)
165-
yield
166-
_swap_mtu("lo", original_mtu)

tests/integrationv2/providers.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -111,44 +111,6 @@ def get_name(cls, cmd_line):
111111
return cmd_line[0]
112112

113113

114-
class Tcpdump(Provider):
115-
"""
116-
TcpDump is used by the dynamic record test. It only needs to watch
117-
a handful of packets before it can exit.
118-
119-
This class still follows the provider setup, but all values are hardcoded
120-
because this isn't expected to be used outside of the dynamic record test.
121-
"""
122-
123-
def __init__(self, options: ProviderOptions):
124-
Provider.__init__(self, options)
125-
126-
def setup_client(self):
127-
self.ready_to_test_marker = "listening on lo"
128-
tcpdump_filter = "dst port {}".format(self.options.port)
129-
130-
cmd_line = [
131-
"tcpdump",
132-
# Line buffer the output
133-
"-l",
134-
# Only read 10 packets before exiting. This is enough to find a large
135-
# packet, and still exit before the timeout.
136-
"-c",
137-
"10",
138-
# Watch the loopback device
139-
"-i",
140-
"lo",
141-
# Don't resolve IP addresses
142-
"-nn",
143-
# Set the buffer size to 1k
144-
"-B",
145-
"1024",
146-
tcpdump_filter,
147-
]
148-
149-
return cmd_line
150-
151-
152114
class S2N(Provider):
153115
"""
154116
The S2N provider translates flags into s2nc/s2nd command line arguments.

tests/integrationv2/test_dynamic_record_sizes.py

Lines changed: 0 additions & 115 deletions
This file was deleted.

0 commit comments

Comments
 (0)