2022-01-30 19:48:32 +00:00
|
|
|
package mobile
|
|
|
|
|
2023-09-03 13:30:46 +01:00
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/gologme/log"
|
|
|
|
)
|
2022-01-30 19:48:32 +00:00
|
|
|
|
|
|
|
func TestStartYggdrasil(t *testing.T) {
|
2023-09-03 13:30:46 +01:00
|
|
|
logger := log.New(os.Stdout, "", 0)
|
|
|
|
logger.EnableLevel("error")
|
|
|
|
logger.EnableLevel("warn")
|
|
|
|
logger.EnableLevel("info")
|
|
|
|
|
|
|
|
ygg := &Yggdrasil{
|
|
|
|
logger: logger,
|
|
|
|
}
|
2022-01-30 19:48:32 +00:00
|
|
|
if err := ygg.StartAutoconfigure(); err != nil {
|
|
|
|
t.Fatalf("Failed to start Yggdrasil: %s", err)
|
|
|
|
}
|
|
|
|
t.Log("Address:", ygg.GetAddressString())
|
|
|
|
t.Log("Subnet:", ygg.GetSubnetString())
|
2023-05-14 10:16:33 +01:00
|
|
|
t.Log("Routing entries:", ygg.GetRoutingEntries())
|
2022-01-30 19:48:32 +00:00
|
|
|
if err := ygg.Stop(); err != nil {
|
|
|
|
t.Fatalf("Failed to stop Yggdrasil: %s", err)
|
|
|
|
}
|
|
|
|
}
|