-
Notifications
You must be signed in to change notification settings - Fork 30
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 win user data test #377
Conversation
@@ -122,6 +122,10 @@ var testTypeToTestConfig = map[string][]testConfig{ | |||
{testDir: "../../../test/restart"}, | |||
{testDir: "../../../test/acceptance"}, | |||
{testDir: "../../../test/feature/windows/event_logs"}, | |||
{ |
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.
I don't think we need to run this on all platforms.
The latest "win-2022" has both a test for ssm and non ssm.
Meaning this will be tested the same 2 times.
This test will only use ssm since it makes the ps1 command simpler.
e74a3e3
to
6f41a81
Compare
} | ||
|
||
# Size of windows json is too large thus can't use standard tier | ||
resource "aws_ssm_parameter" "upload_ssm" { | ||
count = var.use_ssm == true && length(regexall("/feature/windows", var.test_dir)) > 0 ? 1 : 0 | ||
count = length(regexall("/feature/windows", var.test_dir)) > 0 ? 1 : 0 |
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 can upload the value to ssm for all feature tests since it will be deleted by terraform destroy anyway. This will allow us to use ssm for userdata test.
terraform/ec2/win/main.tf
Outdated
template = file("install_and_start_agent.tpl") | ||
|
||
vars = { | ||
copy_object = "Copy-S3Object -BucketName ${var.s3_bucket} -Key integration-test/packaging/${var.cwa_github_sha}/amazon-cloudwatch-agent.msi -region ${var.region} -LocalFile $cwAgentInstaller" |
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.
For some reason var replacement was not working for the internal vars of this command and started working when I added the entire command as the var.
}, | ||
"force_flush_interval": 30 | ||
}, | ||
"logs": { |
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.
While not testing logs the validator will fail if there is no logs config.
# Metric that the test needs to validate; moreover, the stress validation already has | ||
# InstanceID dimension; therefore, does not need to validate it | ||
# https://github.com/aws/amazon-cloudwatch-agent-test/pull/109/files#diff-47c87373e751dd9fd5ce504e44b320765c8b84d6cde524a4e8a32cfa34674165R124-R135 | ||
metric_namespace: "CloudWatchAgentWinFeature" |
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.
Only test metrics since this is more of a sanity test that we can install and start the agent via userdata thus no need to test logs.
6f41a81
to
389d043
Compare
@@ -17,4 +17,4 @@ func main() { | |||
binary.BigEndian.PutUint32(r[0:4], uint32(epochNow)) | |||
rand.Read(r[4:]) | |||
fmt.Printf("%s", hex.EncodeToString(r[:])) | |||
} |
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.
This come from running make fmt
@@ -47,6 +47,7 @@ install-golang-lint: | |||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN_DIR) v1.50.1 | |||
|
|||
fmt: install-goimports addlicense | |||
terraform fmt -recursive |
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.
I don't want to have to run this command in terminal when I get terraform fmt error. I should be able to run it via make.
null_resource.integration_test_wait, | ||
] | ||
|
||
connection { |
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.
If we are using EC2 "userdata" to launch the instance and install the agent, then do we still need winrm access to the instance?
In other words, after launching a Windows EC2 instance with the agent installed with user-data, what additional steps occur?
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.
This runs the validator, it does not reinstall / restart the agent. The validator runs on the ec2 instance.
5e77737
to
ad75b58
Compare
Description of the issue
We do not have a windows user data test.
Description of changes
Add a windows userdata test
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Ran integration tests
https://github.com/aws/amazon-cloudwatch-agent/actions/runs/6801520646/job/18568980590