Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DanG100 committed Sep 28, 2023
1 parent e9fb7f0 commit c569cd6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions dataplane/standalone/saiserver/ports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func TestSetPortAttribute(t *testing.T) {
ContextId: &fwdpb.ContextId{},
},
wantAttr: &saipb.PortAttribute{
OperStatus: saipb.PortOperStatus_PORT_OPER_STATUS_DOWN.Enum(),
AdminState: proto.Bool(false),
},
}}
Expand All @@ -133,6 +134,9 @@ func TestSetPortAttribute(t *testing.T) {
}
dplane := &fakePortDataplaneAPI{}
c, mgr, stopFn := newTestPort(t, dplane)
mgr.StoreAttributes(1, &saipb.PortAttribute{
OperStatus: saipb.PortOperStatus_PORT_OPER_STATUS_DOWN.Enum(),
})
defer stopFn()
_, gotErr := c.SetPortAttribute(context.TODO(), tt.req)
if diff := errdiff.Check(gotErr, tt.wantErr); diff != "" {
Expand Down Expand Up @@ -173,13 +177,15 @@ func TestCreateHostif(t *testing.T) {
}, {
desc: "success netdev",
req: &saipb.CreateHostifRequest{
Type: saipb.HostifType_HOSTIF_TYPE_NETDEV.Enum(),
Type: saipb.HostifType_HOSTIF_TYPE_NETDEV.Enum(),
ObjId: proto.Uint64(2),
},
want: &saipb.CreateHostifResponse{
Oid: 1,
},
wantAttr: &saipb.HostifAttribute{
Type: saipb.HostifType_HOSTIF_TYPE_NETDEV.Enum(),
Type: saipb.HostifType_HOSTIF_TYPE_NETDEV.Enum(),
ObjId: proto.Uint64(2),
},
}}
for _, tt := range tests {
Expand All @@ -189,6 +195,9 @@ func TestCreateHostif(t *testing.T) {
}
dplane := &fakePortDataplaneAPI{}
c, mgr, stopFn := newTestHostif(t, dplane)
mgr.StoreAttributes(2, &saipb.PortAttribute{
OperStatus: saipb.PortOperStatus_PORT_OPER_STATUS_DOWN.Enum(),
})
defer stopFn()
got, gotErr := c.CreateHostif(context.TODO(), tt.req)
if diff := errdiff.Check(gotErr, tt.wantErr); diff != "" {
Expand Down

0 comments on commit c569cd6

Please sign in to comment.