Adding Tests run and improving reply

This commit is contained in:
2018-10-15 16:42:35 +02:00
committed by William Petit
parent e0a32a2ecb
commit 68e9ba80b3
2 changed files with 27 additions and 22 deletions

View File

@ -50,7 +50,6 @@ func (wi *UCIWirelessInterface) GetSysDevName(sysDir string) string {
patt := fmt.Sprintf("%s/%s/.*/address", wi.DevicePath, "net")
r, err := regexp.MatchString(patt, path)
if err == nil && r {
fmt.Println(path)
res := strings.Split(path, "/")
idx := len(res) - 2
found = res[idx]
@ -60,7 +59,6 @@ func (wi *UCIWirelessInterface) GetSysDevName(sysDir string) string {
if err != nil {
return err.Error()
}
fmt.Println(found)
wi.SysDevName = found
return found
}
@ -72,7 +70,6 @@ func (wi *UCIWirelessInterface) Create(uci *UCI) *Action {
if addRes.ReturnCode != 0 {
return addRes
}
fmt.Println(wi.Index)
if wi.Index <= 0 {
confPrefix = fmt.Sprintf("wireless.@wifi-iface[%d]", len(uci.Wireless.Interfaces))
} else {
@ -183,8 +180,6 @@ func (wi *UCIWirelessInterface) Delete(uci *UCI) *Action {
// Update add a new entry for wifi interface in UCI Configuration
func (wi *UCIWirelessInterface) Update(uci *UCI) *Action {
wi.Delete(uci)
fmt.Println("IN UPDATE !")
fmt.Println(wi)
create := wi.Create(uci)
if create.ReturnCode != 0 {
return create
@ -207,7 +202,6 @@ func (wi *UCIWirelessInterface) Connect(uci *UCI, cell *WifiCell, secret string)
wi.Encryption = cell.Encryption
wi.Mode = "sta"
wi.Key = secret
fmt.Println(wi)
res := wi.Update(uci)
if res.ReturnCode != 0 {
return res