mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-25 01:07:52 +00:00
fix: integration tests result
Execute command doesn't fail, the result is passed in json content.
This commit is contained in:
parent
fcdc292647
commit
b511295349
@ -601,7 +601,7 @@ func (s *IntegrationCLITestSuite) TestNodeTagCommand() {
|
|||||||
assert.Equal(s.T(), []string{"tag:test"}, machine.ForcedTags)
|
assert.Equal(s.T(), []string{"tag:test"}, machine.ForcedTags)
|
||||||
|
|
||||||
// try to set a wrong tag and retrieve the error
|
// try to set a wrong tag and retrieve the error
|
||||||
_, err = ExecuteCommand(
|
wrongTagResult, err := ExecuteCommand(
|
||||||
&s.headscale,
|
&s.headscale,
|
||||||
[]string{
|
[]string{
|
||||||
"headscale",
|
"headscale",
|
||||||
@ -613,7 +613,14 @@ func (s *IntegrationCLITestSuite) TestNodeTagCommand() {
|
|||||||
},
|
},
|
||||||
[]string{},
|
[]string{},
|
||||||
)
|
)
|
||||||
assert.ErrorContains(s.T(), err, "Invalid tag detected")
|
assert.Nil(s.T(), err)
|
||||||
|
type errOutput struct {
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
var errorOutput errOutput
|
||||||
|
err = json.Unmarshal([]byte(wrongTagResult), &errorOutput)
|
||||||
|
assert.Nil(s.T(), err)
|
||||||
|
assert.Contains(s.T(), errorOutput.Error, "Invalid tag detected")
|
||||||
|
|
||||||
// Test list all nodes after added seconds
|
// Test list all nodes after added seconds
|
||||||
listAllResult, err := ExecuteCommand(
|
listAllResult, err := ExecuteCommand(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user