Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the frame_types argument to bridge ports #135

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions client/bridge_port.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (

// BridgePort defines port-in-bridge association
type BridgePort struct {
Id string `mikrotik:".id"`
Bridge string `mikrotik:"bridge"`
Interface string `mikrotik:"interface"`
PVId int `mikrotik:"pvid"`
Comment string `mikrotik:"comment"`
Id string `mikrotik:".id"`
Bridge string `mikrotik:"bridge"`
Interface string `mikrotik:"interface"`
PVId int `mikrotik:"pvid"`
Comment string `mikrotik:"comment"`
FrameTypes string `mikrotik:"frame-types"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field has value admit-all by default, but expected value does not populate it and TestBridgePort_basic fails.

Copy link
Author

@MagicMicky MagicMicky Mar 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be updated, but I wasn't able to properly test unfortunately as I don't have a test environment ready to be used

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GithubActions will indicate success/failure once all conflicts are resolved.

}

func (client Mikrotik) AddBridgePort(r *BridgePort) (*BridgePort, error) {
Expand Down
11 changes: 6 additions & 5 deletions client/bridge_port_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ func TestBridgePort_basic(t *testing.T) {
}()

expected := &BridgePort{
Id: bridgePort.Id,
Bridge: "test_bridge",
Interface: "*0",
PVId: 1,
Comment: bridgePort.Comment,
Id: bridgePort.Id,
Bridge: "test_bridge",
Interface: "*0",
PVId: 1,
Comment: bridgePort.Comment,
FrameTypes: "admit-all",
}
if !reflect.DeepEqual(expected, bridgePort) {
t.Errorf(`expected and actual bridge port objects are not equal:
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ go 1.18

require (
github.com/ddelnano/terraform-provider-mikrotik/client v0.0.0-00010101000000-000000000000
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.20.0
golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0
)

require (
Expand All @@ -26,7 +28,6 @@ require (
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-hclog v1.2.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.4 // indirect
Expand Down Expand Up @@ -63,7 +64,7 @@ require (
github.com/zclconf/go-cty v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect
Expand Down
Loading