func isCommandAvailable(name string) bool {
cmd := exec.Command("command", "-v", name)
if err := cmd.Run(); err != nil {
func TestIsCommandAvailable(t *testing.T) {
if isCommandAvailable("ls") == false {
t.Error("ls command does not exist!")
if isCommandAvailable("ls111") == true {
t.Error("ls111 command should not exist!")