@@ -6,7 +6,9 @@ package config // import "go.opentelemetry.io/contrib/config"
6
6
import (
7
7
"context"
8
8
"errors"
9
+ "fmt"
9
10
"net/url"
11
+ "path/filepath"
10
12
"reflect"
11
13
"testing"
12
14
@@ -221,6 +223,40 @@ func TestLogProcessor(t *testing.T) {
221
223
},
222
224
wantProcessor : sdklog .NewBatchProcessor (otlpGRPCExporter ),
223
225
},
226
+ {
227
+ name : "batch/otlp-grpc-good-ca-certificate" ,
228
+ processor : LogRecordProcessor {
229
+ Batch : & BatchLogRecordProcessor {
230
+ Exporter : LogRecordExporter {
231
+ OTLP : & OTLP {
232
+ Protocol : ptr ("grpc" ),
233
+ Endpoint : ptr ("localhost:4317" ),
234
+ Compression : ptr ("gzip" ),
235
+ Timeout : ptr (1000 ),
236
+ Certificate : ptr (filepath .Join ("testdata" , "ca.crt" )),
237
+ },
238
+ },
239
+ },
240
+ },
241
+ wantProcessor : sdklog .NewBatchProcessor (otlpGRPCExporter ),
242
+ },
243
+ {
244
+ name : "batch/otlp-grpc-bad-ca-certificate" ,
245
+ processor : LogRecordProcessor {
246
+ Batch : & BatchLogRecordProcessor {
247
+ Exporter : LogRecordExporter {
248
+ OTLP : & OTLP {
249
+ Protocol : ptr ("grpc" ),
250
+ Endpoint : ptr ("localhost:4317" ),
251
+ Compression : ptr ("gzip" ),
252
+ Timeout : ptr (1000 ),
253
+ Certificate : ptr (filepath .Join ("testdata" , "bad_cert.crt" )),
254
+ },
255
+ },
256
+ },
257
+ },
258
+ wantErr : fmt .Errorf ("could not create client tls credentials: %w" , errors .New ("credentials: failed to append certificates" )),
259
+ },
224
260
{
225
261
name : "batch/otlp-grpc-exporter-no-scheme" ,
226
262
processor : LogRecordProcessor {
0 commit comments