Skip to content

Commit

Permalink
noted faulty glob & shellvar parsing with driver(local)-command(custom)
Browse files Browse the repository at this point in the history
  • Loading branch information
deven96 committed Oct 27, 2021
1 parent fa22052 commit 962cfd7
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions integration/integration_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,31 @@ func TestProcessonLocal(t *testing.T) {
}
}

//FIXME: faulty shell globbing using custom commands
//func TestCustomonLocal(t *testing.T) {
// d := driver.Local{
// Vars: []string{"MONKEY=true"},
// }
// i := inspector.NewCustom(`echo $MONKEY`)
// output, err := d.RunCommand(i.String())
// if err != nil {
// t.Error(err)
// }
// i.Parse(output)
// if strings.TrimSpace(i.Values.Output) != "true" {
// t.Errorf("%s", i.Values.Output)
// }
//}

func TestCustomonLocal(t *testing.T) {
d := driver.Local{
Vars: []string{"MONKEY=true"},
}
i := inspector.NewCustom(`echo $MONKEY`)
d := driver.Local{}
i := inspector.NewCustom(`echo /test/test`)
output, err := d.RunCommand(i.String())
if err != nil {
t.Error(err)
}
i.Parse(output)
if strings.TrimSpace(i.Values.Output) != "$MONKEY" {
if strings.TrimSpace(i.Values.Output) != "/test/test" {
t.Errorf("%s", i.Values.Output)
}
}

0 comments on commit 962cfd7

Please sign in to comment.