-
Notifications
You must be signed in to change notification settings - Fork 24
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
642e65f
commit b3693c3
Showing
5 changed files
with
531 additions
and
0 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,55 @@ | ||
//go:build ci || connections | ||
// +build ci connections | ||
|
||
// TODO Merge these tests into one launch of collector, reset connection to sensor? | ||
// TODO Remove tests with connection status disabled -- what is the value of testing | ||
|
||
package integrationtests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/stackrox/collector/integration-tests/suites" | ||
) | ||
|
||
// By default, a failed connection is not reported. | ||
func TestAsyncConnectionBlocked(t *testing.T) { | ||
blockedAsyncConnection := &suites.AsyncConnectionTestSuite{ | ||
DisableConnectionStatusTracking: false, | ||
BlockConnection: true, | ||
ExpectToSeeTheConnection: false, | ||
} | ||
suite.Run(t, blockedAsyncConnection) | ||
} | ||
|
||
// A successfull connection is always reported | ||
func TestAsyncConnectionSuccess(t *testing.T) { | ||
asyncConnection := &suites.AsyncConnectionTestSuite{ | ||
DisableConnectionStatusTracking: false, | ||
BlockConnection: false, | ||
ExpectToSeeTheConnection: true, | ||
} | ||
suite.Run(t, asyncConnection) | ||
} | ||
|
||
// With connection status tracking disabled, failed async connections are reported. | ||
func TestAsyncConnectionBlockedWithDisableTracking(t *testing.T) { | ||
blockedAsyncConnection := &suites.AsyncConnectionTestSuite{ | ||
DisableConnectionStatusTracking: true, | ||
BlockConnection: true, | ||
ExpectToSeeTheConnection: true, | ||
} | ||
suite.Run(t, blockedAsyncConnection) | ||
} | ||
|
||
// With connection status tracking disabled, a successfull connection is always reported | ||
func TestAsyncConnectionSuccessWithDisableTracking(t *testing.T) { | ||
asyncConnection := &suites.AsyncConnectionTestSuite{ | ||
DisableConnectionStatusTracking: true, | ||
BlockConnection: false, | ||
ExpectToSeeTheConnection: true, | ||
} | ||
suite.Run(t, asyncConnection) | ||
} |
Oops, something went wrong.