File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Copyright The Prometheus Authors
2+ // Licensed under the Apache License, Version 2.0 (the "License");
3+ // you may not use this file except in compliance with the License.
4+ // You may obtain a copy of the License at
5+ //
6+ // http://www.apache.org/licenses/LICENSE-2.0
7+ //
8+ // Unless required by applicable law or agreed to in writing, software
9+ // distributed under the License is distributed on an "AS IS" BASIS,
10+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+ // See the License for the specific language governing permissions and
12+ // limitations under the License.
13+
14+ //go:build linux
15+
16+ package sysfs
17+
18+ import (
19+ "testing"
20+
21+ "github.com/google/go-cmp/cmp"
22+ )
23+
24+ func TestMEIClass (t * testing.T ) {
25+ fs , err := NewFS (sysTestFixtures )
26+ if err != nil {
27+ t .Fatal (err )
28+ }
29+
30+ got , err := fs .MEIClass ()
31+ if err != nil {
32+ t .Fatal (err )
33+ }
34+
35+ dev := "244:0"
36+ devState := "ENABLED"
37+ fwStatus := "90000245\n 00110500\n 00000020\n 00000000\n 02F41F03\n 40000000"
38+ fwVer := "0:18.0.5.2098\n 0:18.0.5.2098\n 0:18.0.5.2098"
39+ hbmVer := "2.2"
40+ hbmVerDrv := "2.2"
41+ kind := "mei"
42+ trc := "00000889"
43+ txQueueLimit := "50"
44+
45+ want := & MEIClass {
46+ Dev : & dev ,
47+ DevState : & devState ,
48+ FWStatus : & fwStatus ,
49+ FWVersion : & fwVer ,
50+ HBMVersion : & hbmVer ,
51+ HBMVersionDrv : & hbmVerDrv ,
52+ Kind : & kind ,
53+ Trc : & trc ,
54+ TxQueueLimit : & txQueueLimit ,
55+ }
56+
57+ if diff := cmp .Diff (want , got ); diff != "" {
58+ t .Fatalf ("unexpected DMI class (-want +got):\n %s" , diff )
59+ }
60+ }
You can’t perform that action at this time.
0 commit comments