From b9ea83fed8861016bdedd52dffffc78c97d65104 Mon Sep 17 00:00:00 2001 From: Igor Perepilitsyn Date: Mon, 2 May 2022 15:04:24 +0400 Subject: [PATCH] check that new command does not break nodes list output --- integration_cli_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/integration_cli_test.go b/integration_cli_test.go index 1177eedc..29bca647 100644 --- a/integration_cli_test.go +++ b/integration_cli_test.go @@ -1300,6 +1300,29 @@ func (s *IntegrationCLITestSuite) TestNodeMoveCommand() { assert.Equal(s.T(), machine.Namespace, newNamespace) + listAllNodesResult, err := ExecuteCommand( + &s.headscale, + []string{ + "headscale", + "nodes", + "list", + "--output", + "json", + }, + []string{}, + ) + assert.Nil(s.T(), err) + + var allNodes []v1.Machine + err = json.Unmarshal([]byte(listAllNodesResult), &allNodes) + assert.Nil(s.T(), err) + + assert.Len(s.T(), allNodes, 1) + + assert.Equal(s.T(), allNodes[0].Id, machine.Id) + assert.Equal(s.T(), allNodes[0].Namespace, machine.Namespace) + assert.Equal(s.T(), allNodes[0].Namespace, newNamespace) + moveToNonExistingNSResult, err := ExecuteCommand( &s.headscale, []string{