Skip to content

Commit

Permalink
Merge branch 'develop' into enable-rhel
Browse files Browse the repository at this point in the history
  • Loading branch information
nagworld9 authored Oct 3, 2023
2 parents 9e93cfc + 791b8db commit c65d86a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion azurelinuxagent/ga/agent_update_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def __update_last_attempt_update_times(self):
else:
self.update_state.last_attempted_normal_update_time = now
self.update_state.last_attempted_hotfix_update_time = now
self.update_state.last_attempted_manifest_download_time = now

def __should_agent_attempt_manifest_download(self):
"""
Expand All @@ -103,6 +102,7 @@ def __should_agent_attempt_manifest_download(self):

if next_attempt_time > now:
return False
self.update_state.last_attempted_manifest_download_time = now
return True

@staticmethod
Expand Down
4 changes: 4 additions & 0 deletions azurelinuxagent/ga/extensionprocessutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ def _check_noexec():
"""
Check if /var is mounted with the noexec flag.
"""
# W0603: Using the global statement (global-statement)
# OK to disable; _COLLECT_NOEXEC_ERRORS is used only within _check_noexec, but needs to persist across calls.
global _COLLECT_NOEXEC_ERRORS # pylint: disable=W0603

try:
agent_dir = conf.get_lib_dir()
with open('/proc/mounts', 'r') as f:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def run(self):
# implementation may be broken prior to Python 3.7 wher the functionality
# will be removed from Python 3
requires = [] # pylint: disable=invalid-name
if float(sys.version[:3]) >= 3.7:
if sys.version_info[0] >= 3 and sys.version_info[1] >= 7:
requires = ['distro'] # pylint: disable=invalid-name

modules = [] # pylint: disable=invalid-name
Expand Down
30 changes: 10 additions & 20 deletions tests_e2e/orchestrator/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# docker run --rm -it -v /home/nam/src/WALinuxAgent:/home/waagent/WALinuxAgent waagenttests bash --login
#
FROM ubuntu:latest
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0
LABEL description="Test environment for WALinuxAgent"

SHELL ["/bin/bash", "-c"]
Expand All @@ -18,24 +18,23 @@ SHELL ["/bin/bash", "-c"]
USER root

RUN \
apt-get update && \
\
tdnf -y update && \
# mariner packages can be found in this repository https://cvedashboard.azurewebsites.net/#/packages \
# \
# Install basic dependencies \
# \
apt-get install -y git python3.10 python3.10-dev wget bzip2 && \
ln /usr/bin/python3.10 /usr/bin/python3 && \
tdnf -y install git python3 python3-devel wget bzip2 ca-certificates && \
\
# \
# Install LISA dependencies \
# \
apt-get install -y git gcc libgirepository1.0-dev libcairo2-dev qemu-utils libvirt-dev \
python3-pip python3-venv && \
tdnf install -y git gcc gobject-introspection-devel cairo-devel pkg-config python3-devel libvirt-devel \
cairo-gobject binutils kernel-headers glibc-devel python3-pip python3-virtualenv && \
\
# \
# Install test dependencies \
# \
apt-get install -y zip && \
tdnf -y install zip tar && \
\
# \
# Create user waagent, which is used to execute the tests \
Expand All @@ -46,17 +45,8 @@ RUN \
# \
# Install the Azure CLI \
# \
apt-get install ca-certificates curl apt-transport-https lsb-release gnupg && \
mkdir -p /etc/apt/keyrings && \
curl -sLS https://packages.microsoft.com/keys/microsoft.asc \
| gpg --dearmor \
| tee /etc/apt/keyrings/microsoft.gpg > /dev/null && \
chmod go+r /etc/apt/keyrings/microsoft.gpg && \
AZ_REPO=$(lsb_release -cs) && \
echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" \
| tee /etc/apt/sources.list.d/azure-cli.list && \
apt-get update && \
apt-get install azure-cli && \
tdnf -y install azure-cli && \
tdnf clean all && \
:

#
Expand All @@ -77,7 +67,7 @@ RUN \
cd $HOME && \
git clone https://github.com/microsoft/lisa.git && \
cd lisa && \
git checkout a030c5e6a0695db77dbf5bd52a45d07cbbf00087 && \
git checkout 7396cbd6d9b31a99b13c184f735ce9827334f21b && \
\
python3 -m pip install --upgrade pip && \
python3 -m pip install --editable .[azure,libvirt] --config-settings editable_mode=compat && \
Expand Down
2 changes: 1 addition & 1 deletion tests_e2e/pipeline/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pool:

jobs:
- job: "ExecuteTests"
timeoutInMinutes: 90

steps:
- task: UsePythonVersion@0
Expand Down Expand Up @@ -107,7 +108,6 @@ jobs:
- bash: $(Build.SourcesDirectory)/tests_e2e/pipeline/scripts/execute_tests.sh
displayName: "Execute tests"
continueOnError: true
timeoutInMinutes: 90
env:
SUBSCRIPTION_ID: $(SUBSCRIPTION-ID)
AZURE_CLIENT_ID: $(AZURE-CLIENT-ID)
Expand Down

0 comments on commit c65d86a

Please sign in to comment.