mirror of
https://github.com/go-i2p/checki2cp.git
synced 2025-06-07 17:05:00 -04:00
64 lines
1.2 KiB
Go
64 lines
1.2 KiB
Go
package checki2p
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/go-i2p/checki2cp/util"
|
|
)
|
|
|
|
func TestRouterLaunch(t *testing.T) {
|
|
ok, err := ConditionallyLaunchI2P()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if ok {
|
|
t.Log("I2P is installed, successfully confirmed", ok)
|
|
} else {
|
|
t.Log("I2P is in a default location, user feedback is needed")
|
|
}
|
|
}
|
|
|
|
func TestClient(t *testing.T) {
|
|
ok, err := CheckI2PIsRunning()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if ok {
|
|
t.Log("I2P is running, successfully confirmed I2CP")
|
|
} else {
|
|
t.Log("I2P is not running, further testing is needed")
|
|
}
|
|
}
|
|
|
|
func TestRouter(t *testing.T) {
|
|
ok, err := util.CheckI2PIsInstalledDefaultLocation()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if ok {
|
|
t.Log("I2P is installed, successfully confirmed", ok)
|
|
} else {
|
|
t.Log("I2P is in a default location, user feedback is needed")
|
|
}
|
|
}
|
|
|
|
func TestRouterPath(t *testing.T) {
|
|
ok, err := util.FindI2PIsInstalledDefaultLocation()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if ok != "" {
|
|
t.Log("I2P is installed, successfully confirmed", ok)
|
|
} else {
|
|
t.Log("I2P is in a default location, user feedback is needed")
|
|
}
|
|
}
|
|
|
|
func TestFirewallPort(t *testing.T) {
|
|
port, err := util.GetFirewallPort()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log("Port was", port)
|
|
}
|