Skip to content

httpStaticNetTest hardcodes unikernel IP offset and contains unresolved dead code #66

@mdryaan

Description

@mdryaan

Description

httpStaticNetTest in tests/e2e/test_functions.go (line 406–407) derives the unikernel's IP address by splitting the tap device's IPv4 address and hardcoding .2 as the last octet:

parts := strings.Split(ipAddr, ".")
newIP := fmt.Sprintf("%s.%s.%s.2", parts[0], parts[1], parts[2])

The value 172.16.1.2 is already defined as constants.StaticNetworkUnikernelIP in internal/constants/network_constants.go. The function recomputes it from the tap address instead of using the constant, so any change to the static network IP assignment would silently break this test with no clear indication of why.

Additionally, lines 420–434 contain a commented-out net/http block with a FIXME note that the GET request fails while curl succeeds. This has never been resolved and is dead code.

Current Behavior

The unikernel IP is computed as <tap-subnet>.2 by splitting the tap device IP. The commented-out net/http block is present but unreachable and unresolved.

Expected Behavior

httpStaticNetTest should use constants.StaticNetworkUnikernelIP directly instead of recomputing an equivalent value. The commented-out block should be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions