37 lines
811 B
Go
37 lines
811 B
Go
//go:build linux
|
|
// +build linux
|
|
|
|
package cli
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// TestExecute tests that the CLI can be initialized
|
|
func TestExecute(t *testing.T) {
|
|
// This is a simple compilation test to ensure the CLI package compiles
|
|
// We can't easily test the full Execute() function as it starts the UI
|
|
|
|
// Test that rootCmd is properly initialized
|
|
if rootCmd == nil {
|
|
t.Fatal("rootCmd is nil")
|
|
}
|
|
|
|
if rootCmd.Use != "rtnetmon" {
|
|
t.Errorf("Expected rootCmd.Use to be 'rtnetmon', got '%s'", rootCmd.Use)
|
|
}
|
|
|
|
// Test that default configuration is set
|
|
if len(defaultReachabilityHosts) == 0 {
|
|
t.Error("defaultReachabilityHosts is empty")
|
|
}
|
|
|
|
if len(defaultPacketLossHosts) == 0 {
|
|
t.Error("defaultPacketLossHosts is empty")
|
|
}
|
|
|
|
if len(defaultTCPHosts) == 0 {
|
|
t.Error("defaultTCPHosts is empty")
|
|
}
|
|
}
|