• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openconfig / gribigo / 12636760738

06 Jan 2025 04:58PM UTC coverage: 54.252% (-19.5%) from 73.705%
12636760738

Pull #246

github

tengyiG
Update gribi version to v1.8.1 in go.mod
Pull Request #246: Ran aft/update.sh to keep oc.go updated.

60 of 544 new or added lines in 1 file covered. (11.03%)

20 existing lines in 4 files now uncovered.

2590 of 4774 relevant lines covered (54.25%)

0.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/testcommon/testcommon.go
1
// Copyright 2021 Google LLC
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//      http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15
// Package testcommon implements common helpers that can be used throughout
16
// the gRIBIgo package.
17
package testcommon
18

19
import (
20
        "path/filepath"
21
        "runtime"
22

23
        "google.golang.org/grpc/credentials"
24
)
25

26
// TLSCreds returns the path for the testcommon/testdata file for all other tests
27
// to use.
UNCOV
28
func TLSCreds() (string, string) {
×
UNCOV
29
        _, fn, _, _ := runtime.Caller(0)
×
UNCOV
30
        td := filepath.Join(filepath.Dir(fn), "testdata")
×
UNCOV
31
        return filepath.Join(td, "server.cert"), filepath.Join(td, "server.key")
×
UNCOV
32
}
×
33

34
// TLSCreds returns TLS credentials that can be used for a device.
35
type TLSCred struct {
36
        C credentials.TransportCredentials
37
}
38

39
// TLSCredsFromFile loads the credentials from the specified cert and key file
40
// and returns them such that they can be used for the gNMI and gRIBI servers.
41
func TLSCredsFromFile(certFile, keyFile string) (*TLSCred, error) {
×
42
        t, err := credentials.NewServerTLSFromFile(certFile, keyFile)
×
43
        if err != nil {
×
44
                return nil, err
×
45
        }
×
46
        return &TLSCred{C: t}, nil
×
47
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc