mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-11-04 01:51:04 +01:00 
			
		
		
		
	check that new command does not break nodes list output
This commit is contained in:
		
							parent
							
								
									e279224484
								
							
						
					
					
						commit
						b9ea83fed8
					
				@ -1300,6 +1300,29 @@ func (s *IntegrationCLITestSuite) TestNodeMoveCommand() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	assert.Equal(s.T(), machine.Namespace, newNamespace)
 | 
						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(
 | 
						moveToNonExistingNSResult, err := ExecuteCommand(
 | 
				
			||||||
		&s.headscale,
 | 
							&s.headscale,
 | 
				
			||||||
		[]string{
 | 
							[]string{
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user