From 1ed82cc071a2769f8dcdcb1900384f6967f5dd76 Mon Sep 17 00:00:00 2001 From: musa-asad Date: Mon, 2 Dec 2024 11:17:48 -0500 Subject: [PATCH 01/13] Increase duration to 5 minutes for JMX Kafka tests. --- test/metric_value_benchmark/jmx_kafka_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/metric_value_benchmark/jmx_kafka_test.go b/test/metric_value_benchmark/jmx_kafka_test.go index 362736f87..81acff382 100644 --- a/test/metric_value_benchmark/jmx_kafka_test.go +++ b/test/metric_value_benchmark/jmx_kafka_test.go @@ -44,7 +44,7 @@ func (t *JMXKafkaTestRunner) GetAgentConfigFileName() string { } func (t *JMXKafkaTestRunner) GetAgentRunDuration() time.Duration { - return 2 * time.Minute + return 5 * time.Minute } func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error { From 50b4a00991f63f077ff568f53c29ffd7b1a17abb Mon Sep 17 00:00:00 2001 From: musa-asad Date: Mon, 2 Dec 2024 12:22:26 -0500 Subject: [PATCH 02/13] Skip passing test runners. --- .../metrics_value_benchmark_test.go | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/metric_value_benchmark/metrics_value_benchmark_test.go b/test/metric_value_benchmark/metrics_value_benchmark_test.go index ba7e63276..0bdad3a3c 100644 --- a/test/metric_value_benchmark/metrics_value_benchmark_test.go +++ b/test/metric_value_benchmark/metrics_value_benchmark_test.go @@ -98,22 +98,22 @@ func getEc2TestRunners(env *environment.MetaData) []*test_runner.TestRunner { if ec2TestRunners == nil { factory := dimension.GetDimensionFactory(*env) ec2TestRunners = []*test_runner.TestRunner{ - {TestRunner: &StatsdTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &DiskTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &NetStatTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &PrometheusTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &CPUTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &MemTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &ProcStatTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &DiskIOTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &NetTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &EthtoolTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &EMFTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &SwapTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &ProcessesTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &CollectDTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &RenameSSMTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - {TestRunner: &JMXTomcatJVMTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &StatsdTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &DiskTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &NetStatTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &PrometheusTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &CPUTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &MemTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &ProcStatTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &DiskIOTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &NetTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &EthtoolTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &EMFTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &SwapTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &ProcessesTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &CollectDTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &RenameSSMTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + //{TestRunner: &JMXTomcatJVMTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, {TestRunner: &JMXKafkaTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, } } From 50294912ba224d40636348e8e8339e591685cdd9 Mon Sep 17 00:00:00 2001 From: musa-asad Date: Mon, 2 Dec 2024 12:42:20 -0500 Subject: [PATCH 03/13] Pull latest version for kafka. --- test/metric_value_benchmark/jmx_kafka_test.go | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/test/metric_value_benchmark/jmx_kafka_test.go b/test/metric_value_benchmark/jmx_kafka_test.go index 81acff382..824642649 100644 --- a/test/metric_value_benchmark/jmx_kafka_test.go +++ b/test/metric_value_benchmark/jmx_kafka_test.go @@ -55,24 +55,25 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error { log.Println("set up zookeeper and kafka") startJMXCommands := []string{ - "curl https://dlcdn.apache.org/kafka/3.6.2/kafka_2.13-3.6.2.tgz -o kafka_2.13-3.6.2.tgz", - "tar -xzf kafka_2.13-3.6.2.tgz", - "echo 'export JMX_PORT=2000'|cat - kafka_2.13-3.6.2/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-3.6.2/bin/kafka-server-start.sh", - "echo 'export JMX_PORT=2010'|cat - kafka_2.13-3.6.2/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-3.6.2/bin/kafka-console-consumer.sh", - "echo 'export JMX_PORT=2020'|cat - kafka_2.13-3.6.2/bin/kafka-console-producer.sh > /tmp/kafka-console-producer.sh && mv /tmp/kafka-console-producer.sh kafka_2.13-3.6.2/bin/kafka-console-producer.sh", - "sudo chmod +x kafka_2.13-3.6.2/bin/kafka-run-class.sh", - "sudo chmod +x kafka_2.13-3.6.2/bin/kafka-server-start.sh", - "sudo chmod +x kafka_2.13-3.6.2/bin/kafka-console-consumer.sh", - "sudo chmod +x kafka_2.13-3.6.2/bin/kafka-console-producer.sh", - "(yes | nohup kafka_2.13-3.6.2/bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092) > /tmp/kafka-console-producer-logs.txt 2>&1 &", - "kafka_2.13-3.6.2/bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092 > /tmp/kafka-console-consumer-logs.txt 2>&1 &", + "kafka_version=$(curl -s https://dlcdn.apache.org/kafka/ | grep -oE \"\\d\\.\\d\\.\\d\" | tail -1)\n", + "curl https://dlcdn.apache.org/kafka/${kafka_version}/kafka_2.13-${kafka_version}.tgz -o kafka_2.13-${kafka_version}.tgz", + "tar -xzf kafka_2.13-${kafka_version}.tgz", + "echo 'export JMX_PORT=2000'|cat - kafka_2.13-${kafka_version}/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-${kafka_version}/bin/kafka-server-start.sh", + "echo 'export JMX_PORT=2010'|cat - kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh", + "echo 'export JMX_PORT=2020'|cat - kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh > /tmp/kafka-console-producer.sh && mv /tmp/kafka-console-producer.sh kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh", + "sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-run-class.sh", + "sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-server-start.sh", + "sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh", + "sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh", + "(yes | nohup kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092) > /tmp/kafka-console-producer-logs.txt 2>&1 &", + "kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092 > /tmp/kafka-console-consumer-logs.txt 2>&1 &", "curl https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz -o apache-zookeeper-3.8.4-bin.tar.gz", "tar -xzf apache-zookeeper-3.8.4-bin.tar.gz", "mkdir apache-zookeeper-3.8.4-bin/data", "touch apache-zookeeper-3.8.4-bin/conf/zoo.cfg", "echo -e 'tickTime = 2000\ndataDir = ../data\nclientPort = 2181\ninitLimit = 5\nsyncLimit = 2\n' >> apache-zookeeper-3.8.4-bin/conf/zoo.cfg", "sudo apache-zookeeper-3.8.4-bin/bin/zkServer.sh start", - "sudo kafka_2.13-3.6.2/bin/kafka-server-start.sh kafka_2.13-3.6.2/config/server.properties > /tmp/kafka-server-start-logs.txt 2>&1 &", + "sudo kafka_2.13-${kafka_version}/bin/kafka-server-start.sh kafka_2.13-${kafka_version}/config/server.properties > /tmp/kafka-server-start-logs.txt 2>&1 &", } err = common.RunCommands(startJMXCommands) From d1620661d77d5c60afd52b3308f42239d5f84971 Mon Sep 17 00:00:00 2001 From: lisguo Date: Mon, 2 Dec 2024 12:43:11 -0500 Subject: [PATCH 04/13] Ignore all other tests --- generator/test_case_generator.go | 346 +++++++++++++++---------------- 1 file changed, 173 insertions(+), 173 deletions(-) diff --git a/generator/test_case_generator.go b/generator/test_case_generator.go index a811e7c5c..bcff632e0 100644 --- a/generator/test_case_generator.go +++ b/generator/test_case_generator.go @@ -56,193 +56,193 @@ const ( // you can't have a const map in golang var testTypeToTestConfig = map[string][]testConfig{ - "ec2_gpu": { - {testDir: "./test/nvidia_gpu"}, - }, + //"ec2_gpu": { + // {testDir: "./test/nvidia_gpu"}, + //}, testTypeKeyEc2Linux: { - {testDir: "./test/ca_bundle"}, - {testDir: "./test/cloudwatchlogs"}, - { - testDir: "./test/metrics_number_dimension", - targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - }, - { - testDir: "./test/emf_concurrent", - targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - maxAttempts: 1, - }, + //{testDir: "./test/ca_bundle"}, + //{testDir: "./test/cloudwatchlogs"}, + //{ + // testDir: "./test/metrics_number_dimension", + // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + //}, + //{ + // testDir: "./test/emf_concurrent", + // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + // maxAttempts: 1, + //}, {testDir: "./test/metric_value_benchmark"}, - {testDir: "./test/run_as_user"}, - {testDir: "./test/collection_interval"}, - {testDir: "./test/metric_dimension"}, - {testDir: "./test/restart"}, - {testDir: "./test/xray"}, - {testDir: "./test/otlp"}, - { - testDir: "./test/acceptance", - targets: map[string]map[string]struct{}{"os": {"ubuntu-20.04": {}}}, - }, + //{testDir: "./test/run_as_user"}, + //{testDir: "./test/collection_interval"}, + //{testDir: "./test/metric_dimension"}, + //{testDir: "./test/restart"}, + //{testDir: "./test/xray"}, + //{testDir: "./test/otlp"}, + //{ + // testDir: "./test/acceptance", + // targets: map[string]map[string]struct{}{"os": {"ubuntu-20.04": {}}}, + //}, // skipping FIPS test as the test cannot be verified // neither ssh nor SSM works after a reboot once FIPS is enabled //{ // testDir: "./test/fips", // targets: map[string]map[string]struct{}{"os": {"rhel8": {}}}, //}, - { - testDir: "./test/lvm", - targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - }, - { - testDir: "./test/proxy", - targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - }, - { - testDir: "./test/ssl_cert", - targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - }, - { - testDir: "./test/userdata", - terraformDir: "terraform/ec2/userdata", - targets: map[string]map[string]struct{}{"os": {"ol9": {}}}, - }, - { - testDir: "./test/assume_role", - terraformDir: "terraform/ec2/creds", - targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - }, - { - testDir: "./test/amp", - targets: map[string]map[string]struct{}{"os": {"al2": {}}, "arc": {"amd64": {}}}, - }, - { - testDir: "./test/agent_otel_merging", - targets: map[string]map[string]struct{}{"os": {"al2": {}}, "arc": {"amd64": {}}}, - }, + //{ + // testDir: "./test/lvm", + // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + //}, + //{ + // testDir: "./test/proxy", + // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + //}, + //{ + // testDir: "./test/ssl_cert", + // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + //}, + //{ + // testDir: "./test/userdata", + // terraformDir: "terraform/ec2/userdata", + // targets: map[string]map[string]struct{}{"os": {"ol9": {}}}, + //}, + //{ + // testDir: "./test/assume_role", + // terraformDir: "terraform/ec2/creds", + // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + //}, + //{ + // testDir: "./test/amp", + // targets: map[string]map[string]struct{}{"os": {"al2": {}}, "arc": {"amd64": {}}}, + //}, + //{ + // testDir: "./test/agent_otel_merging", + // targets: map[string]map[string]struct{}{"os": {"al2": {}}, "arc": {"amd64": {}}}, + //}, }, /* You can only place 1 mac instance on a dedicate host a single time. Therefore, limit down the scope for testing in Mac since EC2 can be done with Linux and Mac under the hood share similar plugins with Linux */ - "ec2_mac": { - {testDir: "../../../test/feature/mac"}, - }, - "ec2_windows": { - {testDir: "../../../test/feature/windows"}, - {testDir: "../../../test/restart"}, - {testDir: "../../../test/acceptance"}, - {testDir: "../../../test/feature/windows/event_logs"}, - { - testDir: "../../../test/feature/windows/custom_start/userdata", - targets: map[string]map[string]struct{}{"os": {"win-2019": {}}}, - }, - { - testDir: "../../../test/feature/windows/custom_start/ssm_start", - targets: map[string]map[string]struct{}{"os": {"win-2019": {}}}, - }, - // assume role test doesn't add much value, and it already being tested with linux - //{testDir: "../../../test/assume_role"}, - }, - "ec2_performance": { - {testDir: "../../test/performance/emf"}, - {testDir: "../../test/performance/logs"}, - {testDir: "../../test/performance/system"}, - {testDir: "../../test/performance/statsd"}, - {testDir: "../../test/performance/collectd"}, - {testDir: "../../test/performance/trace/xray", runMockServer: true}, - }, - "ec2_windows_performance": { - {testDir: "../../test/performance/windows/logs"}, - {testDir: "../../test/performance/windows/system"}, - }, - "ec2_stress": { - {testDir: "../../test/stress/emf"}, - {testDir: "../../test/stress/logs"}, - {testDir: "../../test/stress/system"}, - {testDir: "../../test/stress/statsd"}, - {testDir: "../../test/stress/collectd"}, - }, - "ec2_windows_stress": { - {testDir: "../../test/stress/windows/logs"}, - {testDir: "../../test/stress/windows/system"}, - }, - "ecs_fargate": { - {testDir: "./test/ecs/ecs_metadata"}, - }, - "ecs_ec2_daemon": { - { - testDir: "./test/metric_value_benchmark", - targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, - }, - { - testDir: "./test/statsd", - targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, - }, - { - testDir: "./test/emf", - targets: map[string]map[string]struct{}{"metadataEnabled": {"disabled": {}}}, - }, - { - testDir: "./test/emf", - targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, - }, - }, - "eks_addon": { - { - testDir: "../../../../test/gpu", - terraformDir: "terraform/eks/addon/gpu", - }, - }, - "eks_daemon": { - { - testDir: "./test/metric_value_benchmark", - targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - instanceType: "g4dn.xlarge", - }, - { - testDir: "./test/metric_value_benchmark", - terraformDir: "terraform/eks/daemon/windows/2019", - targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - }, - { - testDir: "./test/metric_value_benchmark", - terraformDir: "terraform/eks/daemon/windows/2022", - targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - }, - { - testDir: "./test/statsd", terraformDir: "terraform/eks/daemon/statsd", - targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - }, - { - testDir: "./test/emf", terraformDir: "terraform/eks/daemon/emf", - targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - }, - { - testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/d", - targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - }, - {testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/bit"}, - {testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/windows/2022"}, - { - testDir: "./test/gpu", terraformDir: "terraform/eks/daemon/gpu", - targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - }, - { - testDir: "./test/awsneuron", terraformDir: "terraform/eks/daemon/awsneuron", - targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - }, - { - testDir: "./test/entity", terraformDir: "terraform/eks/daemon/entity", - targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - }, - { - testDir: "./test/efa", terraformDir: "terraform/eks/daemon/efa", - targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - }, - }, - "eks_deployment": { - {testDir: "./test/metric_value_benchmark"}, - }, + //"ec2_mac": { + // {testDir: "../../../test/feature/mac"}, + //}, + //"ec2_windows": { + // {testDir: "../../../test/feature/windows"}, + // {testDir: "../../../test/restart"}, + // {testDir: "../../../test/acceptance"}, + // {testDir: "../../../test/feature/windows/event_logs"}, + // { + // testDir: "../../../test/feature/windows/custom_start/userdata", + // targets: map[string]map[string]struct{}{"os": {"win-2019": {}}}, + // }, + // { + // testDir: "../../../test/feature/windows/custom_start/ssm_start", + // targets: map[string]map[string]struct{}{"os": {"win-2019": {}}}, + // }, + // // assume role test doesn't add much value, and it already being tested with linux + // //{testDir: "../../../test/assume_role"}, + //}, + //"ec2_performance": { + // {testDir: "../../test/performance/emf"}, + // {testDir: "../../test/performance/logs"}, + // {testDir: "../../test/performance/system"}, + // {testDir: "../../test/performance/statsd"}, + // {testDir: "../../test/performance/collectd"}, + // {testDir: "../../test/performance/trace/xray", runMockServer: true}, + //}, + //"ec2_windows_performance": { + // {testDir: "../../test/performance/windows/logs"}, + // {testDir: "../../test/performance/windows/system"}, + //}, + //"ec2_stress": { + // {testDir: "../../test/stress/emf"}, + // {testDir: "../../test/stress/logs"}, + // {testDir: "../../test/stress/system"}, + // {testDir: "../../test/stress/statsd"}, + // {testDir: "../../test/stress/collectd"}, + //}, + //"ec2_windows_stress": { + // {testDir: "../../test/stress/windows/logs"}, + // {testDir: "../../test/stress/windows/system"}, + //}, + //"ecs_fargate": { + // {testDir: "./test/ecs/ecs_metadata"}, + //}, + //"ecs_ec2_daemon": { + // { + // testDir: "./test/metric_value_benchmark", + // targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, + // }, + // { + // testDir: "./test/statsd", + // targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, + // }, + // { + // testDir: "./test/emf", + // targets: map[string]map[string]struct{}{"metadataEnabled": {"disabled": {}}}, + // }, + // { + // testDir: "./test/emf", + // targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, + // }, + //}, + //"eks_addon": { + // { + // testDir: "../../../../test/gpu", + // terraformDir: "terraform/eks/addon/gpu", + // }, + //}, + //"eks_daemon": { + // { + // testDir: "./test/metric_value_benchmark", + // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + // instanceType: "g4dn.xlarge", + // }, + // { + // testDir: "./test/metric_value_benchmark", + // terraformDir: "terraform/eks/daemon/windows/2019", + // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + // }, + // { + // testDir: "./test/metric_value_benchmark", + // terraformDir: "terraform/eks/daemon/windows/2022", + // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + // }, + // { + // testDir: "./test/statsd", terraformDir: "terraform/eks/daemon/statsd", + // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + // }, + // { + // testDir: "./test/emf", terraformDir: "terraform/eks/daemon/emf", + // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + // }, + // { + // testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/d", + // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + // }, + // {testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/bit"}, + // {testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/windows/2022"}, + // { + // testDir: "./test/gpu", terraformDir: "terraform/eks/daemon/gpu", + // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + // }, + // { + // testDir: "./test/awsneuron", terraformDir: "terraform/eks/daemon/awsneuron", + // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + // }, + // { + // testDir: "./test/entity", terraformDir: "terraform/eks/daemon/entity", + // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + // }, + // { + // testDir: "./test/efa", terraformDir: "terraform/eks/daemon/efa", + // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + // }, + //}, + //"eks_deployment": { + // {testDir: "./test/metric_value_benchmark"}, + //}, } type partition struct { From 5ef9752172384387c67c03c870f37bf7d936912b Mon Sep 17 00:00:00 2001 From: musa-asad Date: Mon, 2 Dec 2024 13:04:42 -0500 Subject: [PATCH 05/13] Add export. --- test/metric_value_benchmark/jmx_kafka_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/metric_value_benchmark/jmx_kafka_test.go b/test/metric_value_benchmark/jmx_kafka_test.go index 824642649..fbd771b18 100644 --- a/test/metric_value_benchmark/jmx_kafka_test.go +++ b/test/metric_value_benchmark/jmx_kafka_test.go @@ -55,7 +55,7 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error { log.Println("set up zookeeper and kafka") startJMXCommands := []string{ - "kafka_version=$(curl -s https://dlcdn.apache.org/kafka/ | grep -oE \"\\d\\.\\d\\.\\d\" | tail -1)\n", + "export kafka_version=$(curl -s https://dlcdn.apache.org/kafka/ | grep -oE \"\\d\\.\\d\\.\\d\" | tail -1)\n", "curl https://dlcdn.apache.org/kafka/${kafka_version}/kafka_2.13-${kafka_version}.tgz -o kafka_2.13-${kafka_version}.tgz", "tar -xzf kafka_2.13-${kafka_version}.tgz", "echo 'export JMX_PORT=2000'|cat - kafka_2.13-${kafka_version}/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-${kafka_version}/bin/kafka-server-start.sh", From c80d3c23c16d1e61246e66ce0a585533ca56b9db Mon Sep 17 00:00:00 2001 From: musa-asad Date: Mon, 2 Dec 2024 13:28:21 -0500 Subject: [PATCH 06/13] Use variable to get version. --- test/metric_value_benchmark/jmx_kafka_test.go | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/test/metric_value_benchmark/jmx_kafka_test.go b/test/metric_value_benchmark/jmx_kafka_test.go index fbd771b18..12e3273f7 100644 --- a/test/metric_value_benchmark/jmx_kafka_test.go +++ b/test/metric_value_benchmark/jmx_kafka_test.go @@ -6,6 +6,7 @@ package metric_value_benchmark import ( + "fmt" "log" "time" @@ -53,27 +54,29 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error { return err } + log.Println("get kafka latest version") + version, err := common.RunCommand("curl https://dlcdn.apache.org/kafka/ | grep -oE \"\\d\\.\\d\\.\\d\" | tail -1") + log.Println("set up zookeeper and kafka") startJMXCommands := []string{ - "export kafka_version=$(curl -s https://dlcdn.apache.org/kafka/ | grep -oE \"\\d\\.\\d\\.\\d\" | tail -1)\n", - "curl https://dlcdn.apache.org/kafka/${kafka_version}/kafka_2.13-${kafka_version}.tgz -o kafka_2.13-${kafka_version}.tgz", - "tar -xzf kafka_2.13-${kafka_version}.tgz", - "echo 'export JMX_PORT=2000'|cat - kafka_2.13-${kafka_version}/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-${kafka_version}/bin/kafka-server-start.sh", - "echo 'export JMX_PORT=2010'|cat - kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh", - "echo 'export JMX_PORT=2020'|cat - kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh > /tmp/kafka-console-producer.sh && mv /tmp/kafka-console-producer.sh kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh", - "sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-run-class.sh", - "sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-server-start.sh", - "sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh", - "sudo chmod +x kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh", - "(yes | nohup kafka_2.13-${kafka_version}/bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092) > /tmp/kafka-console-producer-logs.txt 2>&1 &", - "kafka_2.13-${kafka_version}/bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092 > /tmp/kafka-console-consumer-logs.txt 2>&1 &", + fmt.Sprintf("curl https://dlcdn.apache.org/kafka/%s/kafka_2.13-%s.tgz -o kafka_2.13-latest.tgz", version), + "tar -xzf kafka_2.13-latest.tgz", + "echo 'export JMX_PORT=2000'|cat - kafka_2.13-latest/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-latest/bin/kafka-server-start.sh", + "echo 'export JMX_PORT=2010'|cat - kafka_2.13-latest/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-latest/bin/kafka-console-consumer.sh", + "echo 'export JMX_PORT=2020'|cat - kafka_2.13-latest/bin/kafka-console-producer.sh > /tmp/kafka-console-producer.sh && mv /tmp/kafka-console-producer.sh kafka_2.13-latest/bin/kafka-console-producer.sh", + "sudo chmod +x kafka_2.13-latest/bin/kafka-run-class.sh", + "sudo chmod +x kafka_2.13-latest/bin/kafka-server-start.sh", + "sudo chmod +x kafka_2.13-latest/bin/kafka-console-consumer.sh", + "sudo chmod +x kafka_2.13-latest/bin/kafka-console-producer.sh", + "(yes | nohup kafka_2.13-latest/bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092) > /tmp/kafka-console-producer-logs.txt 2>&1 &", + "kafka_2.13-latest/bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092 > /tmp/kafka-console-consumer-logs.txt 2>&1 &", "curl https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz -o apache-zookeeper-3.8.4-bin.tar.gz", "tar -xzf apache-zookeeper-3.8.4-bin.tar.gz", "mkdir apache-zookeeper-3.8.4-bin/data", "touch apache-zookeeper-3.8.4-bin/conf/zoo.cfg", "echo -e 'tickTime = 2000\ndataDir = ../data\nclientPort = 2181\ninitLimit = 5\nsyncLimit = 2\n' >> apache-zookeeper-3.8.4-bin/conf/zoo.cfg", "sudo apache-zookeeper-3.8.4-bin/bin/zkServer.sh start", - "sudo kafka_2.13-${kafka_version}/bin/kafka-server-start.sh kafka_2.13-${kafka_version}/config/server.properties > /tmp/kafka-server-start-logs.txt 2>&1 &", + "sudo kafka_2.13-latest/bin/kafka-server-start.sh kafka_2.13-latest/config/server.properties > /tmp/kafka-server-start-logs.txt 2>&1 &", } err = common.RunCommands(startJMXCommands) From 3d65741e697aeaadb2e727a80617ff23a087f163 Mon Sep 17 00:00:00 2001 From: musa-asad Date: Mon, 2 Dec 2024 13:31:18 -0500 Subject: [PATCH 07/13] Fix sprintf. --- test/metric_value_benchmark/jmx_kafka_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/metric_value_benchmark/jmx_kafka_test.go b/test/metric_value_benchmark/jmx_kafka_test.go index 12e3273f7..477a525e3 100644 --- a/test/metric_value_benchmark/jmx_kafka_test.go +++ b/test/metric_value_benchmark/jmx_kafka_test.go @@ -54,12 +54,12 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error { return err } - log.Println("get kafka latest version") + log.Println("get latest kafka version") version, err := common.RunCommand("curl https://dlcdn.apache.org/kafka/ | grep -oE \"\\d\\.\\d\\.\\d\" | tail -1") log.Println("set up zookeeper and kafka") startJMXCommands := []string{ - fmt.Sprintf("curl https://dlcdn.apache.org/kafka/%s/kafka_2.13-%s.tgz -o kafka_2.13-latest.tgz", version), + fmt.Sprintf("curl https://dlcdn.apache.org/kafka/%s/kafka_2.13-%s.tgz -o kafka_2.13-latest.tgz", version, version), "tar -xzf kafka_2.13-latest.tgz", "echo 'export JMX_PORT=2000'|cat - kafka_2.13-latest/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-latest/bin/kafka-server-start.sh", "echo 'export JMX_PORT=2010'|cat - kafka_2.13-latest/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-latest/bin/kafka-console-consumer.sh", From 76a841c2ba665b07cb2fcc801c210260265a8761 Mon Sep 17 00:00:00 2001 From: lisguo Date: Mon, 2 Dec 2024 14:07:40 -0500 Subject: [PATCH 08/13] Export kafka version in env variable --- test/metric_value_benchmark/jmx_kafka_test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/metric_value_benchmark/jmx_kafka_test.go b/test/metric_value_benchmark/jmx_kafka_test.go index 477a525e3..6b17dd3ea 100644 --- a/test/metric_value_benchmark/jmx_kafka_test.go +++ b/test/metric_value_benchmark/jmx_kafka_test.go @@ -6,7 +6,6 @@ package metric_value_benchmark import ( - "fmt" "log" "time" @@ -54,12 +53,10 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error { return err } - log.Println("get latest kafka version") - version, err := common.RunCommand("curl https://dlcdn.apache.org/kafka/ | grep -oE \"\\d\\.\\d\\.\\d\" | tail -1") - log.Println("set up zookeeper and kafka") startJMXCommands := []string{ - fmt.Sprintf("curl https://dlcdn.apache.org/kafka/%s/kafka_2.13-%s.tgz -o kafka_2.13-latest.tgz", version, version), + "export KAFKA_VERSION=curl https://dlcdn.apache.org/kafka/ | grep -oE '\\d\\.\\d\\.\\d' | tail -1", + "curl https://dlcdn.apache.org/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz -o kafka_2.13-latest.tgz", "tar -xzf kafka_2.13-latest.tgz", "echo 'export JMX_PORT=2000'|cat - kafka_2.13-latest/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-latest/bin/kafka-server-start.sh", "echo 'export JMX_PORT=2010'|cat - kafka_2.13-latest/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-latest/bin/kafka-console-consumer.sh", From 00f20d2cc1fd66fe97f32638930f051ba1a9e7fe Mon Sep 17 00:00:00 2001 From: lisguo Date: Mon, 2 Dec 2024 14:56:53 -0500 Subject: [PATCH 09/13] Use grep -oP to parse regexes on amazon linux machines --- test/metric_value_benchmark/jmx_kafka_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/metric_value_benchmark/jmx_kafka_test.go b/test/metric_value_benchmark/jmx_kafka_test.go index 6b17dd3ea..3e5b22092 100644 --- a/test/metric_value_benchmark/jmx_kafka_test.go +++ b/test/metric_value_benchmark/jmx_kafka_test.go @@ -6,6 +6,7 @@ package metric_value_benchmark import ( + "fmt" "log" "time" @@ -53,10 +54,16 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error { return err } + log.Println("get latest kafka version") + version, err := common.RunCommand("curl https://dlcdn.apache.org/kafka/ | grep -oP \"\\d\\.\\d\\.\\d\" | tail -1") + if err != nil { + return fmt.Errorf("error getting latest kafka version: %v", err) + } + log.Println("set up zookeeper and kafka") startJMXCommands := []string{ "export KAFKA_VERSION=curl https://dlcdn.apache.org/kafka/ | grep -oE '\\d\\.\\d\\.\\d' | tail -1", - "curl https://dlcdn.apache.org/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz -o kafka_2.13-latest.tgz", + fmt.Sprintf("curl https://dlcdn.apache.org/kafka/%s/kafka_2.13-%s.tgz -o kafka_2.13-latest.tgz", version, version), "tar -xzf kafka_2.13-latest.tgz", "echo 'export JMX_PORT=2000'|cat - kafka_2.13-latest/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-latest/bin/kafka-server-start.sh", "echo 'export JMX_PORT=2010'|cat - kafka_2.13-latest/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-latest/bin/kafka-console-consumer.sh", From a3755e4f70f05a9b87c385658c382fced1c72dd4 Mon Sep 17 00:00:00 2001 From: lisguo Date: Mon, 2 Dec 2024 15:06:38 -0500 Subject: [PATCH 10/13] Trim version string --- test/metric_value_benchmark/jmx_kafka_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/metric_value_benchmark/jmx_kafka_test.go b/test/metric_value_benchmark/jmx_kafka_test.go index 3e5b22092..2b8052cc1 100644 --- a/test/metric_value_benchmark/jmx_kafka_test.go +++ b/test/metric_value_benchmark/jmx_kafka_test.go @@ -8,6 +8,7 @@ package metric_value_benchmark import ( "fmt" "log" + "strings" "time" "github.com/aws/amazon-cloudwatch-agent-test/test/metric" @@ -59,10 +60,10 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error { if err != nil { return fmt.Errorf("error getting latest kafka version: %v", err) } + version = strings.TrimSpace(version) log.Println("set up zookeeper and kafka") startJMXCommands := []string{ - "export KAFKA_VERSION=curl https://dlcdn.apache.org/kafka/ | grep -oE '\\d\\.\\d\\.\\d' | tail -1", fmt.Sprintf("curl https://dlcdn.apache.org/kafka/%s/kafka_2.13-%s.tgz -o kafka_2.13-latest.tgz", version, version), "tar -xzf kafka_2.13-latest.tgz", "echo 'export JMX_PORT=2000'|cat - kafka_2.13-latest/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-latest/bin/kafka-server-start.sh", From def27fbbd4bef5c52663af20103126c0e4da6dcf Mon Sep 17 00:00:00 2001 From: lisguo Date: Mon, 2 Dec 2024 15:37:14 -0500 Subject: [PATCH 11/13] Rename root directory for kafka --- test/metric_value_benchmark/jmx_kafka_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/metric_value_benchmark/jmx_kafka_test.go b/test/metric_value_benchmark/jmx_kafka_test.go index 2b8052cc1..20fd8fba9 100644 --- a/test/metric_value_benchmark/jmx_kafka_test.go +++ b/test/metric_value_benchmark/jmx_kafka_test.go @@ -61,11 +61,13 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error { return fmt.Errorf("error getting latest kafka version: %v", err) } version = strings.TrimSpace(version) + kafkaPackageName := fmt.Sprintf("kafka_2.13-%s", version) log.Println("set up zookeeper and kafka") startJMXCommands := []string{ - fmt.Sprintf("curl https://dlcdn.apache.org/kafka/%s/kafka_2.13-%s.tgz -o kafka_2.13-latest.tgz", version, version), - "tar -xzf kafka_2.13-latest.tgz", + fmt.Sprintf("curl https://dlcdn.apache.org/kafka/%s/%s.tgz -o %s.tgz", version, kafkaPackageName, kafkaPackageName), + fmt.Sprintf("tar -xzf %s.tgz", kafkaPackageName), + fmt.Sprintf("sudo mv %s kafka_2.13-latest", kafkaPackageName), "echo 'export JMX_PORT=2000'|cat - kafka_2.13-latest/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-latest/bin/kafka-server-start.sh", "echo 'export JMX_PORT=2010'|cat - kafka_2.13-latest/bin/kafka-console-consumer.sh > /tmp/kafka-console-consumer.sh && mv /tmp/kafka-console-consumer.sh kafka_2.13-latest/bin/kafka-console-consumer.sh", "echo 'export JMX_PORT=2020'|cat - kafka_2.13-latest/bin/kafka-console-producer.sh > /tmp/kafka-console-producer.sh && mv /tmp/kafka-console-producer.sh kafka_2.13-latest/bin/kafka-console-producer.sh", From df9f6dcd897e9b0a7c815ef9b3f52ce8fdad55c8 Mon Sep 17 00:00:00 2001 From: lisguo Date: Mon, 2 Dec 2024 15:49:34 -0500 Subject: [PATCH 12/13] Uncomment test runs --- generator/test_case_generator.go | 346 +++++++++--------- .../metrics_value_benchmark_test.go | 32 +- 2 files changed, 189 insertions(+), 189 deletions(-) diff --git a/generator/test_case_generator.go b/generator/test_case_generator.go index bcff632e0..a811e7c5c 100644 --- a/generator/test_case_generator.go +++ b/generator/test_case_generator.go @@ -56,193 +56,193 @@ const ( // you can't have a const map in golang var testTypeToTestConfig = map[string][]testConfig{ - //"ec2_gpu": { - // {testDir: "./test/nvidia_gpu"}, - //}, + "ec2_gpu": { + {testDir: "./test/nvidia_gpu"}, + }, testTypeKeyEc2Linux: { - //{testDir: "./test/ca_bundle"}, - //{testDir: "./test/cloudwatchlogs"}, - //{ - // testDir: "./test/metrics_number_dimension", - // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - //}, - //{ - // testDir: "./test/emf_concurrent", - // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - // maxAttempts: 1, - //}, + {testDir: "./test/ca_bundle"}, + {testDir: "./test/cloudwatchlogs"}, + { + testDir: "./test/metrics_number_dimension", + targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + }, + { + testDir: "./test/emf_concurrent", + targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + maxAttempts: 1, + }, {testDir: "./test/metric_value_benchmark"}, - //{testDir: "./test/run_as_user"}, - //{testDir: "./test/collection_interval"}, - //{testDir: "./test/metric_dimension"}, - //{testDir: "./test/restart"}, - //{testDir: "./test/xray"}, - //{testDir: "./test/otlp"}, - //{ - // testDir: "./test/acceptance", - // targets: map[string]map[string]struct{}{"os": {"ubuntu-20.04": {}}}, - //}, + {testDir: "./test/run_as_user"}, + {testDir: "./test/collection_interval"}, + {testDir: "./test/metric_dimension"}, + {testDir: "./test/restart"}, + {testDir: "./test/xray"}, + {testDir: "./test/otlp"}, + { + testDir: "./test/acceptance", + targets: map[string]map[string]struct{}{"os": {"ubuntu-20.04": {}}}, + }, // skipping FIPS test as the test cannot be verified // neither ssh nor SSM works after a reboot once FIPS is enabled //{ // testDir: "./test/fips", // targets: map[string]map[string]struct{}{"os": {"rhel8": {}}}, //}, - //{ - // testDir: "./test/lvm", - // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - //}, - //{ - // testDir: "./test/proxy", - // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - //}, - //{ - // testDir: "./test/ssl_cert", - // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - //}, - //{ - // testDir: "./test/userdata", - // terraformDir: "terraform/ec2/userdata", - // targets: map[string]map[string]struct{}{"os": {"ol9": {}}}, - //}, - //{ - // testDir: "./test/assume_role", - // terraformDir: "terraform/ec2/creds", - // targets: map[string]map[string]struct{}{"os": {"al2": {}}}, - //}, - //{ - // testDir: "./test/amp", - // targets: map[string]map[string]struct{}{"os": {"al2": {}}, "arc": {"amd64": {}}}, - //}, - //{ - // testDir: "./test/agent_otel_merging", - // targets: map[string]map[string]struct{}{"os": {"al2": {}}, "arc": {"amd64": {}}}, - //}, + { + testDir: "./test/lvm", + targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + }, + { + testDir: "./test/proxy", + targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + }, + { + testDir: "./test/ssl_cert", + targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + }, + { + testDir: "./test/userdata", + terraformDir: "terraform/ec2/userdata", + targets: map[string]map[string]struct{}{"os": {"ol9": {}}}, + }, + { + testDir: "./test/assume_role", + terraformDir: "terraform/ec2/creds", + targets: map[string]map[string]struct{}{"os": {"al2": {}}}, + }, + { + testDir: "./test/amp", + targets: map[string]map[string]struct{}{"os": {"al2": {}}, "arc": {"amd64": {}}}, + }, + { + testDir: "./test/agent_otel_merging", + targets: map[string]map[string]struct{}{"os": {"al2": {}}, "arc": {"amd64": {}}}, + }, }, /* You can only place 1 mac instance on a dedicate host a single time. Therefore, limit down the scope for testing in Mac since EC2 can be done with Linux and Mac under the hood share similar plugins with Linux */ - //"ec2_mac": { - // {testDir: "../../../test/feature/mac"}, - //}, - //"ec2_windows": { - // {testDir: "../../../test/feature/windows"}, - // {testDir: "../../../test/restart"}, - // {testDir: "../../../test/acceptance"}, - // {testDir: "../../../test/feature/windows/event_logs"}, - // { - // testDir: "../../../test/feature/windows/custom_start/userdata", - // targets: map[string]map[string]struct{}{"os": {"win-2019": {}}}, - // }, - // { - // testDir: "../../../test/feature/windows/custom_start/ssm_start", - // targets: map[string]map[string]struct{}{"os": {"win-2019": {}}}, - // }, - // // assume role test doesn't add much value, and it already being tested with linux - // //{testDir: "../../../test/assume_role"}, - //}, - //"ec2_performance": { - // {testDir: "../../test/performance/emf"}, - // {testDir: "../../test/performance/logs"}, - // {testDir: "../../test/performance/system"}, - // {testDir: "../../test/performance/statsd"}, - // {testDir: "../../test/performance/collectd"}, - // {testDir: "../../test/performance/trace/xray", runMockServer: true}, - //}, - //"ec2_windows_performance": { - // {testDir: "../../test/performance/windows/logs"}, - // {testDir: "../../test/performance/windows/system"}, - //}, - //"ec2_stress": { - // {testDir: "../../test/stress/emf"}, - // {testDir: "../../test/stress/logs"}, - // {testDir: "../../test/stress/system"}, - // {testDir: "../../test/stress/statsd"}, - // {testDir: "../../test/stress/collectd"}, - //}, - //"ec2_windows_stress": { - // {testDir: "../../test/stress/windows/logs"}, - // {testDir: "../../test/stress/windows/system"}, - //}, - //"ecs_fargate": { - // {testDir: "./test/ecs/ecs_metadata"}, - //}, - //"ecs_ec2_daemon": { - // { - // testDir: "./test/metric_value_benchmark", - // targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, - // }, - // { - // testDir: "./test/statsd", - // targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, - // }, - // { - // testDir: "./test/emf", - // targets: map[string]map[string]struct{}{"metadataEnabled": {"disabled": {}}}, - // }, - // { - // testDir: "./test/emf", - // targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, - // }, - //}, - //"eks_addon": { - // { - // testDir: "../../../../test/gpu", - // terraformDir: "terraform/eks/addon/gpu", - // }, - //}, - //"eks_daemon": { - // { - // testDir: "./test/metric_value_benchmark", - // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - // instanceType: "g4dn.xlarge", - // }, - // { - // testDir: "./test/metric_value_benchmark", - // terraformDir: "terraform/eks/daemon/windows/2019", - // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - // }, - // { - // testDir: "./test/metric_value_benchmark", - // terraformDir: "terraform/eks/daemon/windows/2022", - // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - // }, - // { - // testDir: "./test/statsd", terraformDir: "terraform/eks/daemon/statsd", - // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - // }, - // { - // testDir: "./test/emf", terraformDir: "terraform/eks/daemon/emf", - // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - // }, - // { - // testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/d", - // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - // }, - // {testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/bit"}, - // {testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/windows/2022"}, - // { - // testDir: "./test/gpu", terraformDir: "terraform/eks/daemon/gpu", - // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - // }, - // { - // testDir: "./test/awsneuron", terraformDir: "terraform/eks/daemon/awsneuron", - // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - // }, - // { - // testDir: "./test/entity", terraformDir: "terraform/eks/daemon/entity", - // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - // }, - // { - // testDir: "./test/efa", terraformDir: "terraform/eks/daemon/efa", - // targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, - // }, - //}, - //"eks_deployment": { - // {testDir: "./test/metric_value_benchmark"}, - //}, + "ec2_mac": { + {testDir: "../../../test/feature/mac"}, + }, + "ec2_windows": { + {testDir: "../../../test/feature/windows"}, + {testDir: "../../../test/restart"}, + {testDir: "../../../test/acceptance"}, + {testDir: "../../../test/feature/windows/event_logs"}, + { + testDir: "../../../test/feature/windows/custom_start/userdata", + targets: map[string]map[string]struct{}{"os": {"win-2019": {}}}, + }, + { + testDir: "../../../test/feature/windows/custom_start/ssm_start", + targets: map[string]map[string]struct{}{"os": {"win-2019": {}}}, + }, + // assume role test doesn't add much value, and it already being tested with linux + //{testDir: "../../../test/assume_role"}, + }, + "ec2_performance": { + {testDir: "../../test/performance/emf"}, + {testDir: "../../test/performance/logs"}, + {testDir: "../../test/performance/system"}, + {testDir: "../../test/performance/statsd"}, + {testDir: "../../test/performance/collectd"}, + {testDir: "../../test/performance/trace/xray", runMockServer: true}, + }, + "ec2_windows_performance": { + {testDir: "../../test/performance/windows/logs"}, + {testDir: "../../test/performance/windows/system"}, + }, + "ec2_stress": { + {testDir: "../../test/stress/emf"}, + {testDir: "../../test/stress/logs"}, + {testDir: "../../test/stress/system"}, + {testDir: "../../test/stress/statsd"}, + {testDir: "../../test/stress/collectd"}, + }, + "ec2_windows_stress": { + {testDir: "../../test/stress/windows/logs"}, + {testDir: "../../test/stress/windows/system"}, + }, + "ecs_fargate": { + {testDir: "./test/ecs/ecs_metadata"}, + }, + "ecs_ec2_daemon": { + { + testDir: "./test/metric_value_benchmark", + targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, + }, + { + testDir: "./test/statsd", + targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, + }, + { + testDir: "./test/emf", + targets: map[string]map[string]struct{}{"metadataEnabled": {"disabled": {}}}, + }, + { + testDir: "./test/emf", + targets: map[string]map[string]struct{}{"metadataEnabled": {"enabled": {}}}, + }, + }, + "eks_addon": { + { + testDir: "../../../../test/gpu", + terraformDir: "terraform/eks/addon/gpu", + }, + }, + "eks_daemon": { + { + testDir: "./test/metric_value_benchmark", + targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + instanceType: "g4dn.xlarge", + }, + { + testDir: "./test/metric_value_benchmark", + terraformDir: "terraform/eks/daemon/windows/2019", + targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + }, + { + testDir: "./test/metric_value_benchmark", + terraformDir: "terraform/eks/daemon/windows/2022", + targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + }, + { + testDir: "./test/statsd", terraformDir: "terraform/eks/daemon/statsd", + targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + }, + { + testDir: "./test/emf", terraformDir: "terraform/eks/daemon/emf", + targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + }, + { + testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/d", + targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + }, + {testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/bit"}, + {testDir: "./test/fluent", terraformDir: "terraform/eks/daemon/fluent/windows/2022"}, + { + testDir: "./test/gpu", terraformDir: "terraform/eks/daemon/gpu", + targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + }, + { + testDir: "./test/awsneuron", terraformDir: "terraform/eks/daemon/awsneuron", + targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + }, + { + testDir: "./test/entity", terraformDir: "terraform/eks/daemon/entity", + targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + }, + { + testDir: "./test/efa", terraformDir: "terraform/eks/daemon/efa", + targets: map[string]map[string]struct{}{"arc": {"amd64": {}}}, + }, + }, + "eks_deployment": { + {testDir: "./test/metric_value_benchmark"}, + }, } type partition struct { diff --git a/test/metric_value_benchmark/metrics_value_benchmark_test.go b/test/metric_value_benchmark/metrics_value_benchmark_test.go index 0bdad3a3c..ba7e63276 100644 --- a/test/metric_value_benchmark/metrics_value_benchmark_test.go +++ b/test/metric_value_benchmark/metrics_value_benchmark_test.go @@ -98,22 +98,22 @@ func getEc2TestRunners(env *environment.MetaData) []*test_runner.TestRunner { if ec2TestRunners == nil { factory := dimension.GetDimensionFactory(*env) ec2TestRunners = []*test_runner.TestRunner{ - //{TestRunner: &StatsdTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &DiskTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &NetStatTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &PrometheusTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &CPUTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &MemTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &ProcStatTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &DiskIOTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &NetTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &EthtoolTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &EMFTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &SwapTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &ProcessesTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &CollectDTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &RenameSSMTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, - //{TestRunner: &JMXTomcatJVMTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &StatsdTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &DiskTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &NetStatTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &PrometheusTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &CPUTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &MemTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &ProcStatTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &DiskIOTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &NetTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &EthtoolTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &EMFTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &SwapTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &ProcessesTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &CollectDTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &RenameSSMTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, + {TestRunner: &JMXTomcatJVMTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, {TestRunner: &JMXKafkaTestRunner{test_runner.BaseTestRunner{DimensionFactory: factory}}}, } } From 401fd6f535584a7410daa704d14979e222784e91 Mon Sep 17 00:00:00 2001 From: lisguo Date: Mon, 2 Dec 2024 15:51:59 -0500 Subject: [PATCH 13/13] Revert GetAgentRunDuration --- test/metric_value_benchmark/jmx_kafka_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/metric_value_benchmark/jmx_kafka_test.go b/test/metric_value_benchmark/jmx_kafka_test.go index 20fd8fba9..68fd6a689 100644 --- a/test/metric_value_benchmark/jmx_kafka_test.go +++ b/test/metric_value_benchmark/jmx_kafka_test.go @@ -46,7 +46,7 @@ func (t *JMXKafkaTestRunner) GetAgentConfigFileName() string { } func (t *JMXKafkaTestRunner) GetAgentRunDuration() time.Duration { - return 5 * time.Minute + return 2 * time.Minute } func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error {