diff --git a/omnibus/package-scripts/agent-deb/postinst b/omnibus/package-scripts/agent-deb/postinst index 09a1c4a0d6d414..9c193a8c98ac4d 100755 --- a/omnibus/package-scripts/agent-deb/postinst +++ b/omnibus/package-scripts/agent-deb/postinst @@ -187,7 +187,7 @@ else fi if [ -f "$INSTALL_DIR/embedded/bin/python" ]; then - ${INSTALL_DIR}/embedded/bin/python "${INSTALL_DIR}/python-scripts/postinst.py" "${INSTALL_DIR}" || true + ${INSTALL_DIR}/embedded/bin/python "${INSTALL_DIR}/python-scripts/post.py" "${INSTALL_DIR}" || true fi exit 0 diff --git a/omnibus/package-scripts/agent-deb/prerm b/omnibus/package-scripts/agent-deb/prerm index 67c916c335da58..96f10fb205543c 100755 --- a/omnibus/package-scripts/agent-deb/prerm +++ b/omnibus/package-scripts/agent-deb/prerm @@ -156,11 +156,11 @@ remove_remote_config_db() remove_persist_integration_files() { # Remove any file related to reinstalling non-core integrations (see python-scripts/packages.py for the names) - if [ -f "$INSTALL_DIR/.prerm_python_installed_packages.txt" ]; then - rm "$INSTALL_DIR/.prerm_python_installed_packages.txt" || true + if [ -f "$INSTALL_DIR/.pre_python_installed_packages.txt" ]; then + rm "$INSTALL_DIR/.pre_python_installed_packages.txt" || true fi - if [ -f "$INSTALL_DIR/.postinst_python_installed_packages.txt" ]; then - rm "$INSTALL_DIR/.postinst_python_installed_packages.txt" || true + if [ -f "$INSTALL_DIR/.post_python_installed_packages.txt" ]; then + rm "$INSTALL_DIR/.post_python_installed_packages.txt" || true fi if [ -f "$INSTALL_DIR/.diff_python_installed_packages.txt" ]; then rm "$INSTALL_DIR/.diff_python_installed_packages.txt" || true @@ -178,7 +178,7 @@ case "$1" in #this can't be merged with the later case block because running 're upgrade) # We're upgrading. if [ -f "$INSTALL_DIR/embedded/bin/python" ]; then - ${INSTALL_DIR}/embedded/bin/python "${INSTALL_DIR}/python-scripts/prerm.py" "${INSTALL_DIR}" || true + ${INSTALL_DIR}/embedded/bin/python "${INSTALL_DIR}/python-scripts/pre.py" "${INSTALL_DIR}" || true fi ;; *) diff --git a/omnibus/package-scripts/agent-rpm/postinst b/omnibus/package-scripts/agent-rpm/postinst index 64493e95c57d92..baae1a8ed7a7aa 100755 --- a/omnibus/package-scripts/agent-rpm/postinst +++ b/omnibus/package-scripts/agent-rpm/postinst @@ -41,7 +41,7 @@ chown -R root:root ${INSTALL_DIR}/embedded/share/system-probe/ebpf chown -R root:root ${INSTALL_DIR}/embedded/share/system-probe/java if [ -f "$INSTALL_DIR/embedded/bin/python" ]; then - ${INSTALL_DIR}/embedded/bin/python "${INSTALL_DIR}/python-scripts/postinst.py" "${INSTALL_DIR}" || true + ${INSTALL_DIR}/embedded/bin/python "${INSTALL_DIR}/python-scripts/post.py" "${INSTALL_DIR}" || true fi exit 0 diff --git a/omnibus/package-scripts/agent-rpm/preinst b/omnibus/package-scripts/agent-rpm/preinst index 24733dd871353e..428c8b7110e80d 100755 --- a/omnibus/package-scripts/agent-rpm/preinst +++ b/omnibus/package-scripts/agent-rpm/preinst @@ -53,6 +53,24 @@ if ! getent passwd dd-agent >/dev/null; then fi fi + + +if [ -f "$INSTALL_DIR/embedded/bin/python" ]; then + if [ -f "${INSTALL_DIR}/python-scripts/pre.py" ]; then + PRE_PYTHON_FILE="${INSTALL_DIR}/python-scripts/pre.py" + else + # Search for previous version of the python file + if [ -f "${INSTALL_DIR}/python-scripts/prerm.py" ]; then + PRE_PYTHON_FILE="${INSTALL_DIR}/python-scripts/prerm.py" + fi + fi + if [ -n "$PRE_PYTHON_FILE" ]; then + ${INSTALL_DIR}/embedded/bin/python "${PRE_PYTHON_FILE}" "${INSTALL_DIR}" || true + else + echo "[ WARNING ]\tPRE_PYTHON_FILE is not set" + fi +fi + # Starting with 6.10, integrations are also uninstalled on package removal # Since 6.18.0, a file containing all integrations files which have been installed by diff --git a/omnibus/package-scripts/agent-rpm/prerm b/omnibus/package-scripts/agent-rpm/prerm index df2a03b2660474..ca3c836393203b 100755 --- a/omnibus/package-scripts/agent-rpm/prerm +++ b/omnibus/package-scripts/agent-rpm/prerm @@ -140,11 +140,11 @@ remove_remote_config_db() remove_persist_integration_files() { # Remove any file related to reinstalling non-core integrations (see python-scripts/packages.py for the names) - if [ -f "$INSTALL_DIR/.prerm_python_installed_packages.txt" ]; then - rm "$INSTALL_DIR/.prerm_python_installed_packages.txt" || true + if [ -f "$INSTALL_DIR/.pre_python_installed_packages.txt" ]; then + rm "$INSTALL_DIR/.pre_python_installed_packages.txt" || true fi - if [ -f "$INSTALL_DIR/.postinst_python_installed_packages.txt" ]; then - rm "$INSTALL_DIR/.postinst_python_installed_packages.txt" || true + if [ -f "$INSTALL_DIR/.post_python_installed_packages.txt" ]; then + rm "$INSTALL_DIR/.post_python_installed_packages.txt" || true fi if [ -f "$INSTALL_DIR/.diff_python_installed_packages.txt" ]; then rm "$INSTALL_DIR/.diff_python_installed_packages.txt" || true @@ -158,16 +158,6 @@ remove_fips_module() rm -rf "${INSTALL_DIR}/embedded/ssl/fipsmodule.cnf" || true } -case "$*" in - 1) - # We're upgrading. - if [ -f "$INSTALL_DIR/embedded/bin/python" ]; then - ${INSTALL_DIR}/embedded/bin/python "${INSTALL_DIR}/python-scripts/prerm.py" "${INSTALL_DIR}" || true - fi - ;; - *) - ;; -esac stop_agent deregister_agent remove_sysprobe_core_files diff --git a/omnibus/python-scripts/packages.py b/omnibus/python-scripts/packages.py index 655b6bd9cb1f16..21f1a124b3db12 100644 --- a/omnibus/python-scripts/packages.py +++ b/omnibus/python-scripts/packages.py @@ -2,10 +2,12 @@ import pwd import grp import importlib.metadata -import pkg_resources -from packaging import version +import packaging import subprocess +import packaging.requirements +import packaging.version + DO_NOT_REMOVE_WARNING_HEADER = "# DO NOT REMOVE/MODIFY - used internally by installation process\n" def run_command(command): @@ -23,25 +25,28 @@ def run_command(command): def extract_version(specifier): """ - Extract version from the specifier string. + Extract version from the specifier string using packaging. """ try: - # Get the first version specifier from the specifier string - return str(next(iter(pkg_resources.Requirement.parse(f'{specifier}').specifier))) - except Exception: + # Parse the specifier and get the first version from the specifier set + requirement = packaging.requirements.Requirement(specifier) + version = next(iter(requirement.specifier), None) + return str(version) if version else None + except Exception as e: + print(f"Error parsing specifier: {e}") return None -def prerm_python_installed_packages_file(directory): +def pre_python_installed_packages_file(directory): """ - Create prerm installed packages file path. + Create pre installed packages file path. """ - return os.path.join(directory, '.prerm_python_installed_packages.txt') + return os.path.join(directory, '.pre_python_installed_packages.txt') -def postinst_python_installed_packages_file(directory): +def post_python_installed_packages_file(directory): """ - Create postinst installed packages file path. + Create post installed packages file path. """ - return os.path.join(directory, '.postinst_python_installed_packages.txt') + return os.path.join(directory, '.post_python_installed_packages.txt') def diff_python_installed_packages_file(directory): """ @@ -85,7 +90,7 @@ def create_diff_installed_packages_file(directory, old_file, new_file): old_version_str = extract_version(str(old_req_value.specifier)) new_version_str = extract_version(str(new_req_value.specifier)) if old_version_str and new_version_str: - if version.parse(new_version_str) > version.parse(old_version_str): + if packaging.version.parse(new_version_str) > packaging.version.parse(old_version_str): f.write(f"{new_req_value}\n") else: # Package is new in the new file; include it @@ -154,7 +159,11 @@ def load_requirements(filename): else: # Add valid requirement to the list valid_requirements.append(req_stripped) - return {req.name: (req_stripped, req) for req_stripped, req in zip(valid_requirements, pkg_resources.parse_requirements(valid_requirements))} + # Parse valid requirements using packaging + return { + req.name: (req_stripped, req) + for req_stripped, req in zip(valid_requirements, (packaging.requirements.Requirement(r) for r in valid_requirements)) + } def cleanup_files(*files): """ diff --git a/omnibus/python-scripts/postinst.py b/omnibus/python-scripts/post.py similarity index 82% rename from omnibus/python-scripts/postinst.py rename to omnibus/python-scripts/post.py index 3be9bcb9121100..991f4c29b1db31 100644 --- a/omnibus/python-scripts/postinst.py +++ b/omnibus/python-scripts/post.py @@ -3,7 +3,7 @@ Usage: - The script should be run with a single argument specifying the installation directory. -- Example: `python postinst.py /path/to/install/dir` +- Example: `python post.py /path/to/install/dir` """ import os @@ -13,11 +13,11 @@ def main(): try: if len(sys.argv) != 2: - print("Usage: postinst.py ") + print("Usage: post.py ") install_directory = sys.argv[1] if os.path.exists(install_directory): - postinst_python_installed_packages_file = packages.postinst_python_installed_packages_file(install_directory) - packages.create_python_installed_packages_file(postinst_python_installed_packages_file) + post_python_installed_packages_file = packages.post_python_installed_packages_file(install_directory) + packages.create_python_installed_packages_file(post_python_installed_packages_file) flag_path = f"{install_directory}/.install_python_third_party_deps" if os.path.exists(flag_path): print(f"File '{flag_path}' found") diff --git a/omnibus/python-scripts/pre.py b/omnibus/python-scripts/pre.py new file mode 100644 index 00000000000000..3ad13a65ec2dc3 --- /dev/null +++ b/omnibus/python-scripts/pre.py @@ -0,0 +1,33 @@ +""" +This module handles the cleanup of Datadog integrations and Python dependencies during package removal. + +Usage: +- The script should be run with a single argument specifying the installation directory. +- Example: `python pre.py /path/to/install/dir` +""" + +import os +import sys +import packages + +def main(): + try: + if len(sys.argv) != 2: + print("Usage: pre.py ") + install_directory = sys.argv[1] + if os.path.exists(install_directory): + post_python_installed_packages_file = packages.post_python_installed_packages_file(install_directory) + if os.path.exists(post_python_installed_packages_file): + pre_python_installed_packages_file = packages.pre_python_installed_packages_file(install_directory) + packages.create_python_installed_packages_file(pre_python_installed_packages_file) + packages.create_diff_installed_packages_file(install_directory, post_python_installed_packages_file, pre_python_installed_packages_file) + packages.cleanup_files(post_python_installed_packages_file, pre_python_installed_packages_file) + else: + print(f"File {post_python_installed_packages_file} does not exist.") + else: + print(f"Directory {install_directory} does not exist.") + except Exception as e: + print(f"Error: {e}") + +if __name__ == '__main__': + main() diff --git a/omnibus/python-scripts/prerm.py b/omnibus/python-scripts/prerm.py deleted file mode 100644 index a1b35875e5cd31..00000000000000 --- a/omnibus/python-scripts/prerm.py +++ /dev/null @@ -1,33 +0,0 @@ -""" -This module handles the cleanup of Datadog integrations and Python dependencies during package removal. - -Usage: -- The script should be run with a single argument specifying the installation directory. -- Example: `python prerm.py /path/to/install/dir` -""" - -import os -import sys -import packages - -def main(): - try: - if len(sys.argv) != 2: - print("Usage: prerm.py ") - install_directory = sys.argv[1] - if os.path.exists(install_directory): - postinst_python_installed_packages_file = packages.postinst_python_installed_packages_file(install_directory) - if os.path.exists(postinst_python_installed_packages_file): - prerm_python_installed_packages_file = packages.prerm_python_installed_packages_file(install_directory) - packages.create_python_installed_packages_file(prerm_python_installed_packages_file) - packages.create_diff_installed_packages_file(install_directory, postinst_python_installed_packages_file, prerm_python_installed_packages_file) - packages.cleanup_files(postinst_python_installed_packages_file, prerm_python_installed_packages_file) - else: - print(f"File {postinst_python_installed_packages_file} does not exist.") - else: - print(f"Directory {install_directory} does not exist.") - except Exception as e: - print(f"Error: {e}") - -if __name__ == '__main__': - main() diff --git a/releasenotes/notes/fix_rpm_persisting_integrations-81c2b6333b12edb6.yaml b/releasenotes/notes/fix_rpm_persisting_integrations-81c2b6333b12edb6.yaml new file mode 100644 index 00000000000000..59b0d9e7fecb61 --- /dev/null +++ b/releasenotes/notes/fix_rpm_persisting_integrations-81c2b6333b12edb6.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fixed a bug that occurs when reinstalling marketplace/extra integrations for a RPM package after an Agent upgrade. diff --git a/test/new-e2e/tests/agent-platform/persisting-integrations/fixtures/diff.txt b/test/new-e2e/tests/agent-platform/persisting-integrations/fixtures/diff.txt deleted file mode 100644 index d2edc06503e2e9..00000000000000 --- a/test/new-e2e/tests/agent-platform/persisting-integrations/fixtures/diff.txt +++ /dev/null @@ -1,4 +0,0 @@ -# DO NOT REMOVE/MODIFY - used internally by installation process -grpcio==1.66.2 -pynvml==11.5.3 -datadog-nvml==1.0.0 diff --git a/test/new-e2e/tests/agent-platform/persisting-integrations/fixtures/postinst.txt b/test/new-e2e/tests/agent-platform/persisting-integrations/fixtures/postinst.txt deleted file mode 100644 index 1988ed67b7721b..00000000000000 --- a/test/new-e2e/tests/agent-platform/persisting-integrations/fixtures/postinst.txt +++ /dev/null @@ -1,336 +0,0 @@ -# DO NOT REMOVE/MODIFY - used internally by installation process -PyMySQL==1.1.1 -datadog-kube-controller-manager==5.1.1 -datadog-avi-vantage==4.2.2 -pydantic==2.8.2 -datadog-vsphere==8.0.0 -cm-client==45.0.4 -requests==2.32.3 -datadog-ambari==4.2.1 -envier==0.5.2 -ddtrace==2.10.6 -datadog-marklogic==4.2.1 -pathspec==0.12.1 -s3transfer==0.10.2 -datadog-supervisord==2.6.0 -jsonpatch==1.33 -datadog-teradata==2.2.1 -packaging==24.1 -foundationdb==6.3.24 -datadog-elastic==6.3.1 -datadog-nfsstat==1.13.0 -datadog-palo-alto-panorama==1.0.0 -datadog-impala==2.2.2 -datadog-argo-workflows==1.0.2 -aerospike==7.1.1 -datadog-crio==2.6.1 -datadog-sonarqube==3.2.2 -datadog-nagios==1.13.0 -datadog-kube-apiserver-metrics==4.3.1 -dogpile.cache==1.3.3 -datadog-cockroachdb==3.3.2 -datadog-directory==2.1.1 -dnspython==2.6.1 -lz4==4.3.3 -datadog-hive==1.10.0 -datadog-ping-federate==1.0.0 -datadog-singlestore==2.2.1 -service-identity==24.1.0 -setuptools==74.1.2 -datadog-aerospike==2.2.2 -datadog-apache==4.5.1 -datadog-cloud-foundry-api==3.3.1 -confluent-kafka==2.5.0 -filelock==3.16.0 -azure-identity==1.17.1 -datadog-argocd==2.4.3 -datadog-openstack-controller==6.9.0 -kubernetes==30.1.0 -datadog-activemq-xml==3.2.1 -os-service-types==1.7.0 -datadog-couchbase==3.2.1 -grpcio==1.66.2 -gssapi==1.8.3 -pysnmp==5.1.0 -redis==5.0.8 -psutil==5.9.6 -clickhouse-driver==0.2.9 -datadog-azure-iot-edge==4.2.1 -pysnmpcrypto==0.0.4 -datadog-tibco-ems==1.0.0 -datadog-cisco-aci==2.12.0 -datadog-kube-metrics-server==3.3.1 -datadog-checks-base==37.0.0 -six==1.16.0 -datadog-squid==2.5.1 -datadog-citrix-hypervisor==3.2.1 -datadog-varnish==2.1.0 -datadog-strimzi==2.2.2 -supervisor==4.2.5 -datadog-twistlock==3.6.1 -datadog-presto==2.8.0 -PyNaCl==1.5.0 -datadog-yarn==5.3.1 -datadog-consul==2.6.1 -datadog-ossec-security==1.0.0 -datadog-riakcs==2.12.0 -datadog-fly-io==1.0.1 -datadog-kyverno==1.0.2 -ddsketch==3.0.1 -datadog-marathon==2.3.1 -vertica-python==1.4.0 -soupsieve==2.6 -securesystemslib==0.28.0 -python-binary-memcached==0.31.2 -datadog-ecs-fargate==4.3.1 -datadog-vault==4.2.1 -datadog-pgbouncer==6.2.0 -PyJWT==2.9.0 -datadog-ray==1.2.2 -datadog-nvidia-triton==1.2.2 -datadog-system-swap==1.19.0 -msal==1.31.0 -Deprecated==1.2.14 -openstacksdk==3.3.0 -python3-gearman==0.1.0 -sortedcontainers==2.4.0 -portalocker==2.10.1 -datadog-hdfs-datanode==4.2.1 -datadog-arangodb==2.2.2 -datadog-kong==3.2.2 -datadog-mapreduce==4.2.1 -datadog-traffic-server==2.2.1 -datadog-kubernetes-cluster-autoscaler==1.0.1 -datadog-linkerd==4.2.2 -datadog-vertica==4.6.0 -datadog-karpenter==1.6.0 -datadog-eks-fargate==4.2.1 -datadog-prometheus==3.6.0 -datadog-openldap==1.12.0 -typing_extensions==4.12.2 -datadog-haproxy==5.2.2 -datadog-nginx==6.3.1 -binary==1.0.0 -cryptography==43.0.0 -datadog-teleport==1.1.0 -datadog-spark==4.3.1 -in-toto==2.0.0 -datadog-dns-check==3.3.0 -datadog-hazelcast==4.1.0 -datadog-go-expvar==2.5.1 -psycopg2-binary==2.9.9 -datadog-pulsar==2.2.2 -datadog-mesos-master==3.3.1 -paramiko==3.4.1 -datadog-ibm-db2==2.2.0 -ply==3.11 -rsa==4.9 -urllib3==2.2.3 -pyasn1==0.4.8 -idna==3.8 -datadog-kubelet==7.13.2 -datadog-snowflake==5.9.0 -datadog-istio==6.1.2 -websocket-client==1.8.0 -datadog-glusterfs==1.8.0 -pbr==6.1.0 -datadog-tomcat==2.0.0 -datadog-flink==1.5.0 -datadog-harbor==3.2.2 -cattrs==24.1.1 -Pympler==0.7 -datadog-btrfs==2.4.0 -opentelemetry-api==1.27.0 -pyOpenSSL==24.2.1 -datadog-calico==2.2.2 -uptime==3.0.1 -datadog-riak==3.5.1 -tzlocal==5.2 -datadog-twemproxy==1.15.0 -beautifulsoup4==4.12.3 -datadog-external-dns==3.2.1 -datadog-hdfs-namenode==4.2.1 -datadog-kube-proxy==6.3.1 -annotated-types==0.7.0 -datadog-openstack==2.0.0 -requests-oauthlib==2.0.0 -pynvml==11.5.3 -datadog-cilium==3.6.0 -datadog-weaviate==2.3.3 -pyspnego==0.11.1 -hazelcast-python-client==5.4.0 -datadog-envoy==3.6.0 -datadog-fluxcd==1.2.2 -datadog-weblogic==1.3.0 -datadog-scylla==2.7.2 -datadog-sidekiq==1.4.0 -pycparser==2.22 -datadog-zeek==1.0.0 -datadog-cassandra-nodetool==1.13.0 -charset-normalizer==3.3.2 -datadog-proxysql==5.1.1 -datadog-gunicorn==2.8.0 -tuf==4.0.0 -datadog-php-fpm==3.3.1 -datadog-jboss-wildfly==2.2.0 -datadog-tekton==1.0.2 -datadog-hivemq==1.8.0 -datadog-activemq==3.1.0 -requests_ntlm==1.3.0 -datadog-statsd==1.12.0 -datadog-sqlserver==17.5.3 -datadog-kubevirt-api==0.0.1 -pyvmomi==8.0.3.0.1 -jellyfish==1.1.0 -datadog-confluent-platform==1.10.2 -datadog-ceph==2.10.0 -wrapt==1.16.0 -zipp==3.20.2 -datadog-ibm-i==2.2.0 -boto3==1.35.10 -cffi==1.17.1 -google-auth==2.34.0 -bytecode==0.15.1 -stevedore==5.3.0 -datadog-tcp-check==4.9.0 -pydantic_core==2.20.1 -netifaces==0.11.0 -datadog-rethinkdb==3.1.0 -datadog-kube-scheduler==4.10.1 -datadog-snmp==7.5.0 -datadog-kube-dns==4.4.1 -prometheus_client==0.20.0 -datadog-kubevirt-handler==0.0.1 -datadog-vllm==1.0.0 -datadog-openmetrics==4.2.2 -datadog-boundary==2.2.3 -datadog-sap-hana==3.3.0 -datadog-oracle==5.2.0 -datadog-airflow==5.0.1 -datadog-lighttpd==3.5.1 -datadog-gitlab==7.3.2 -pysmi==1.2.1 -requests-kerberos==0.15.0 -datadog-fluentd==3.2.1 -datadog-dcgm==2.3.2 -ldap3==2.9.1 -datadog-mcache==4.1.0 -pymongo==4.8.0 -datadog-suricata==1.0.0 -datadog-mapr==1.11.0 -datadog-http-check==9.9.0 -datadog-nginx-ingress-controller==2.6.1 -datadog-hudi==2.3.0 -datadog-cloudera==2.2.0 -krb5==0.6.0 -datadog-amazon-msk==4.11.0 -datadog-rabbitmq==5.3.2 -datadog-kafka-consumer==4.6.1 -importlib_metadata==8.4.0 -datadog-kafka==2.16.0 -datadog-network==3.4.0 -datadog-aws-neuron==1.0.0 -datadog-mesos-slave==3.3.1 -datadog-cacti==2.1.1 -orjson==3.10.7 -azure-core==1.31.0 -datadog-redisdb==5.7.0 -datadog-clickhouse==3.7.0 -datadog-ignite==2.4.0 -datadog-datadog-cluster-agent==3.2.0 -datadog-mysql==12.8.0 -attrs==24.2.0 -datadog-druid==2.5.1 -pyodbc==5.1.0 -datadog-torchserve==2.2.2 -datadog-traefik-mesh==1.0.1 -mmh3==4.1.0 -bcrypt==4.2.0 -lxml==4.9.4 -protobuf==5.27.3 -oauthlib==3.2.2 -keystoneauth1==5.8.0 -pysnmp-mibs==0.1.6 -semver==3.0.2 -botocore==1.35.10 -msal-extensions==1.2.0 -datadog-voltdb==3.2.1 -datadog-etcd==6.2.2 -jmespath==1.0.1 -datadog-kubeflow==0.0.1 -PyYAML==6.0.2 -pyasn1_modules==0.4.1 -datadog-process==3.5.0 -datadog-cisco-secure-firewall==1.0.0 -datadog-solr==1.13.0 -datadog-tenable==1.5.0 -datadog-esxi==1.2.0 -datadog-journald==1.2.0 -datadog-pan-firewall==1.2.0 -datadog-cert-manager==4.1.2 -datadog-kubevirt-controller==0.0.1 -datadog-tls==2.20.0 -jsonpointer==3.0.0 -aws-requests-auth==0.4.3 -datadog-teamcity==4.3.1 -simplejson==3.19.3 -datadog-checks-downloader==4.7.0 -datadog-kyototycoon==2.5.1 -datadog-powerdns-recursor==2.5.1 -datadog-cassandra==1.18.0 -uhashring==2.3 -datadog-coredns==3.2.3 -datadog-disk==5.4.0 -datadog-ibm-was==3.3.2 -datadog-couch==6.2.1 -snowflake-connector-python==3.12.1 -python-dateutil==2.9.0.post0 -asn1crypto==1.5.1 -datadog-checkpoint-quantum-firewall==1.0.0 -iso8601==2.1.0 -certifi==2024.8.30 -datadog-temporal==2.3.0 -datadog-mongo==6.11.0 -datadog-argo-rollouts==1.0.2 -datadog-foundationdb==1.4.0 -datadog-gitlab-runner==4.2.1 -platformdirs==4.3.2 -datadog-linux-proc-extras==2.5.0 -decorator==5.1.1 -xmltodict==0.13.0 -datadog-system-core==2.5.0 -tomlkit==0.13.2 -datadog-gearmand==3.1.0 -datadog-silk==2.2.1 -datadog-zk==4.5.0 -pip==23.3.1 -rethinkdb==2.4.9 -pytz==2024.2 -cachetools==5.5.0 -clickhouse-cityhash==1.0.2.4 -datadog-appgate-sdp==0.0.1 -datadog-ssh-check==2.10.0 -requestsexceptions==1.4.0 -PySocks==1.7.1 -pycryptodomex==3.20.0 -requests-unixsocket2==0.4.2 -datadog-postgres==20.0.0 -datadog-postfix==1.14.0 -datadog-kubernetes-state==8.1.1 -requests-toolbelt==1.0.0 -platformdirs==4.2.2 -packaging==24.1 -zipp==3.19.2 -tomli==2.0.1 -jaraco.text==3.12.1 -typeguard==4.3.0 -typing_extensions==4.12.2 -wheel==0.43.0 -jaraco.functools==4.0.1 -autocommand==2.2.2 -importlib_resources==6.4.0 -importlib_metadata==8.0.0 -inflect==7.3.1 -more-itertools==10.3.0 -backports.tarfile==1.2.0 -jaraco.context==5.3.0 diff --git a/test/new-e2e/tests/agent-platform/persisting-integrations/fixtures/requirements.txt b/test/new-e2e/tests/agent-platform/persisting-integrations/fixtures/requirements.txt deleted file mode 100644 index e8ebbe8ad06f33..00000000000000 --- a/test/new-e2e/tests/agent-platform/persisting-integrations/fixtures/requirements.txt +++ /dev/null @@ -1,201 +0,0 @@ -# DO NOT PASS THIS TO PIP DIRECTLY -# THIS FILE IS AUTO-GENERATED, DO NOT EDIT BY HAND ---no-index -datadog-active-directory==2.1.1; sys_platform == 'win32' -datadog-activemq-xml==3.2.1 -datadog-activemq==3.1.0 -datadog-aerospike==2.2.2; sys_platform == 'linux2' -datadog-airflow==5.0.1 -datadog-amazon-msk==4.11.0 -datadog-ambari==4.2.1; sys_platform != 'win32' -datadog-apache==4.5.1 -datadog-arangodb==2.2.2 -datadog-argo-rollouts==1.0.2 -datadog-argo-workflows==1.0.2 -datadog-argocd==2.4.3 -datadog-aspdotnet==2.1.1; sys_platform == 'win32' -datadog-avi-vantage==4.2.2 -datadog-aws-neuron==1.0.0 -datadog-azure-iot-edge==4.2.1 -datadog-boundary==2.2.3 -datadog-btrfs==2.4.0; sys_platform != 'win32' -datadog-cacti==2.1.1; sys_platform == 'linux2' -datadog-calico==2.2.2 -datadog-cassandra-nodetool==1.13.0 -datadog-cassandra==1.18.0 -datadog-ceph==2.10.0; sys_platform != 'win32' -datadog-cert-manager==4.1.2 -datadog-checkpoint-quantum-firewall==1.0.0 -datadog-checks-base==37.0.0 -datadog-checks-dependency-provider==1.4.0 -datadog-checks-downloader==4.7.0 -datadog-cilium==3.6.0 -datadog-cisco-aci==2.12.0 -datadog-cisco-secure-firewall==1.0.0 -datadog-citrix-hypervisor==3.2.1 -datadog-clickhouse==3.7.0 -datadog-cloud-foundry-api==3.3.1 -datadog-cloudera==2.2.0 -datadog-cockroachdb==3.3.2 -datadog-confluent-platform==1.10.2 -datadog-consul==2.6.1 -datadog-coredns==3.2.3; sys_platform == 'linux2' -datadog-couch==6.2.1 -datadog-couchbase==3.2.1 -datadog-crio==2.6.1 -datadog-datadog-cluster-agent==3.2.0 -datadog-dcgm==2.3.2 -datadog-directory==2.1.1 -datadog-disk==5.4.0 -datadog-dns-check==3.3.0 -datadog-dotnetclr==2.1.1; sys_platform == 'win32' -datadog-druid==2.5.1 -datadog-ecs-fargate==4.3.1 -datadog-eks-fargate==4.2.1 -datadog-elastic==6.3.1 -datadog-envoy==3.6.0 -datadog-esxi==1.2.0 -datadog-etcd==6.2.2 -datadog-exchange-server==2.1.1; sys_platform == 'win32' -datadog-external-dns==3.2.1 -datadog-flink==1.5.0 -datadog-fluentd==3.2.1 -datadog-fluxcd==1.2.2 -datadog-fly-io==1.0.1 -datadog-foundationdb==1.4.0 -datadog-gearmand==3.1.0; sys_platform != 'win32' -datadog-gitlab-runner==4.2.1 -datadog-gitlab==7.3.2 -datadog-glusterfs==1.8.0; sys_platform == 'linux2' -datadog-go-expvar==2.5.1 -datadog-gunicorn==2.8.0; sys_platform != 'win32' -datadog-haproxy==5.2.2 -datadog-harbor==3.2.2 -datadog-hazelcast==4.1.0 -datadog-hdfs-datanode==4.2.1; sys_platform != 'win32' -datadog-hdfs-namenode==4.2.1; sys_platform != 'win32' -datadog-hive==1.10.0 -datadog-hivemq==1.8.0 -datadog-http-check==9.9.0 -datadog-hudi==2.3.0 -datadog-hyperv==1.11.1; sys_platform == 'win32' -datadog-ibm-ace==2.2.2 -datadog-ibm-db2==2.2.0 -datadog-ibm-i==2.2.0; sys_platform != 'win32' -datadog-ibm-mq==6.4.0 -datadog-ibm-was==3.3.2 -datadog-ignite==2.4.0 -datadog-iis==3.1.1; sys_platform == 'win32' -datadog-impala==2.2.2 -datadog-istio==6.1.2 -datadog-jboss-wildfly==2.2.0 -datadog-journald==1.2.0 -datadog-kafka-consumer==4.6.1 -datadog-kafka==2.16.0 -datadog-karpenter==1.6.0 -datadog-kong==3.2.2 -datadog-kube-apiserver-metrics==4.3.1 -datadog-kube-controller-manager==5.1.1 -datadog-kube-dns==4.4.1 -datadog-kube-metrics-server==3.3.1 -datadog-kube-proxy==6.3.1 -datadog-kube-scheduler==4.10.1 -datadog-kubelet==7.13.2 -datadog-kubernetes-cluster-autoscaler==1.0.1 -datadog-kubernetes-state==8.1.1 -datadog-kyototycoon==2.5.1 -datadog-kyverno==1.0.2 -datadog-lighttpd==3.5.1 -datadog-linkerd==4.2.2 -datadog-linux-proc-extras==2.5.0; sys_platform == 'linux2' -datadog-mapr==1.11.0; sys_platform == 'linux2' -datadog-mapreduce==4.2.1 -datadog-marathon==2.3.1; sys_platform != 'win32' -datadog-marklogic==4.2.1 -datadog-mcache==4.1.0; sys_platform != 'win32' -datadog-mesos-master==3.3.1; sys_platform != 'win32' -datadog-mesos-slave==3.3.1; sys_platform != 'win32' -datadog-mongo==6.11.0 -datadog-mysql==12.8.0 -datadog-nagios==1.13.0 -datadog-network==3.4.0 -datadog-nfsstat==1.13.0; sys_platform == 'linux2' -datadog-nginx-ingress-controller==2.6.1 -datadog-nginx==6.3.1 -datadog-nvidia-triton==1.2.2 -datadog-openldap==1.12.0 -datadog-openmetrics==4.2.2 -datadog-openstack-controller==6.9.0 -datadog-openstack==2.0.0 -datadog-oracle==5.2.0 -datadog-ossec-security==1.0.0 -datadog-palo-alto-panorama==1.0.0 -datadog-pan-firewall==1.2.0 -datadog-pdh-check==2.1.0; sys_platform == 'win32' -datadog-pgbouncer==6.2.0; sys_platform != 'win32' -datadog-php-fpm==3.3.1 -datadog-ping-federate==1.0.0 -datadog-postfix==1.14.0; sys_platform != 'win32' -datadog-postgres==20.0.0 -datadog-powerdns-recursor==2.5.1 -datadog-presto==2.8.0 -datadog-process==3.5.0 -datadog-prometheus==3.6.0 -datadog-proxysql==5.1.1 -datadog-pulsar==2.2.2 -datadog-rabbitmq==5.3.2 -datadog-ray==1.2.2 -datadog-redisdb==5.7.0 -datadog-rethinkdb==3.1.0 -datadog-riak==3.5.1 -datadog-riakcs==2.12.0 -datadog-sap-hana==3.3.0 -datadog-scylla==2.7.2 -datadog-sidekiq==1.4.0 -datadog-silk==2.2.1 -datadog-singlestore==2.2.1 -datadog-snmp==7.5.0 -datadog-snowflake==5.9.0 -datadog-solr==1.13.0 -datadog-sonarqube==3.2.2 -datadog-spark==4.3.1 -datadog-sqlserver==17.5.3 -datadog-squid==2.5.1 -datadog-ssh-check==2.10.0 -datadog-statsd==1.12.0 -datadog-strimzi==2.2.2 -datadog-supervisord==2.6.0 -datadog-suricata==1.0.0 -datadog-system-core==2.5.0 -datadog-system-swap==1.19.0 -datadog-tcp-check==4.9.0 -datadog-teamcity==4.3.1 -datadog-tekton==1.0.2 -datadog-teleport==1.1.0 -datadog-temporal==2.3.0 -datadog-tenable==1.5.0 -datadog-teradata==2.2.1; sys_platform != 'darwin' -datadog-tibco-ems==1.0.0 -datadog-tls==2.20.0 -datadog-tokumx==3.2.0 -datadog-tomcat==2.0.0 -datadog-torchserve==2.2.2 -datadog-traefik-mesh==1.0.1 -datadog-traffic-server==2.2.1 -datadog-twemproxy==1.15.0 -datadog-twistlock==3.6.1 -datadog-varnish==2.1.0 -datadog-vault==4.2.1 -datadog-vertica==4.6.0 -datadog-vllm==1.0.0 -datadog-voltdb==3.2.1 -datadog-vsphere==8.0.0 -datadog-weaviate==2.3.3 -datadog-weblogic==1.3.0 -datadog-win32-event-log==3.3.0; sys_platform == 'win32' -datadog-windows-performance-counters==2.1.1; sys_platform == 'win32' -datadog-windows-service==4.9.1; sys_platform == 'win32' -datadog-wmi-check==1.18.0; sys_platform == 'win32' -datadog-yarn==5.3.1 -datadog-zeek==1.0.0; sys_platform != 'win32' -datadog-zk==4.5.0; sys_platform != 'win32' diff --git a/test/new-e2e/tests/agent-platform/persisting-integrations/persisting_integrations_test.go b/test/new-e2e/tests/agent-platform/persisting-integrations/persisting_integrations_test.go index 39fd4e5327ef10..59468c3efa826a 100644 --- a/test/new-e2e/tests/agent-platform/persisting-integrations/persisting_integrations_test.go +++ b/test/new-e2e/tests/agent-platform/persisting-integrations/persisting_integrations_test.go @@ -31,20 +31,6 @@ import ( "github.com/stretchr/testify/require" ) -// TODO: This is a temporary workaround to test the upgrade of the persisting integrations -// Since we need the previous agent version to have produced these files -// We will mock these files for now since this is the first release that will generate them -// Once we have a release that generates these files we can remove this workaround and stop mocking these files - -//go:embed fixtures/diff.txt -var diffPythonInstalledPackages string - -//go:embed fixtures/postinst.txt -var postinstPythonInstalledPackages string - -//go:embed fixtures/requirements.txt -var requirementsAgentRelease string - var ( osVersion = flag.String("osversion", "", "os version to test") platform = flag.String("platform", "", "platform to test") @@ -53,12 +39,6 @@ var ( srcAgentVersion = flag.String("src-agent-version", "7", "start agent version") ) -var filesToMock = map[string]string{ - "/opt/datadog-agent/.diff_python_installed_packages.txt": diffPythonInstalledPackages, - "/opt/datadog-agent/.postinst_python_installed_packages.txt": postinstPythonInstalledPackages, - "/opt/datadog-agent/requirements-agent-release.txt": requirementsAgentRelease, -} - type persistingIntegrationsSuite struct { e2e.BaseSuite[environments.Host] srcVersion string @@ -135,7 +115,6 @@ func (is *persistingIntegrationsSuite) TestIntegrationPersistsWithFileFlag() { startAgentVersion := is.SetupAgentStartVersion(VMclient) is.InstallNVMLIntegration(VMclient) - is.PrepareMockedFiles(VMclient) // set the flag to install third party deps is.EnableInstallThirdPartyDepsFlag(VMclient) @@ -150,7 +129,6 @@ func (is *persistingIntegrationsSuite) TestIntegrationDoesNotPersistWithoutFileF startAgentVersion := is.SetupAgentStartVersion(VMclient) is.InstallNVMLIntegration(VMclient) - is.PrepareMockedFiles(VMclient) // unset the flag to install third party deps if it was set VMclient.Host.Execute("sudo rm -f /opt/datadog-agent/.install_python_third_party_deps") @@ -169,12 +147,6 @@ func (is *persistingIntegrationsSuite) SetupTestClient() *common.TestClient { return VMclient } -func (is *persistingIntegrationsSuite) PrepareMockedFiles(VMclient *common.TestClient) { - for file, content := range filesToMock { - VMclient.Host.MustExecute(fmt.Sprintf("sudo bash -c \"echo '%s' > %s\"", content, file)) - } -} - func (is *persistingIntegrationsSuite) InstallNVMLIntegration(VMclient *common.TestClient) { // Make sure that the integration is not installed freezeRequirement := VMclient.AgentClient.Integration(agentclient.WithArgs([]string{"freeze"}))