Adding upstream version 1.34.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e393c3af3f
commit
4978089aab
4963 changed files with 677545 additions and 0 deletions
43
plugins/processors/filepath/filepath_windows_test.go
Normal file
43
plugins/processors/filepath/filepath_windows_test.go
Normal file
|
@ -0,0 +1,43 @@
|
|||
package filepath
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/testutil"
|
||||
)
|
||||
|
||||
var samplePath = "c:\\my\\test\\\\c\\..\\path\\file.log"
|
||||
|
||||
func TestOptions_Apply(t *testing.T) {
|
||||
tests := []testCase{
|
||||
{
|
||||
name: "Smoke Test",
|
||||
o: newOptions("c:\\my\\test\\"),
|
||||
inputMetrics: getSmokeTestInputMetrics(samplePath),
|
||||
expectedMetrics: []telegraf.Metric{
|
||||
testutil.MustMetric(
|
||||
smokeMetricName,
|
||||
map[string]string{
|
||||
"baseTag": "file.log",
|
||||
"dirTag": "c:\\my\\test\\path",
|
||||
"stemTag": "file",
|
||||
"cleanTag": "c:\\my\\test\\path\\file.log",
|
||||
"relTag": "path\\file.log",
|
||||
"slashTag": "c:/my/test//c/../path/file.log",
|
||||
},
|
||||
map[string]interface{}{
|
||||
"baseField": "file.log",
|
||||
"dirField": "c:\\my\\test\\path",
|
||||
"stemField": "file",
|
||||
"cleanField": "c:\\my\\test\\path\\file.log",
|
||||
"relField": "path\\file.log",
|
||||
"slashField": "c:/my/test//c/../path/file.log",
|
||||
},
|
||||
time.Now()),
|
||||
},
|
||||
},
|
||||
}
|
||||
runTestOptionsApply(t, tests)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue