test: Add edge case for normalizeNodeHost URL parse error

Control character (null byte) triggers url.Parse error, covering the
'invalid host format' error branch. Coverage: 96.3% to 100%.
This commit is contained in:
rcourtman 2025-12-01 23:28:32 +00:00
parent 08765c7b59
commit 0fa717a78a

View file

@ -385,6 +385,12 @@ func TestNormalizeNodeHost(t *testing.T) {
nodeType: "pve",
wantErr: true,
},
{
name: "control character in host returns error",
rawHost: "\x00invalid",
nodeType: "pve",
wantErr: true,
},
// Unknown node type (no default port added)
{
name: "unknown node type keeps host without port",