Skip to content

pkg/network/commands_tests broken for non-default dev machines #2108

@jandubois

Description

@jandubois

In #1220 the default config has become dependent on the local machine configuration, but the tests still use hardcoded default values for expected paths etc, e.g.

cmd := config.StartCmd("shared", SocketVMNet)
assert.Equal(t, cmd, "/opt/socket_vmnet/bin/socket_vmnet --pidfile="+filepath.Join(varRunDir, "shared_socket_vmnet.pid")+" --socket-group=everyone --vmnet-mode=shared "+
"--vmnet-gateway=192.168.105.1 --vmnet-dhcp-end=192.168.105.254 --vmnet-mask=255.255.255.0 "+filepath.Join(varRunDir, "socket_vmnet.shared"))

This fails unless the local machine matches the hard-coded config, e.g.

--- FAIL: TestStartCmd (0.00s)
    --- FAIL: TestStartCmd/socket_vmnet (0.00s)
        commands_test.go:107: assertion failed: /usr/local/Cellar/socket_vmnet/1.1.3/bin/socket_vmnet --pidfile=/private/var/run/lima/shared_socket_vmnet.pid --socket-group=everyone --vmnet-mode=shared --vmnet-gateway=192.168.105.1 --vmnet-dhcp-end=192.168.105.254 --vmnet-mask=255.255.255.0 /private/var/run/lima/socket_vmnet.shared (cmd string) != /opt/socket_vmnet/bin/socket_vmnet --pidfile=/private/var/run/lima/shared_socket_vmnet.pid --socket-group=everyone --vmnet-mode=shared --vmnet-gateway=192.168.105.1 --vmnet-dhcp-end=192.168.105.254 --vmnet-mask=255.255.255.0 /private/var/run/lima/socket_vmnet.shared ("/opt/socket_vmnet/bin/socket_vmnet --pidfile=" + filepath.Join(varRunDir, "shared_socket_vmnet.pid") + " --socket-group=everyone --vmnet-mode=shared " + "--vmnet-gateway=192.168.105.1 --vmnet-dhcp-end=192.168.105.254 --vmnet-mask=255.255.255.0 " + filepath.Join(varRunDir, "socket_vmnet.shared") string)

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