Skip to content

Commit 7c54859

Browse files
authored
Merge branch 'main' into test-debug-improvements
2 parents 9e6593d + a0f1c6f commit 7c54859

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

tests/host_tools/network.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ def mac_from_ip(ip_address):
149149
"""Create a MAC address based on the provided IP.
150150
151151
Algorithm:
152-
- the first 2 bytes are fixed to 06:00
152+
- the first 2 bytes are fixed to 06:00, which is in an LAA range
153+
- https://en.wikipedia.org/wiki/MAC_address#Ranges_of_group_and_locally_administered_addresses
153154
- the next 4 bytes are the IP address
154155
155156
Example of function call:

tests/integration_tests/functional/test_binary.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,22 @@ def test_release_debuginfo(microvm_factory):
4646
}
4747
missing_sections = needed_sections - matches
4848
assert missing_sections == set()
49+
50+
51+
def test_release_no_gdb(microvm_factory):
52+
"""Ensure the gdb feature is not enabled in releases"""
53+
fc_binary = microvm_factory.fc_binary_path
54+
# We use C++ demangle since there's no Rust support, but it's good enough
55+
# for our purposes.
56+
stdout = subprocess.check_output(
57+
["readelf", "-W", "--demangle", "-s", str(fc_binary)],
58+
encoding="ascii",
59+
)
60+
gdb_symbols = []
61+
for line in stdout.splitlines():
62+
parts = line.split(maxsplit=7)
63+
if len(parts) == 8:
64+
symbol_name = parts[-1]
65+
if "gdb" in symbol_name:
66+
gdb_symbols.append(symbol_name)
67+
assert not gdb_symbols

0 commit comments

Comments
 (0)