mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-10 20:05:55 +02:00
hubtests: correct basename check in parser tests (#3557)
This commit is contained in:
parent
78a6179566
commit
6c507604b1
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/expr-lang/expr"
|
||||
|
@ -270,7 +271,7 @@ func (p *ParserAssert) AutoGenParserAssert() string {
|
|||
}
|
||||
|
||||
if mkey == "datasource_path" {
|
||||
ret += fmt.Sprintf(`basename(results["%s"]["%s"][%d].Evt.Meta["%s"]) == "%s"`+"\n", stage, parser, pidx, mkey, Escape(mval))
|
||||
ret += fmt.Sprintf(`basename(results["%s"]["%s"][%d].Evt.Meta["%s"]) == "%s"`+"\n", stage, parser, pidx, mkey, Escape(filepath.Base(mval)))
|
||||
} else {
|
||||
ret += fmt.Sprintf(`results["%s"]["%s"][%d].Evt.Meta["%s"] == "%s"`+"\n", stage, parser, pidx, mkey, Escape(mval))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue