Skip to content
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

Update canary test to use public S3 download link. #404

Merged
merged 4 commits into from
Apr 19, 2024
Merged

Conversation

adam-mateen
Copy link
Contributor

Description of the issue

We want a canary test that downloads the agent the same way that users do... From the public S3 URL.

Description of changes

The test is now hardcoded to test the public global S3 download link.
Future improvement can be made to test against a list of S3 URLs (regional S3 links).
Other than that the test remains the same.
It verifies the agent can be downloaded, installed, started with a basic config, and that the version is correct.
It reports custom metrics to the test account so we can add alarms on those to make sure all of the above is working.

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 the test on an EC2:
dev-dsk-adamym-1d-90bc66b6 % AWS_REGION=us-east-1 go test ./ -count=1 -computeType=EC2 -v
=== RUN   TestCanary
2024/04/19 03:45:17 Uninstalling Agent...
2024/04/19 03:45:19 downloading from https://amazoncloudwatch-agent.s3.amazonaws.com/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm to ./amazon-cloudwatch-agent.rpm
2024/04/19 03:45:20 Installing Agent...
2024/04/19 03:45:24 Copy File resources/canary_config.json to /opt/aws/amazon-cloudwatch-agent/bin/config.json
2024/04/19 03:45:24 File resources/canary_config.json abs path /home/adamym/go/src/github.com/aws/amazon-cloudwatch-agent-test/test/canary/resources/canary_config.json
2024/04/19 03:45:24 File : resources/canary_config.json copied to : /opt/aws/amazon-cloudwatch-agent/bin/config.json
2024/04/19 03:45:24 Testing all EC2 plugins
2024/04/19 03:45:24 Testing all EC2 plugins
2024/04/19 03:45:24 Starting agent with command sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json
2024/04/19 03:45:24 Agent has started
2024/04/19 03:45:24 downloading from https://amazoncloudwatch-agent.s3.amazonaws.com/info/latest/CWAGENT_VERSION to ./CWAGENT_VERSION
2024/04/19 03:45:24 expected version: 1.300035.0b547, actual version: 1.300035.0b547
--- PASS: TestCanary (7.00s)
PASS
ok  	github.com/aws/amazon-cloudwatch-agent-test/test/canary	7.008s

nathalapooja
nathalapooja previously approved these changes Apr 19, 2024
zhihonl
zhihonl previously approved these changes Apr 19, 2024
@adam-mateen adam-mateen dismissed stale reviews from zhihonl and nathalapooja via c0905ea April 19, 2024 14:56
zhihonl
zhihonl previously approved these changes Apr 19, 2024
nathalapooja
nathalapooja previously approved these changes Apr 19, 2024
@adam-mateen adam-mateen dismissed stale reviews from nathalapooja and zhihonl via d45d6fd April 19, 2024 15:23
@adam-mateen adam-mateen merged commit d4e556e into main Apr 19, 2024
2 checks passed
@adam-mateen adam-mateen deleted the public-canary branch April 19, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants