Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update micro-http for empty MMDS path handling #4468

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ and this project adheres to
mechanism to reliably fetch Firecracker PID. With this change, Firecracker
process's PID will always be available in the Jailer's root directory
regardless of whether new_pid_ns was set.
- [#4468](https://github.com/firecracker-microvm/firecracker/pull/4468): Fixed a
bug where a client would hang or timeout when querying for an MMDS path whose
content is empty, because the 'Content-Length' header field was missing in a
response.

## \[1.6.0\]

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tests/framework/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ def assert_seccomp_level(pid, seccomp_level):

def run_guest_cmd(ssh_connection, cmd, expected, use_json=False):
"""Runs a shell command at the remote accessible via SSH"""
_, stdout, stderr = ssh_connection.run(cmd)
rc, stdout, stderr = ssh_connection.run(cmd)
assert rc == 0
assert stderr == ""
stdout = stdout if not use_json else json.loads(stdout)
assert stdout == expected
Expand Down
6 changes: 5 additions & 1 deletion tests/integration_tests/functional/test_mmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def test_mmds_response(uvm_plain, version):
"res_key": "res_value",
},
"dummy_array": ["arr_val1", "arr_val2"],
"dummy_empty": "",
},
"Limits": {"CPU": 512, "Memory": 512},
"Usage": {"CPU": 12.12},
Expand Down Expand Up @@ -328,12 +329,12 @@ def test_mmds_response(uvm_plain, version):
expected = (
"ami-id\n"
"dummy_array\n"
"dummy_empty\n"
"dummy_obj/\n"
"local-hostname\n"
"public-hostname\n"
"reservation-id"
)

run_guest_cmd(ssh_connection, cmd, expected)

cmd = pre + "latest/meta-data/ami-id/"
Expand All @@ -342,6 +343,9 @@ def test_mmds_response(uvm_plain, version):
cmd = pre + "latest/meta-data/dummy_array/0"
run_guest_cmd(ssh_connection, cmd, "arr_val1")

cmd = pre + "latest/meta-data/dummy_empty"
run_guest_cmd(ssh_connection, cmd, "")

cmd = pre + "latest/Usage/CPU"
run_guest_cmd(
ssh_connection,
Expand Down
Loading