-
Notifications
You must be signed in to change notification settings - Fork 124
CSPL-441 Create utilities to search and ingest data on a pod #136
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
Conversation
f789ad7
to
e94882b
Compare
d0e634f
to
fdef186
Compare
8ad6170
to
80b6d2c
Compare
80b6d2c
to
ed42c51
Compare
Looks good. for the future, we can refactor the test suite to make rest calls using HTTP client as we do in src code https://github.com/splunk/splunk-operator/blob/master/pkg/splunk/client/enterprise.go so that we don't need to go through PodExec and we can have consistency between src code and test suite |
|
||
// ConsistentPollInterval is the interval to use to consistently check a state is stable | ||
ConsistentPollInterval = 200 * time.Millisecond | ||
ConsistentDuration = 2000 * time.Millisecond |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: does it make sense to use ConsistentDuration = 10 * ConsistentPollInterval
Also, i don't see the usage for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are used in the verificationutils.go in StandaloneReady()
. I used the values used in all other integration tests for consistency.
6b8ec95
to
5704ab0
Compare
test/testenv/search_utils.go
Outdated
username := "admin" | ||
password := "$(cat /mnt/splunk-secrets/password)" | ||
|
||
fmt.Fprintf(&searchReqBuilder, "%s %s:%s %s -d output_mode=json -d search=\"search %s\"", curlCmd, username, password, url, search) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably make it a separate function since this is being used multiple places. Something like getSearchCmd(curlCmd, username, password, url, search)
or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could but it would only be the same in the PerformSearchReq()
and PerformSearchSync()
functions since the others are slightly different. Since each search/rest call will have it's own URL and POST data, I'd rather build the command here. Though we could have a flag to switch between the async and sync versions. But then the return values will be different. So probably best to keep them separate, IMO.
|
||
// Verify splunk status is up | ||
Eventually(func() splcommon.Phase { | ||
podName := fmt.Sprintf("splunk-%s-standalone-0", deployment.GetName()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can make it a function to get the podname so that it can be used by other tests too such as to get podname for CM or indexer or LM,etc? Something like getPodName("standalone", deployment.GetName())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya this is how its done in other places in the test code. I just mimicked it here. Maybe we can create a refactor backlog item to take care of this throughout.
var logLine strings.Builder | ||
level := "DEBUG" | ||
component := "GenericComponent" | ||
msg := "This log line is special!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hehe, good one :)
5704ab0
to
e106a31
Compare
…k operator Add test utils for running searchs Add test utils for creating and ingesting log files Add test suite that ingests a log and searches it
e106a31
to
4a14f06
Compare
Verify that new smoke tests pass.