forked from aws/amazon-ecs-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding network config client to fault handler tests
- Loading branch information
Showing
9 changed files
with
455 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...om/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/fault/v1/handlers/handlers_linux_tests.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
...om/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/fault/v1/handlers/handlers_other_tests.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
139 changes: 139 additions & 0 deletions
139
...ndor/github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/v4/state/mocks/state_mock.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
ecs-agent/tmds/handlers/fault/v1/handlers/handlers_linux_tests.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//go:build linux && unit | ||
// +build linux,unit | ||
|
||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"). You may | ||
// not use this file except in compliance with the License. A copy of the | ||
// License is located at | ||
// | ||
// http://aws.amazon.com/apache2.0/ | ||
// | ||
// or in the "license" file accompanying this file. This file is distributed | ||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
|
||
package handlers | ||
|
||
import ( | ||
"github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/fault/v1/types" | ||
state "github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/v4/state" | ||
mock_state "github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/v4/state/mocks" | ||
mock_execwrapper "github.com/aws/amazon-ecs-agent/ecs-agent/utils/execwrapper/mocks" | ||
mock_netlinkwrapper "github.com/aws/amazon-ecs-agent/ecs-agent/utils/netlinkwrapper/mocks" | ||
|
||
"github.com/golang/mock/gomock" | ||
) | ||
|
||
type networkFaultInjectionTestCase struct { | ||
name string | ||
expectedStatusCode int | ||
requestBody interface{} | ||
expectedResponseBody types.NetworkFaultInjectionResponse | ||
setAgentStateExpectations func(agentState *mock_state.MockAgentState, netConfigClient *state.NetworkConfigClient) | ||
setNetLinkExpectations func(netLink *mock_netlinkwrapper.MockNetLink) | ||
setExecExpectations func(exec *mock_execwrapper.MockExec, ctrl *gomock.Controller) | ||
} |
35 changes: 35 additions & 0 deletions
35
ecs-agent/tmds/handlers/fault/v1/handlers/handlers_other_tests.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//go:build !linux && unit | ||
// +build !linux,unit | ||
|
||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"). You may | ||
// not use this file except in compliance with the License. A copy of the | ||
// License is located at | ||
// | ||
// http://aws.amazon.com/apache2.0/ | ||
// | ||
// or in the "license" file accompanying this file. This file is distributed | ||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
|
||
package handlers | ||
|
||
import ( | ||
"github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/fault/v1/types" | ||
state "github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/v4/state" | ||
mock_state "github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/v4/state/mocks" | ||
mock_execwrapper "github.com/aws/amazon-ecs-agent/ecs-agent/utils/execwrapper/mocks" | ||
|
||
"github.com/golang/mock/gomock" | ||
) | ||
|
||
type networkFaultInjectionTestCase struct { | ||
name string | ||
expectedStatusCode int | ||
requestBody interface{} | ||
expectedResponseBody types.NetworkFaultInjectionResponse | ||
setAgentStateExpectations func(agentState *mock_state.MockAgentState, netConfigClient *state.NetworkConfigClient) | ||
setExecExpectations func(exec *mock_execwrapper.MockExec, ctrl *gomock.Controller) | ||
} |
Oops, something went wrong.