From cf82da62121dd44642f0c667e83e8e8904d358af Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Mon, 9 Sep 2024 14:37:31 -0700 Subject: [PATCH 1/7] Upgrade Package tdnf to Version 3.5.8 --- SPECS/tdnf/tdnf.signatures.json | 2 +- SPECS/tdnf/tdnf.spec | 7 +++++-- cgmanifest.json | 4 ++-- .../manifests/package/pkggen_core_aarch64.txt | 8 ++++---- .../manifests/package/pkggen_core_x86_64.txt | 8 ++++---- .../manifests/package/toolchain_aarch64.txt | 16 ++++++++-------- .../manifests/package/toolchain_x86_64.txt | 16 ++++++++-------- 7 files changed, 32 insertions(+), 29 deletions(-) diff --git a/SPECS/tdnf/tdnf.signatures.json b/SPECS/tdnf/tdnf.signatures.json index 348099056da..37d19afd1fa 100644 --- a/SPECS/tdnf/tdnf.signatures.json +++ b/SPECS/tdnf/tdnf.signatures.json @@ -3,7 +3,7 @@ "cache-updateinfo": "3e2157658b163a4b0558faaaf08e9fbca3d3e031fd294136de4ad39d61d232c3", "cache-updateinfo.service": "2a033533bbb280c61c4f850701f6df1f6e9fde1c7d8132acf03279844cc3bbba", "cache-updateinfo.timer": "7339fd7be53c57b9bbc000b27026d507e3d2d70958a2db7d1799f5960e3904ee", - "tdnf-3.5.6.tar.gz": "69c31fbaab3ce9a88a4b925afb95b5cf71147f84808100b830890ae54c6d424a", + "tdnf-3.5.8.tar.gz": "", "tdnfrepogpgcheck.conf": "84c1c0c956a492cadbfd2cec581ef678c190e3e245f0d61665eb0f66b8b34fd6" } } diff --git a/SPECS/tdnf/tdnf.spec b/SPECS/tdnf/tdnf.spec index b16ba2a02a7..0dcd965d53b 100644 --- a/SPECS/tdnf/tdnf.spec +++ b/SPECS/tdnf/tdnf.spec @@ -4,8 +4,8 @@ Summary: dnf equivalent using C libs Name: tdnf -Version: 3.5.6 -Release: 2%{?dist} +Version: 3.5.8 +Release: 1%{?dist} License: LGPLv2.1 AND GPLv2 Vendor: Microsoft Corporation Distribution: Azure Linux @@ -219,6 +219,9 @@ fi /%{_lib}/systemd/system/tdnf* %changelog +* Mon Sep 09 2024 Sam Meluch - 3.5.8-1 +- Minor upgrade to tdnf + * Fri Jul 26 2024 Sam Meluch - 3.5.6-2 - Add tdnf virtual repo snapshots diff --git a/cgmanifest.json b/cgmanifest.json index bc6270d28d5..e2445a3d51a 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -28426,8 +28426,8 @@ "type": "other", "other": { "name": "tdnf", - "version": "3.5.6", - "downloadUrl": "https://github.com/vmware/tdnf/archive/v3.5.6.tar.gz" + "version": "3.5.8", + "downloadUrl": "https://github.com/vmware/tdnf/archive/v3.5.8.tar.gz" } } }, diff --git a/toolkit/resources/manifests/package/pkggen_core_aarch64.txt b/toolkit/resources/manifests/package/pkggen_core_aarch64.txt index 1b6af4aff99..9255468aaa4 100644 --- a/toolkit/resources/manifests/package/pkggen_core_aarch64.txt +++ b/toolkit/resources/manifests/package/pkggen_core_aarch64.txt @@ -211,10 +211,10 @@ lua-5.4.6-1.azl3.aarch64.rpm lua-libs-5.4.6-1.azl3.aarch64.rpm azurelinux-rpm-macros-3.0-7.azl3.noarch.rpm azurelinux-check-macros-3.0-7.azl3.noarch.rpm -tdnf-3.5.6-2.azl3.aarch64.rpm -tdnf-cli-libs-3.5.6-2.azl3.aarch64.rpm -tdnf-devel-3.5.6-2.azl3.aarch64.rpm -tdnf-plugin-repogpgcheck-3.5.6-2.azl3.aarch64.rpm +tdnf-3.5.8-1.azl3.aarch64.rpm +tdnf-cli-libs-3.5.8-1.azl3.aarch64.rpm +tdnf-devel-3.5.8-1.azl3.aarch64.rpm +tdnf-plugin-repogpgcheck-3.5.8-1.azl3.aarch64.rpm libassuan-2.5.6-1.azl3.aarch64.rpm libassuan-devel-2.5.6-1.azl3.aarch64.rpm libgpg-error-1.47-1.azl3.aarch64.rpm diff --git a/toolkit/resources/manifests/package/pkggen_core_x86_64.txt b/toolkit/resources/manifests/package/pkggen_core_x86_64.txt index f334bf075c2..7d786207034 100644 --- a/toolkit/resources/manifests/package/pkggen_core_x86_64.txt +++ b/toolkit/resources/manifests/package/pkggen_core_x86_64.txt @@ -211,10 +211,10 @@ lua-5.4.6-1.azl3.x86_64.rpm lua-libs-5.4.6-1.azl3.x86_64.rpm azurelinux-rpm-macros-3.0-7.azl3.noarch.rpm azurelinux-check-macros-3.0-7.azl3.noarch.rpm -tdnf-3.5.6-2.azl3.x86_64.rpm -tdnf-cli-libs-3.5.6-2.azl3.x86_64.rpm -tdnf-devel-3.5.6-2.azl3.x86_64.rpm -tdnf-plugin-repogpgcheck-3.5.6-2.azl3.x86_64.rpm +tdnf-3.5.8-1.azl3.x86_64.rpm +tdnf-cli-libs-3.5.8-1.azl3.x86_64.rpm +tdnf-devel-3.5.8-1.azl3.x86_64.rpm +tdnf-plugin-repogpgcheck-3.5.8-1.azl3.x86_64.rpm libassuan-2.5.6-1.azl3.x86_64.rpm libassuan-devel-2.5.6-1.azl3.x86_64.rpm libgpg-error-1.47-1.azl3.x86_64.rpm diff --git a/toolkit/resources/manifests/package/toolchain_aarch64.txt b/toolkit/resources/manifests/package/toolchain_aarch64.txt index 3a82f48c6a5..ff2f66f8526 100644 --- a/toolkit/resources/manifests/package/toolchain_aarch64.txt +++ b/toolkit/resources/manifests/package/toolchain_aarch64.txt @@ -584,14 +584,14 @@ systemd-bootstrap-libs-250.3-17.azl3.aarch64.rpm systemd-bootstrap-rpm-macros-250.3-17.azl3.noarch.rpm tar-1.35-1.azl3.aarch64.rpm tar-debuginfo-1.35-1.azl3.aarch64.rpm -tdnf-3.5.6-2.azl3.aarch64.rpm -tdnf-autoupdate-3.5.6-2.azl3.aarch64.rpm -tdnf-cli-libs-3.5.6-2.azl3.aarch64.rpm -tdnf-debuginfo-3.5.6-2.azl3.aarch64.rpm -tdnf-devel-3.5.6-2.azl3.aarch64.rpm -tdnf-plugin-metalink-3.5.6-2.azl3.aarch64.rpm -tdnf-plugin-repogpgcheck-3.5.6-2.azl3.aarch64.rpm -tdnf-python-3.5.6-2.azl3.aarch64.rpm +tdnf-3.5.8-1.azl3.aarch64.rpm +tdnf-autoupdate-3.5.8-1.azl3.aarch64.rpm +tdnf-cli-libs-3.5.8-1.azl3.aarch64.rpm +tdnf-debuginfo-3.5.8-1.azl3.aarch64.rpm +tdnf-devel-3.5.8-1.azl3.aarch64.rpm +tdnf-plugin-metalink-3.5.8-1.azl3.aarch64.rpm +tdnf-plugin-repogpgcheck-3.5.8-1.azl3.aarch64.rpm +tdnf-python-3.5.8-1.azl3.aarch64.rpm texinfo-7.0.3-1.azl3.aarch64.rpm texinfo-debuginfo-7.0.3-1.azl3.aarch64.rpm unzip-6.0-20.azl3.aarch64.rpm diff --git a/toolkit/resources/manifests/package/toolchain_x86_64.txt b/toolkit/resources/manifests/package/toolchain_x86_64.txt index 7918f08de29..57503a55ce4 100644 --- a/toolkit/resources/manifests/package/toolchain_x86_64.txt +++ b/toolkit/resources/manifests/package/toolchain_x86_64.txt @@ -590,14 +590,14 @@ systemd-bootstrap-libs-250.3-17.azl3.x86_64.rpm systemd-bootstrap-rpm-macros-250.3-17.azl3.noarch.rpm tar-1.35-1.azl3.x86_64.rpm tar-debuginfo-1.35-1.azl3.x86_64.rpm -tdnf-3.5.6-2.azl3.x86_64.rpm -tdnf-autoupdate-3.5.6-2.azl3.x86_64.rpm -tdnf-cli-libs-3.5.6-2.azl3.x86_64.rpm -tdnf-debuginfo-3.5.6-2.azl3.x86_64.rpm -tdnf-devel-3.5.6-2.azl3.x86_64.rpm -tdnf-plugin-metalink-3.5.6-2.azl3.x86_64.rpm -tdnf-plugin-repogpgcheck-3.5.6-2.azl3.x86_64.rpm -tdnf-python-3.5.6-2.azl3.x86_64.rpm +tdnf-3.5.8-1.azl3.x86_64.rpm +tdnf-autoupdate-3.5.8-1.azl3.x86_64.rpm +tdnf-cli-libs-3.5.8-1.azl3.x86_64.rpm +tdnf-debuginfo-3.5.8-1.azl3.x86_64.rpm +tdnf-devel-3.5.8-1.azl3.x86_64.rpm +tdnf-plugin-metalink-3.5.8-1.azl3.x86_64.rpm +tdnf-plugin-repogpgcheck-3.5.8-1.azl3.x86_64.rpm +tdnf-python-3.5.8-1.azl3.x86_64.rpm texinfo-7.0.3-1.azl3.x86_64.rpm texinfo-debuginfo-7.0.3-1.azl3.x86_64.rpm unzip-6.0-20.azl3.x86_64.rpm From 3983a89e8cc891b5ce32f40300bc625c64ca981a Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Tue, 10 Sep 2024 12:47:50 -0700 Subject: [PATCH 2/7] add signature to tdnf tarball --- SPECS/tdnf/tdnf.signatures.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPECS/tdnf/tdnf.signatures.json b/SPECS/tdnf/tdnf.signatures.json index 37d19afd1fa..44ac8126bca 100644 --- a/SPECS/tdnf/tdnf.signatures.json +++ b/SPECS/tdnf/tdnf.signatures.json @@ -3,7 +3,7 @@ "cache-updateinfo": "3e2157658b163a4b0558faaaf08e9fbca3d3e031fd294136de4ad39d61d232c3", "cache-updateinfo.service": "2a033533bbb280c61c4f850701f6df1f6e9fde1c7d8132acf03279844cc3bbba", "cache-updateinfo.timer": "7339fd7be53c57b9bbc000b27026d507e3d2d70958a2db7d1799f5960e3904ee", - "tdnf-3.5.8.tar.gz": "", + "tdnf-3.5.8.tar.gz": "c4bae9432f7e3441318aba7d4588528f419b384c23d526e77f794a2812aa2b10", "tdnfrepogpgcheck.conf": "84c1c0c956a492cadbfd2cec581ef678c190e3e245f0d61665eb0f66b8b34fd6" } } From a234b8c9630dedcfd52439362b32d3a672d4bfe4 Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Tue, 10 Sep 2024 14:13:26 -0700 Subject: [PATCH 3/7] remove tdnf skip --- toolkit/resources/manifests/package/macros.override | 1 - 1 file changed, 1 deletion(-) diff --git a/toolkit/resources/manifests/package/macros.override b/toolkit/resources/manifests/package/macros.override index 2ace0848885..0f7a0df28a7 100644 --- a/toolkit/resources/manifests/package/macros.override +++ b/toolkit/resources/manifests/package/macros.override @@ -14,7 +14,6 @@ # Check hangs %skip_check_gtk_doc 1 -%skip_check_tdnf 1 %skip_check_vim 1 # We are missing many of the dependency packages for the Dracut tests From ac4a489cd7ef55da55aba1a401aebf3e6f455d59 Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Mon, 16 Sep 2024 18:45:19 -0700 Subject: [PATCH 4/7] upgrade tdnf and fix ptests --- SPECS/tdnf/fix-tests-for-azl.patch | 157 +++++++++++++++++++++++++++++ SPECS/tdnf/tdnf.spec | 33 ++++-- 2 files changed, 181 insertions(+), 9 deletions(-) create mode 100644 SPECS/tdnf/fix-tests-for-azl.patch diff --git a/SPECS/tdnf/fix-tests-for-azl.patch b/SPECS/tdnf/fix-tests-for-azl.patch new file mode 100644 index 00000000000..bc848dee64c --- /dev/null +++ b/SPECS/tdnf/fix-tests-for-azl.patch @@ -0,0 +1,157 @@ +From 767337327c8987b776d5667ebb0751b10f9acc3f Mon Sep 17 00:00:00 2001 +From: Sam Meluch +Date: Wed, 11 Sep 2024 16:24:05 -0700 +Subject: [PATCH] fix tests for azl + +--- + pytests/repo/setup-repo.sh | 16 ++++++++-------- + pytests/tests/test_cache.py | 3 ++- + pytests/tests/test_priority.py | 2 +- + pytests/tests/test_signature.py | 7 ++++++- + pytests/tests/test_srpms.py | 2 +- + 5 files changed, 18 insertions(+), 12 deletions(-) + +diff --git a/pytests/repo/setup-repo.sh b/pytests/repo/setup-repo.sh +index a19bd20..8b54881 100755 +--- a/pytests/repo/setup-repo.sh ++++ b/pytests/repo/setup-repo.sh +@@ -65,8 +65,8 @@ mkdir -p -m 755 ${BUILD_PATH}/BUILD \ + cat << EOF > ${TEST_REPO_DIR}/gpgkeydata + %echo Generating a key for repogpgcheck signatures + %no-protection +- Key-Type: default +- Subkey-Type: default ++ Key-Type: RSA ++ Subkey-Type: RSA + Name-Real: tdnf test + Name-Comment: tdnf test key + Name-Email: tdnftest@tdnf.test +@@ -107,9 +107,9 @@ cp -r ${BUILD_PATH}/RPMS ${PUBLISH_SHA512_PATH} + mkdir -p ${PUBLISH_PATH}/keys + gpg --armor --export tdnftest@tdnf.test > ${PUBLISH_PATH}/keys/pubkey.asc + +-createrepo ${PUBLISH_PATH} +-createrepo ${PUBLISH_SRC_PATH} +-createrepo -s sha512 ${PUBLISH_SHA512_PATH} ++createrepo --compatibility ${PUBLISH_PATH} ++createrepo --compatibility ${PUBLISH_SRC_PATH} ++createrepo --compatibility -s sha512 ${PUBLISH_SHA512_PATH} + + modifyrepo ${REPO_SRC_DIR}/updateinfo-1.xml ${PUBLISH_PATH}/repodata + check_err "Failed to modify repo with updateinfo-1.xml." +@@ -127,7 +127,7 @@ cat << EOF > ${TEST_REPO_DIR}/yum.repos.d/photon-test.repo + name=basic + baseurl=http://localhost:8080/photon-test + #metalink=http://localhost:8080/photon-test/metalink +-gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY ++gpgkey=file:///etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY + gpgcheck=0 + enabled=1 + EOF +@@ -137,7 +137,7 @@ cat << EOF > ${TEST_REPO_DIR}/yum.repos.d/photon-test-sha512.repo + name=basic + baseurl=http://localhost:8080/photon-test-sha512 + #metalink=http://localhost:8080/photon-test-sha512/metalink +-gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY ++gpgkey=file:///etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY + gpgcheck=0 + enabled=0 + EOF +@@ -146,7 +146,7 @@ cat << EOF > ${TEST_REPO_DIR}/yum.repos.d/photon-test-src.repo + [photon-test-src] + name=basic + baseurl=http://localhost:8080/photon-test-src +-gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY ++gpgkey=file:///etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY + gpgcheck=0 + enabled=0 + EOF +diff --git a/pytests/tests/test_cache.py b/pytests/tests/test_cache.py +index 2621b59..c01df02 100644 +--- a/pytests/tests/test_cache.py ++++ b/pytests/tests/test_cache.py +@@ -189,6 +189,7 @@ def test_download_vs_cache_size_multiple_packages(utils): + @pytest.mark.skipif(try_mount_small_cache() != 0, reason="Failed to mount small cache directory.") + def test_cache_directory_out_of_disk_space(utils): + small_cache_path = utils.config['small_cache_path'] ++ orig_cache_path = utils.tdnf_config.get('main', 'cachedir') + switch_cache_path(utils, small_cache_path) + enable_cache(utils) + clean_small_cache(utils) +@@ -200,7 +201,7 @@ def test_cache_directory_out_of_disk_space(utils): + run_args.append(pkgname) + ret = utils.run(run_args) + +- switch_cache_path(utils, utils.tdnf_config.get('main', 'cachedir')) ++ switch_cache_path(utils, orig_cache_path) + clean_cache(utils) + clean_small_cache(utils) + assert ret['retval'] == 1036 +diff --git a/pytests/tests/test_priority.py b/pytests/tests/test_priority.py +index a3e7913..0412f45 100644 +--- a/pytests/tests/test_priority.py ++++ b/pytests/tests/test_priority.py +@@ -42,7 +42,7 @@ def test_priority(utils): + ) + assert ret['retval'] == 0 + +- ret = utils.run(["createrepo", "."], cwd=REPODIR) ++ ret = utils.run(["createrepo", "--compatibility", "."], cwd=REPODIR) + assert ret['retval'] == 0 + + filename = os.path.join(utils.config['repo_path'], "yum.repos.d", REPOFILENAME) +diff --git a/pytests/tests/test_signature.py b/pytests/tests/test_signature.py +index f2f6f06..e4fa72f 100644 +--- a/pytests/tests/test_signature.py ++++ b/pytests/tests/test_signature.py +@@ -12,7 +12,7 @@ DIST = os.environ.get('DIST') + if DIST == 'fedora': + DEFAULT_KEY = 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-34-primary' + else: +- DEFAULT_KEY = 'file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY' ++ DEFAULT_KEY = 'file:///etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY' + + + @pytest.fixture(scope='function', autouse=True) +@@ -66,6 +66,7 @@ def test_install_local_key(utils): + set_gpgcheck(utils, True) + keypath = os.path.join(utils.config['repo_path'], 'photon-test', 'keys', 'pubkey.asc') + set_repo_key(utils, 'file://{}'.format(keypath)) ++ utils.run(['rpm', '--import', keypath]) + pkgname = utils.config["sglversion_pkgname"] + ret = utils.run(['tdnf', 'install', '-y', pkgname]) + assert ret['retval'] == 0 +@@ -76,6 +77,8 @@ def test_install_local_key(utils): + def test_install_remote_key(utils): + set_gpgcheck(utils, True) + set_repo_key(utils, 'http://localhost:8080/photon-test/keys/pubkey.asc') ++ keypath = os.path.join(utils.config['repo_path'], 'photon-test', 'keys', 'pubkey.asc') ++ utils.run(['rpm', '--import', keypath]) + pkgname = utils.config["sglversion_pkgname"] + ret = utils.run(['tdnf', 'install', '-y', pkgname]) + assert ret['retval'] == 0 +@@ -86,6 +89,8 @@ def test_install_remote_key(utils): + def test_install_remote_key_verbose(utils): + set_gpgcheck(utils, True) + set_repo_key(utils, 'http://localhost:8080/photon-test/keys/pubkey.asc') ++ keypath = os.path.join(utils.config['repo_path'], 'photon-test', 'keys', 'pubkey.asc') ++ utils.run(['rpm', '--import', keypath]) + pkgname = utils.config["sglversion_pkgname"] + ret = utils.run(['tdnf', 'install', '-v', '-y', pkgname]) + assert ret['retval'] == 0 +diff --git a/pytests/tests/test_srpms.py b/pytests/tests/test_srpms.py +index 8279721..ee7bed0 100644 +--- a/pytests/tests/test_srpms.py ++++ b/pytests/tests/test_srpms.py +@@ -19,7 +19,7 @@ DIST = os.environ.get('DIST') + if DIST == 'fedora': + RPMBUILD_DIR = '/root/rpmbuild' + else: +- RPMBUILD_DIR = '/usr/src/photon' ++ RPMBUILD_DIR = '/usr/src/azl' + + + @pytest.fixture(scope='function', autouse=True) +-- +2.34.1 + diff --git a/SPECS/tdnf/tdnf.spec b/SPECS/tdnf/tdnf.spec index 0dcd965d53b..3dac8cd0031 100644 --- a/SPECS/tdnf/tdnf.spec +++ b/SPECS/tdnf/tdnf.spec @@ -1,4 +1,3 @@ -%undefine __cmake_in_source_build %define _tdnfpluginsdir %{_libdir}/tdnf-plugins %define _tdnf_history_db_dir %{_libdir}/sysimage/tdnf @@ -28,6 +27,7 @@ Patch4: tdnf-sqlite-library.patch # Patch in vitual snapshot Patch5: virtual-repo-snapshot.patch +Patch6: fix-tests-for-azl.patch #Cmake requires binutils BuildRequires: binutils @@ -56,12 +56,20 @@ Requires: tdnf-cli-libs = %{version}-%{release} Requires: zlib Obsoletes: yum %if 0%{?with_check} +BuildRequires: azurelinux-release BuildRequires: createrepo_c BuildRequires: glib +BuildRequires: e2fsprogs +BuildRequires: findutils BuildRequires: libxml2 BuildRequires: python3-pip BuildRequires: python3-requests BuildRequires: python3-xml +BuildRequires: sed +BuildRequires: shadow-utils +BuildRequires: sudo +BuildRequires: util-linux +BuildRequires: which %endif %description @@ -121,23 +129,30 @@ systemd services for periodic automatic update %autosetup -p1 %build +%if 0%{?with_check} +# remove problematic test file when running tests from within the rpm build directory +rm pytests/tests/test_srpms.py +%endif + +mkdir -p build && cd build %cmake \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \ - -DHISTORY_DB_DIR=%{_tdnf_history_db_dir} + -DHISTORY_DB_DIR=%{_tdnf_history_db_dir} \ + .. -%cmake_build - -cd %{__cmake_builddir} +%make_build %make_build python %check -pip3 install pytest requests pyOpenSSL -cd build && make %{?_smp_mflags} check +pip3 install pytest pyOpenSSL flake8 +cd build && %make_build check %install -%cmake_install +pushd build +%make_install +popd find %{buildroot} -name '*.a' -delete -print mkdir -p %{buildroot}%{_var}/cache/tdnf mkdir -p %{buildroot}%{_tdnf_history_db_dir} @@ -151,7 +166,7 @@ rm -rf %{buildroot}%{_datadir}/tdnf mkdir -p %{buildroot}%{_sysconfdir}/%{name}/protected.d -pushd %{__cmake_builddir}/python +pushd build/python %py3_install popd find %{buildroot} -name '*.pyc' -delete From d7921db047548eef957faf830f8b247d66790b85 Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Tue, 17 Sep 2024 16:29:20 -0700 Subject: [PATCH 5/7] fix tab/spaces, lock dep versions for check section --- SPECS/tdnf/tdnf.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPECS/tdnf/tdnf.spec b/SPECS/tdnf/tdnf.spec index 3dac8cd0031..01c63f06e99 100644 --- a/SPECS/tdnf/tdnf.spec +++ b/SPECS/tdnf/tdnf.spec @@ -140,13 +140,13 @@ mkdir -p build && cd build -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \ -DHISTORY_DB_DIR=%{_tdnf_history_db_dir} \ - .. + .. %make_build %make_build python %check -pip3 install pytest pyOpenSSL flake8 +pip3 install 'pytest==8.3.3' 'pyOpenSSL==24.2.1' 'flake8==7.1.1' cd build && %make_build check %install From e618dcc20f3557530f8ef50f575bc9bbf46cce57 Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Wed, 18 Sep 2024 11:10:25 -0700 Subject: [PATCH 6/7] implement pr feedback --- SPECS/tdnf/fix-tests-for-azl.patch | 40 ++++++------------------------ SPECS/tdnf/tdnf.spec | 13 ++++++---- 2 files changed, 15 insertions(+), 38 deletions(-) diff --git a/SPECS/tdnf/fix-tests-for-azl.patch b/SPECS/tdnf/fix-tests-for-azl.patch index bc848dee64c..94b8e2412d0 100644 --- a/SPECS/tdnf/fix-tests-for-azl.patch +++ b/SPECS/tdnf/fix-tests-for-azl.patch @@ -1,18 +1,19 @@ -From 767337327c8987b776d5667ebb0751b10f9acc3f Mon Sep 17 00:00:00 2001 +From 7933b78c793d687d4d25d68a9fdb9a858f9cf637 Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Wed, 11 Sep 2024 16:24:05 -0700 Subject: [PATCH] fix tests for azl +adjust keys --- - pytests/repo/setup-repo.sh | 16 ++++++++-------- + pytests/repo/setup-repo.sh | 12 ++++++------ pytests/tests/test_cache.py | 3 ++- pytests/tests/test_priority.py | 2 +- - pytests/tests/test_signature.py | 7 ++++++- + pytests/tests/test_signature.py | 5 +++++ pytests/tests/test_srpms.py | 2 +- - 5 files changed, 18 insertions(+), 12 deletions(-) + 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pytests/repo/setup-repo.sh b/pytests/repo/setup-repo.sh -index a19bd20..8b54881 100755 +index a19bd20..ea015b7 100755 --- a/pytests/repo/setup-repo.sh +++ b/pytests/repo/setup-repo.sh @@ -65,8 +65,8 @@ mkdir -p -m 755 ${BUILD_PATH}/BUILD \ @@ -39,24 +40,6 @@ index a19bd20..8b54881 100755 modifyrepo ${REPO_SRC_DIR}/updateinfo-1.xml ${PUBLISH_PATH}/repodata check_err "Failed to modify repo with updateinfo-1.xml." -@@ -127,7 +127,7 @@ cat << EOF > ${TEST_REPO_DIR}/yum.repos.d/photon-test.repo - name=basic - baseurl=http://localhost:8080/photon-test - #metalink=http://localhost:8080/photon-test/metalink --gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY -+gpgkey=file:///etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY - gpgcheck=0 - enabled=1 - EOF -@@ -137,7 +137,7 @@ cat << EOF > ${TEST_REPO_DIR}/yum.repos.d/photon-test-sha512.repo - name=basic - baseurl=http://localhost:8080/photon-test-sha512 - #metalink=http://localhost:8080/photon-test-sha512/metalink --gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY -+gpgkey=file:///etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY - gpgcheck=0 - enabled=0 - EOF @@ -146,7 +146,7 @@ cat << EOF > ${TEST_REPO_DIR}/yum.repos.d/photon-test-src.repo [photon-test-src] name=basic @@ -101,18 +84,9 @@ index a3e7913..0412f45 100644 filename = os.path.join(utils.config['repo_path'], "yum.repos.d", REPOFILENAME) diff --git a/pytests/tests/test_signature.py b/pytests/tests/test_signature.py -index f2f6f06..e4fa72f 100644 +index f2f6f06..3aea87b 100644 --- a/pytests/tests/test_signature.py +++ b/pytests/tests/test_signature.py -@@ -12,7 +12,7 @@ DIST = os.environ.get('DIST') - if DIST == 'fedora': - DEFAULT_KEY = 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-34-primary' - else: -- DEFAULT_KEY = 'file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY' -+ DEFAULT_KEY = 'file:///etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY' - - - @pytest.fixture(scope='function', autouse=True) @@ -66,6 +66,7 @@ def test_install_local_key(utils): set_gpgcheck(utils, True) keypath = os.path.join(utils.config['repo_path'], 'photon-test', 'keys', 'pubkey.asc') diff --git a/SPECS/tdnf/tdnf.spec b/SPECS/tdnf/tdnf.spec index 01c63f06e99..d272580a05d 100644 --- a/SPECS/tdnf/tdnf.spec +++ b/SPECS/tdnf/tdnf.spec @@ -129,11 +129,6 @@ systemd services for periodic automatic update %autosetup -p1 %build -%if 0%{?with_check} -# remove problematic test file when running tests from within the rpm build directory -rm pytests/tests/test_srpms.py -%endif - mkdir -p build && cd build %cmake \ -DCMAKE_BUILD_TYPE=Debug \ @@ -146,6 +141,14 @@ mkdir -p build && cd build %make_build python %check +# remove test files with dependencies on state and cleanup of rpm build directory +# these are problematic when running tests from within the rpm build directory +rm pytests/tests/test_srpms.py +rm build/pytests/tests/test_srpms.py + +# link MS key as expected VMWare Key in test files +ln -sf /etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY /etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY + pip3 install 'pytest==8.3.3' 'pyOpenSSL==24.2.1' 'flake8==7.1.1' cd build && %make_build check From 828478b3a89675f8ecf145ac3004aa919a866302 Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Wed, 18 Sep 2024 11:15:10 -0700 Subject: [PATCH 7/7] fix last MICROSOFT key reference in patch --- SPECS/tdnf/fix-tests-for-azl.patch | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/SPECS/tdnf/fix-tests-for-azl.patch b/SPECS/tdnf/fix-tests-for-azl.patch index 94b8e2412d0..bd3c6e7731f 100644 --- a/SPECS/tdnf/fix-tests-for-azl.patch +++ b/SPECS/tdnf/fix-tests-for-azl.patch @@ -1,19 +1,18 @@ -From 7933b78c793d687d4d25d68a9fdb9a858f9cf637 Mon Sep 17 00:00:00 2001 +From 39fed1f3b309e4aa088fedbb9174a4ec7327dfa3 Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Wed, 11 Sep 2024 16:24:05 -0700 Subject: [PATCH] fix tests for azl -adjust keys --- - pytests/repo/setup-repo.sh | 12 ++++++------ + pytests/repo/setup-repo.sh | 10 +++++----- pytests/tests/test_cache.py | 3 ++- pytests/tests/test_priority.py | 2 +- pytests/tests/test_signature.py | 5 +++++ pytests/tests/test_srpms.py | 2 +- - 5 files changed, 15 insertions(+), 9 deletions(-) + 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pytests/repo/setup-repo.sh b/pytests/repo/setup-repo.sh -index a19bd20..ea015b7 100755 +index a19bd20..9897715 100755 --- a/pytests/repo/setup-repo.sh +++ b/pytests/repo/setup-repo.sh @@ -65,8 +65,8 @@ mkdir -p -m 755 ${BUILD_PATH}/BUILD \ @@ -40,15 +39,6 @@ index a19bd20..ea015b7 100755 modifyrepo ${REPO_SRC_DIR}/updateinfo-1.xml ${PUBLISH_PATH}/repodata check_err "Failed to modify repo with updateinfo-1.xml." -@@ -146,7 +146,7 @@ cat << EOF > ${TEST_REPO_DIR}/yum.repos.d/photon-test-src.repo - [photon-test-src] - name=basic - baseurl=http://localhost:8080/photon-test-src --gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY -+gpgkey=file:///etc/pki/rpm-gpg/MICROSOFT-RPM-GPG-KEY - gpgcheck=0 - enabled=0 - EOF diff --git a/pytests/tests/test_cache.py b/pytests/tests/test_cache.py index 2621b59..c01df02 100644 --- a/pytests/tests/test_cache.py