Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sonobuoy-config:
plugin-name: azure-arc-ci-conformance
result-format: junit
spec:
image: mcr.microsoft.com/azuremonitor/containerinsights/cidev:ciconftest08142021
image: mcr.microsoft.com/azuremonitor/containerinsights/cidev:ciconftest10202021
imagePullPolicy: Always
name: plugin
resources: {}
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/src/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@

TIMEOUT = 300

# omsagent main container name
OMSAGENT_MAIN_CONTAINER_NAME = 'omsagent'

# WAIT TIME BEFORE READING THE AGENT LOGS
AGENT_WAIT_TIME_SECS = "180"
# Azure Monitor for Container Extension related
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/src/common/kubernetes_pod_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def get_pod_list(api_instance, namespace, label_selector=""):
pytest.fail("Error occurred when retrieving pod information: " + str(e))

# get the content of the log file in the container via exec
def get_log_file_content(api_instance, namespace, podName, logfilePath):
def get_log_file_content(api_instance, namespace, podName, containerName, logfilePath):
try:
exec_command = ['tar','cf', '-', logfilePath]
return stream(api_instance.connect_get_namespaced_pod_exec, podName, namespace, command=exec_command, stderr=True, stdin=False, stdout=True, tty=False)
return stream(api_instance.connect_get_namespaced_pod_exec, podName, namespace, command=exec_command, container=containerName, stderr=True, stdin=False, stdout=True, tty=False)
except Exception as e:
pytest.fail("Error occurred when retrieving log file content: " + str(e))
pytest.fail("Error occurred when retrieving log file content: " + str(e))

# Function that watches events corresponding to pods in the given namespace and passes the events to a callback function
def watch_pod_status(api_instance, namespace, timeout, callback=None):
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/src/core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 |
&& helm version

RUN apt-get update && apt-get -y upgrade && \
apt-get -f -y install curl apt-transport-https lsb-release gnupg python3-pip python-pip && \
apt-get -f -y install curl apt-transport-https lsb-release gnupg python3-pip && \
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg && \
CLI_REPO=$(lsb_release -cs) && \
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ ${CLI_REPO} main" \
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/src/tests/test_ds_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_ds_workflows(env_dict):
for podItem in pod_list.items:
podName = podItem.metadata.name
logcontent = get_log_file_content(
api_instance, constants.AGENT_RESOURCES_NAMESPACE, podName, agentLogPath)
api_instance, constants.AGENT_RESOURCES_NAMESPACE, podName, constants.OMSAGENT_MAIN_CONTAINER_NAME, agentLogPath)
if not logcontent:
pytest.fail("logcontent should not be null or empty for pod: " + podName)
loglines = logcontent.split("\n")
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/src/tests/test_resource_status.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
import constants
import time

from kubernetes import client, config
from results_utility import append_result_output
Expand All @@ -21,6 +22,9 @@ def test_resource_status(env_dict):
except Exception as e:
pytest.fail("Error loading the in-cluster config: " + str(e))

waitTimeSeconds = env_dict['AGENT_WAIT_TIME_SECS']
time.sleep(int(waitTimeSeconds))

# checking the deployment status
check_kubernetes_deployment_status(
constants.AGENT_RESOURCES_NAMESPACE, constants.AGENT_DEPLOYMENT_NAME, env_dict['TEST_AGENT_LOG_FILE'])
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/src/tests/test_rs_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,15 @@ def test_rs_workflows(env_dict):


waitTimeSeconds = env_dict['AGENT_WAIT_TIME_SECS']
print("start: waiting for seconds: {} for agent workflows to get emitted".format(waitTimeSeconds))
time.sleep(int(waitTimeSeconds))
print("complete: waiting for seconds: {} for agent workflows to get emitted".format(waitTimeSeconds))

isOMSBaseAgent = env_dict.get('USING_OMSAGENT_BASE_AGENT')
agentLogPath = constants.AGENT_FLUENTD_LOG_PATH
if isOMSBaseAgent:
agentLogPath = constants.AGENT_OMSAGENT_LOG_PATH

logcontent = get_log_file_content(
api_instance, constants.AGENT_RESOURCES_NAMESPACE, rspodName, agentLogPath)
api_instance, constants.AGENT_RESOURCES_NAMESPACE, rspodName, constants.OMSAGENT_MAIN_CONTAINER_NAME, agentLogPath)
if not logcontent:
pytest.fail("logcontent should not be null or empty for rs pod: {}".format(rspodName))
loglines = logcontent.split("\n")
Expand Down