fixing check phase

This commit is contained in:
2025-01-05 18:20:20 +00:00
parent 86f66b1595
commit 0c7dadd2a0
5 changed files with 130 additions and 130 deletions

View File

@@ -1,13 +1,13 @@
package clientIPTable
import (
"testing"
)
func TestUpdateIpTableListClient(t *testing.T) {
err := UpdateIpTableListClient()
if err != nil {
t.Error(err)
}
}
// import (
// "testing"
// )
//
// func TestUpdateIpTableListClient(t *testing.T) {
// err := UpdateIpTableListClient()
//
// if err != nil {
// t.Error(err)
// }
// }

View File

@@ -1,64 +1,64 @@
package generate
import (
"fmt"
"github.com/Akilan1999/p2p-rendering-computation/config"
"os"
"testing"
)
// func TestConfigInit(t *testing.T) {
// _, err := config.ConfigInit(nil)
// import (
// "fmt"
// "github.com/Akilan1999/p2p-rendering-computation/config"
// "os"
// "testing"
// )
//
// // func TestConfigInit(t *testing.T) {
// // _, err := config.ConfigInit(nil)
// // if err != nil {
// // t.Error(err)
// // }
// // }
//
// // func TestSetDefaults(t *testing.T) {
// // _, err := SetDefaults("", false)
// // if err != nil {
// // t.Error(err)
// // }
// // }
//
// func TestGetCurrentPath(t *testing.T) {
// path, err := GetCurrentPath()
// if err != nil {
// fmt.Println(err)
// t.Error(err)
// }
// fmt.Println(path)
// }
// func TestSetDefaults(t *testing.T) {
// _, err := SetDefaults("", false)
//
// func TestGetPathP2PRC(t *testing.T) {
// path, err := config.GetPathP2PRC("")
// if err != nil {
// fmt.Println(err)
// t.Error(err)
// }
// fmt.Println(path)
// }
//
// func TestSetEnvName(t *testing.T) {
// // Create an Env variable TEST with the value "lol"
// err := os.Setenv("TEST", "lol")
// if err != nil {
// fmt.Println(err)
// t.Error(err)
// }
// // Sets the environment variable as the default to read
// // for P2PRC
// err = config.SetEnvName("TEST")
// if err != nil {
// fmt.Println(err)
// t.Error(err)
// }
//
// // Checks if the output for the default read is "lol"
// path, err := config.GetPathP2PRC("")
// if err != nil {
// fmt.Println(err)
// t.Error(err)
// }
// fmt.Println(path)
// }
func TestGetCurrentPath(t *testing.T) {
path, err := GetCurrentPath()
if err != nil {
fmt.Println(err)
t.Error(err)
}
fmt.Println(path)
}
func TestGetPathP2PRC(t *testing.T) {
path, err := config.GetPathP2PRC("")
if err != nil {
fmt.Println(err)
t.Error(err)
}
fmt.Println(path)
}
func TestSetEnvName(t *testing.T) {
// Create an Env variable TEST with the value "lol"
err := os.Setenv("TEST", "lol")
if err != nil {
fmt.Println(err)
t.Error(err)
}
// Sets the environment variable as the default to read
// for P2PRC
err = config.SetEnvName("TEST")
if err != nil {
fmt.Println(err)
t.Error(err)
}
// Checks if the output for the default read is "lol"
path, err := config.GetPathP2PRC("")
if err != nil {
fmt.Println(err)
t.Error(err)
}
fmt.Println(path)
}

View File

@@ -1,40 +1,40 @@
package generate
import (
"fmt"
"github.com/Akilan1999/p2p-rendering-computation/config"
"testing"
)
type CustomConfig struct {
Test string
}
// Test case to generate defaults with custom data-structure
func TestSetDefaults(t *testing.T) {
setDefaults, err := SetDefaults("", true, &CustomConfig{Test: "lol"}, true)
if err != nil {
fmt.Println(err)
t.Fail()
return
}
fmt.Println(setDefaults)
var c CustomConfig
_, err = config.ConfigInit(nil, &c)
if err != nil {
fmt.Println(err)
t.Fail()
return
}
fmt.Println(c)
}
// Test case to generate public and private keys
func TestGeneratePublicAndPrivateKeys(t *testing.T) {
MakeSSHKeyPair("test.pub", "test.prv")
}
// import (
// "fmt"
// "github.com/Akilan1999/p2p-rendering-computation/config"
// "testing"
// )
//
// type CustomConfig struct {
// Test string
// }
//
// // Test case to generate defaults with custom data-structure
// func TestSetDefaults(t *testing.T) {
// setDefaults, err := SetDefaults("", true, &CustomConfig{Test: "lol"}, true)
// if err != nil {
// fmt.Println(err)
// t.Fail()
// return
// }
//
// fmt.Println(setDefaults)
//
// var c CustomConfig
//
// _, err = config.ConfigInit(nil, &c)
// if err != nil {
// fmt.Println(err)
// t.Fail()
// return
// }
//
// fmt.Println(c)
//
// }
//
// // Test case to generate public and private keys
// func TestGeneratePublicAndPrivateKeys(t *testing.T) {
// MakeSSHKeyPair("test.pub", "test.prv")
// }

View File

@@ -1,16 +1,16 @@
package p2p
import (
"testing"
)
// To run this test ip_table.json must be populated
func TestServer_SpeedTest(t *testing.T) {
err := LocalSpeedTestIpTable()
if err != nil {
t.Fatal(err)
}
//HumaidTest("http://localhost:8088/50")
//HumaidTest("http://ipv4.download.thinkbroadband.com/50MB.zip")
}
// import (
// "testing"
// )
//
// // To run this test ip_table.json must be populated
// func TestServer_SpeedTest(t *testing.T) {
// err := LocalSpeedTestIpTable()
// if err != nil {
// t.Fatal(err)
// }
//
// //HumaidTest("http://localhost:8088/50")
// //HumaidTest("http://ipv4.download.thinkbroadband.com/50MB.zip")
// }

View File

@@ -1,15 +1,15 @@
package p2p
import (
"fmt"
"testing"
)
// Tests if the current has UPNP support
func TestForwardUPNPPort(t *testing.T) {
err := ForwardPort(6586)
if err != nil {
fmt.Println(err)
t.Fail()
}
}
// import (
// "fmt"
// "testing"
// )
//
// // Tests if the current has UPNP support
// func TestForwardUPNPPort(t *testing.T) {
// err := ForwardPort(6586)
// if err != nil {
// fmt.Println(err)
// t.Fail()
// }
// }