Moving to go mod and improving the build
Change-Id: I9089656aae6313b0d5576fdb6de411d8301114d8
diff --git a/core/tester.go b/core/tester.go
index fe2aa39..d35a55b 100644
--- a/core/tester.go
+++ b/core/tester.go
@@ -17,6 +17,7 @@
package core
import (
+ "bytes"
"context"
"fmt"
"os/exec"
@@ -190,12 +191,15 @@
logger.Error("Fail to set %s up: %s", veth, err)
return err
}
- cmd := "/usr/local/bin/dhcpd"
+ dhcp := "/usr/local/bin/dhcpd"
conf := "/etc/dhcp/dhcpd.conf"
logfile := "/tmp/dhcplog"
- err = exec.Command(cmd, "-cf", conf, veth, "-tf", logfile).Run()
+ var stderr bytes.Buffer
+ cmd := exec.Command(dhcp, "-cf", conf, veth, "-tf", logfile)
+ cmd.Stderr = &stderr
+ err = cmd.Run()
if err != nil {
- logger.Error("Fail to activateDHCP Server (): %s", err)
+ logger.Error("Fail to activateDHCP Server (): %s, %s", err, stderr.String())
return err
}
logger.Info("DHCP Server is successfully activated !")