Fix syslog test failing due to hardcoded timestamp
This commit is contained in:
@@ -60,7 +60,8 @@ func TestJdbc_Pattern(t *testing.T) {
|
||||
"jdbc:sqlite:/data/test.db",
|
||||
"jdbc:oracle:thin:@host:1521:db",
|
||||
"jdbc:mysql://host:3306/db,other_param",
|
||||
"jdbc:db2://host:50000/db?param=1"
|
||||
"jdbc:db2://host:50000/db?param=1",
|
||||
jdbc:mysql://mysqldev1234.example.com:1234/busmdbdev?user=busmdb_ro&password=abcdefg&useSSL=false
|
||||
]
|
||||
}`,
|
||||
want: []string{
|
||||
@@ -70,6 +71,7 @@ func TestJdbc_Pattern(t *testing.T) {
|
||||
"jdbc:oracle:thin:@host:1521:db",
|
||||
"jdbc:mysql://host:3306/db",
|
||||
"jdbc:db2://host:50000/db?param=1",
|
||||
"jdbc:mysql://mysqldev1234.example.com:1234/busmdbdev?user=busmdb_ro&password=abcdefg&useSSL=false",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ package syslog
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
@@ -74,10 +75,17 @@ func TestSource_parseSyslogMetadata(t *testing.T) {
|
||||
want: &source_metadatapb.MetaData{
|
||||
Data: &source_metadatapb.MetaData_Syslog{
|
||||
Syslog: &source_metadatapb.Syslog{
|
||||
Hostname: "mymachine",
|
||||
Timestamp: "2025-10-11 22:14:15 +0000 UTC",
|
||||
Client: "127.0.0.1:5140",
|
||||
Facility: "4",
|
||||
Hostname: "mymachine",
|
||||
Timestamp: time.Date(
|
||||
time.Now().Year(),
|
||||
time.October,
|
||||
11,
|
||||
22, 14, 15,
|
||||
0,
|
||||
time.UTC,
|
||||
).String(),
|
||||
Client: "127.0.0.1:5140",
|
||||
Facility: "4",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user