diff --git a/.github/workflows/integrationTest.yml b/.github/workflows/integrationTest.yml index 42bf29b67b..58a601158a 100644 --- a/.github/workflows/integrationTest.yml +++ b/.github/workflows/integrationTest.yml @@ -81,47 +81,47 @@ jobs: arrays: [ { os: "ubuntu", package: "package-deb", username: "ubuntu", installAgentCommand: "dpkg -i -E ./amazon-cloudwatch-agent.deb", - ami: "cloudwatch-agent-integration-test-ubuntu", caCertPath: "/etc/ssl/certs/ca-certificates.crt", + ami: "cloudwatch-agent-integration-test-ubuntu*", caCertPath: "/etc/ssl/certs/ca-certificates.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.deb" }, { os: "al2", package: "package-rpm", username: "ec2-user", installAgentCommand: "rpm -U ./amazon-cloudwatch-agent.rpm", - ami: "cloudwatch-agent-integration-test-al2", caCertPath: "/etc/ssl/certs/ca-bundle.crt", + ami: "cloudwatch-agent-integration-test-al2*", caCertPath: "/etc/ssl/certs/ca-bundle.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.rpm" }, { os: "rhel8", package: "package-rpm", username: "ec2-user", installAgentCommand: "rpm -U ./amazon-cloudwatch-agent.rpm", - ami: "cloudwatch-agent-integration-test-rhel8", caCertPath: "/etc/ssl/certs/ca-bundle.crt", + ami: "cloudwatch-agent-integration-test-rhel8-base*", caCertPath: "/etc/ssl/certs/ca-bundle.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.rpm" }, { os: "rhel8-1", package: "package-rpm", username: "ec2-user", installAgentCommand: "rpm -U ./amazon-cloudwatch-agent.rpm", - ami: "cloudwatch-agent-integration-test-rhel8-1", caCertPath: "/etc/ssl/certs/ca-bundle.crt", + ami: "cloudwatch-agent-integration-test-rhel8-1*", caCertPath: "/etc/ssl/certs/ca-bundle.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.rpm" }, { os: "rhel8-2", package: "package-rpm", username: "ec2-user", installAgentCommand: "rpm -U ./amazon-cloudwatch-agent.rpm", - ami: "cloudwatch-agent-integration-test-rhel8-2", caCertPath: "/etc/ssl/certs/ca-bundle.crt", + ami: "cloudwatch-agent-integration-test-rhel8-2*", caCertPath: "/etc/ssl/certs/ca-bundle.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.rpm" }, { os: "rhel8-3", package: "package-rpm", username: "ec2-user", installAgentCommand: "rpm -U ./amazon-cloudwatch-agent.rpm", - ami: "cloudwatch-agent-integration-test-rhel8-3", caCertPath: "/etc/ssl/certs/ca-bundle.crt", + ami: "cloudwatch-agent-integration-test-rhel8-3*", caCertPath: "/etc/ssl/certs/ca-bundle.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.rpm" }, { os: "rhel8-4", package: "package-rpm", username: "ec2-user", installAgentCommand: "rpm -U ./amazon-cloudwatch-agent.rpm", - ami: "cloudwatch-agent-integration-test-rhel8-4", caCertPath: "/etc/ssl/certs/ca-bundle.crt", + ami: "cloudwatch-agent-integration-test-rhel8-4*", caCertPath: "/etc/ssl/certs/ca-bundle.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.rpm" }, { os: "ol8-1", package: "package-rpm", username: "ec2-user", installAgentCommand: "rpm -U ./amazon-cloudwatch-agent.rpm", - ami: "cloudwatch-agent-integration-test-ol8-1", caCertPath: "/etc/ssl/certs/ca-bundle.crt", + ami: "cloudwatch-agent-integration-test-ol8-1*", caCertPath: "/etc/ssl/certs/ca-bundle.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.rpm" }, { os: "ol8-2", package: "package-rpm", username: "ec2-user", installAgentCommand: "rpm -U ./amazon-cloudwatch-agent.rpm", - ami: "cloudwatch-agent-integration-test-ol8-2", caCertPath: "/etc/ssl/certs/ca-bundle.crt", + ami: "cloudwatch-agent-integration-test-ol8-2*", caCertPath: "/etc/ssl/certs/ca-bundle.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.rpm" }, { os: "o8-3", package: "package-rpm", username: "ec2-user", installAgentCommand: "rpm -U ./amazon-cloudwatch-agent.rpm", - ami: "cloudwatch-agent-integration-test-ol8-3", caCertPath: "/etc/ssl/certs/ca-bundle.crt", + ami: "cloudwatch-agent-integration-test-ol8-3*", caCertPath: "/etc/ssl/certs/ca-bundle.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.rpm" }, { os: "ol8-4", package: "package-rpm", username: "ec2-user", installAgentCommand: "rpm -U ./amazon-cloudwatch-agent.rpm", - ami: "cloudwatch-agent-integration-test-ol8-4", caCertPath: "/etc/ssl/certs/ca-bundle.crt", + ami: "cloudwatch-agent-integration-test-ol8-4*", caCertPath: "/etc/ssl/certs/ca-bundle.crt", arc: "amd64", binaryName: "amazon-cloudwatch-agent.rpm" } ] steps: diff --git a/integration/terraform/ec2/linux/README.md b/integration/terraform/ec2/linux/README.md index ce8dba6b44..dc8a1eaa24 100644 --- a/integration/terraform/ec2/linux/README.md +++ b/integration/terraform/ec2/linux/README.md @@ -8,6 +8,5 @@ Instance assumptions 4. openssl 5. git 6. make -7. rpm-build (on centos8 based os -rhel8 ol8-) -8. aws-cli -9. CloudWatchAgentServerRole is attached +7. aws-cli +8. CloudWatchAgentServerRole is attached diff --git a/integration/terraform/ec2/linux/centOS8-setup.sh b/integration/terraform/ec2/linux/centOS8-setup.sh deleted file mode 100644 index db86c30da0..0000000000 --- a/integration/terraform/ec2/linux/centOS8-setup.sh +++ /dev/null @@ -1,22 +0,0 @@ -# You can use this script to install all required deps for integration testing to a centos8 based linux (rhel8 ol8) -sudo yum install -y yum-utils -sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo -sudo yum install -y git make rpm-build nano docker-ce docker-ce-cli containerd.io wget -sudo systemctl start docker -# sudo groupadd docker on rhel this is already added -sudo usermod -aG docker $USER -newgrp docker -sudo systemctl enable docker.service -sudo systemctl enable containerd.service -sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -sudo chmod +x /usr/local/bin/docker-compose -sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose -docker-compose --version -wget https://dl.google.com/go/go1.17.linux-amd64.tar.gz -sudo tar -C /usr/local -xzf go1.17.linux-amd64.tar.gz -echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc -source ~/.bashrc -# assume open ssl is installed by default -curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" -unzip awscliv2.zip -sudo ./aws/install diff --git a/integration/test/sanity/resources/verifyLinuxCtlScript.sh b/integration/test/sanity/resources/verifyLinuxCtlScript.sh index 251f70f345..4f2088044e 100755 --- a/integration/test/sanity/resources/verifyLinuxCtlScript.sh +++ b/integration/test/sanity/resources/verifyLinuxCtlScript.sh @@ -38,6 +38,10 @@ assertStatus() { # init step=0 +aoc_user=$(cat /etc/passwd | grep aoc) +if [ "${aoc_user}" = "" ]; then + echo 'aoc:x:995:991:AOC Agent:/home/aoc:/sbin/nologin' | sudo tee -a /etc/passwd +fi /usr/bin/amazon-cloudwatch-agent-ctl -a remove-config -c all -o all /usr/bin/amazon-cloudwatch-agent-ctl -a stop