Lookup echo command for unit tests
Some distributions do not ship echo via `/bin/echo`, which means we now
look it up before actually using it within the unit tests.
@@ -4,6 +4,7 @@ import (
"context"
"io/ioutil"
"os"
+ "os/exec"
"path"
"path/filepath"
"testing"
@@ -229,7 +230,9 @@ func createDummyState() {
}
func mockRuncInLibConfig() {
+ echo, err := exec.LookPath("echo")
+ Expect(err).To(BeNil())
serverConfig.Runtimes["runc"] = &config.RuntimeHandler{
- RuntimePath: "/bin/echo",
+ RuntimePath: echo,
}
}
