Refactored integration tests

This commit is contained in:
Juan Font
2023-05-01 14:52:48 +00:00
parent 83b4389090
commit 851da9d674
6 changed files with 151 additions and 151 deletions

View File

@@ -519,11 +519,11 @@ func (t *HeadscaleInContainer) CreateAuthKey(
return &preAuthKey, nil
}
// ListMachinesInUser list the TailscaleClients (Machine, Headscale internal representation)
// ListNodesInUser list the TailscaleClients (Machine, Headscale internal representation)
// associated with a user.
func (t *HeadscaleInContainer) ListMachinesInUser(
func (t *HeadscaleInContainer) ListNodesInUser(
user string,
) ([]*v1.Machine, error) {
) ([]*v1.Node, error) {
command := []string{"headscale", "--user", user, "nodes", "list", "--output", "json"}
result, _, err := dockertestutil.ExecuteCommand(
@@ -535,7 +535,7 @@ func (t *HeadscaleInContainer) ListMachinesInUser(
return nil, fmt.Errorf("failed to execute list node command: %w", err)
}
var nodes []*v1.Machine
var nodes []*v1.Node
err = json.Unmarshal([]byte(result), &nodes)
if err != nil {
return nil, fmt.Errorf("failed to unmarshal nodes: %w", err)