diff --git a/SPECS/tdnf/fix-tests-for-azl.patch b/SPECS/tdnf/fix-tests-for-azl.patch new file mode 100644 index 00000000000..bd3c6e7731f --- /dev/null +++ b/SPECS/tdnf/fix-tests-for-azl.patch @@ -0,0 +1,121 @@ +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 + +--- + 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, 14 insertions(+), 8 deletions(-) + +diff --git a/pytests/repo/setup-repo.sh b/pytests/repo/setup-repo.sh +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 \ + 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." +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..3aea87b 100644 +--- a/pytests/tests/test_signature.py ++++ b/pytests/tests/test_signature.py +@@ -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.signatures.json b/SPECS/tdnf/tdnf.signatures.json index 348099056da..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.6.tar.gz": "69c31fbaab3ce9a88a4b925afb95b5cf71147f84808100b830890ae54c6d424a", + "tdnf-3.5.8.tar.gz": "c4bae9432f7e3441318aba7d4588528f419b384c23d526e77f794a2812aa2b10", "tdnfrepogpgcheck.conf": "84c1c0c956a492cadbfd2cec581ef678c190e3e245f0d61665eb0f66b8b34fd6" } } diff --git a/SPECS/tdnf/tdnf.spec b/SPECS/tdnf/tdnf.spec index b16ba2a02a7..d272580a05d 100644 --- a/SPECS/tdnf/tdnf.spec +++ b/SPECS/tdnf/tdnf.spec @@ -1,11 +1,10 @@ -%undefine __cmake_in_source_build %define _tdnfpluginsdir %{_libdir}/tdnf-plugins %define _tdnf_history_db_dir %{_libdir}/sysimage/tdnf 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 @@ -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,33 @@ systemd services for periodic automatic update %autosetup -p1 %build +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 +# 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 %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 +169,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 @@ -219,6 +237,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/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 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