organizing and refactoring
This commit is contained in:
parent
13b5474cd8
commit
6f159d4728
20 changed files with 832 additions and 488 deletions
43
agent/tactical/tactical_linux_test.go
Normal file
43
agent/tactical/tactical_linux_test.go
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package tactical
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewAgentConfig(t *testing.T) {
|
||||
config := NewAgentConfig()
|
||||
if config.BaseURL == "" {
|
||||
t.Fatal("Could not get config")
|
||||
}
|
||||
|
||||
t.Logf("Config BaseURL: %s", config.BaseURL)
|
||||
}
|
||||
|
||||
func TestAgentUpdate(t *testing.T) {
|
||||
url := "https://github.com/redanthrax/rmmagent/releases/download/v2.0.4/linuxagent"
|
||||
result := AgentUpdate(url, "", "v2.0.4")
|
||||
if(!result) {
|
||||
t.Fatal("Agent update resulted in false")
|
||||
}
|
||||
|
||||
t.Log("Agent update resulted in true")
|
||||
}
|
||||
|
||||
func TestAgentUninstall(t *testing.T) {
|
||||
result := AgentUninstall("foo")
|
||||
if !result {
|
||||
t.Fatal("Agent uninstall resulted in error")
|
||||
}
|
||||
|
||||
t.Log("Agent uninstall was true")
|
||||
}
|
||||
|
||||
func TestNixMeshNodeID(t *testing.T) {
|
||||
nodeid := NixMeshNodeID()
|
||||
if nodeid == "" {
|
||||
t.Fatal("Unable to get mesh node id")
|
||||
}
|
||||
|
||||
t.Logf("MeshNodeID: %s", nodeid)
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue