-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0cda43
commit 0257bff
Showing
4 changed files
with
51 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2024-present Datadog, Inc. | ||
|
||
package flare | ||
|
||
import ( | ||
"net/http" | ||
"net/http/httptest" | ||
"path" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/DataDog/datadog-agent/pkg/config/model" | ||
) | ||
|
||
func sysprobeSocketPath(t *testing.T) string { | ||
return path.Join(t.TempDir(), "sysprobe.sock") | ||
} | ||
|
||
// NewSystemProbeTestServer starts a new mock server to handle System Probe requests. | ||
func NewSystemProbeTestServer(_ http.Handler) (*httptest.Server, error) { | ||
return nil, nil | ||
} | ||
|
||
// InjectConnectionFailures injects a failure in TestReadProfileDataErrors. | ||
func InjectConnectionFailures(_ model.Config, _ model.Config) { | ||
// macOS doesn't currently support any system-probe modules | ||
} | ||
|
||
// CheckExpectedConnectionFailures checks the expected errors after simulated | ||
// connection failures. | ||
func CheckExpectedConnectionFailures(c *commandTestSuite, err error) { | ||
// System probe by default is disabled and no connection is attempted for it in the test. | ||
require.Regexp(c.T(), "^4 errors occurred:\n", err.Error()) | ||
} |
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
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