mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-23 08:36:41 +00:00
fix(config): add metrics socket mode
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
@@ -18,6 +18,28 @@ func TestMetricsValid(t *testing.T) {
|
||||
Network: "tcp",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "basic TCP4",
|
||||
input: &Metrics{
|
||||
Bind: ":9090",
|
||||
Network: "tcp4",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "basic TCP6",
|
||||
input: &Metrics{
|
||||
Bind: ":9090",
|
||||
Network: "tcp6",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "basic unix",
|
||||
input: &Metrics{
|
||||
Bind: "/tmp/anubis-metrics.sock",
|
||||
Network: "unix",
|
||||
SocketMode: "0770",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "no bind",
|
||||
input: &Metrics{},
|
||||
@@ -28,6 +50,23 @@ func TestMetricsValid(t *testing.T) {
|
||||
input: &Metrics{},
|
||||
err: ErrNoMetricsNetwork,
|
||||
},
|
||||
{
|
||||
name: "no unix socket mode",
|
||||
input: &Metrics{
|
||||
Bind: "/tmp/anubis-metrics.sock",
|
||||
Network: "unix",
|
||||
},
|
||||
err: ErrNoMetricsSocketMode,
|
||||
},
|
||||
{
|
||||
name: "invalid unix socket mode",
|
||||
input: &Metrics{
|
||||
Bind: "/tmp/anubis-metrics.sock",
|
||||
Network: "unix",
|
||||
SocketMode: "taco bell",
|
||||
},
|
||||
err: ErrInvalidMetricsSocketMode,
|
||||
},
|
||||
{
|
||||
name: "invalid network",
|
||||
input: &Metrics{
|
||||
|
||||
Reference in New Issue
Block a user