mirror of
https://github.com/singchia/frontier.git
synced 2025-10-25 00:50:25 +08:00
add edge config and template
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
func TestParseFlags(t *testing.T) {
|
||||
@@ -36,3 +39,36 @@ func TestParseFlags(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseFile(t *testing.T) {
|
||||
conf := &Configuration{
|
||||
Daemon: Daemon{
|
||||
RLimit: RLimit{
|
||||
NumFile: 1024,
|
||||
},
|
||||
PProf: PProf{
|
||||
Addr: "0.0.0.0:6060",
|
||||
},
|
||||
},
|
||||
Edgebound: Edgebound{},
|
||||
Servicebound: Servicebound{},
|
||||
Log: Log{},
|
||||
}
|
||||
_, err := yaml.Marshal(conf)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func TestGenDefaultConfig(t *testing.T) {
|
||||
file, err := os.OpenFile("./config.yaml", os.O_CREATE|os.O_RDWR, 0666)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
defer file.Close()
|
||||
err = genDefaultConfig(file)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user