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
121 changes: 121 additions & 0 deletions SPECS/tdnf/fix-tests-for-azl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
From 39fed1f3b309e4aa088fedbb9174a4ec7327dfa3 Mon Sep 17 00:00:00 2001
From: Sam Meluch <sammeluch@microsoft.com>
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

2 changes: 1 addition & 1 deletion SPECS/tdnf/tdnf.signatures.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
43 changes: 32 additions & 11 deletions SPECS/tdnf/tdnf.spec
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -219,6 +237,9 @@ fi
/%{_lib}/systemd/system/tdnf*

%changelog
* Mon Sep 09 2024 Sam Meluch <sammeluch@microsoft.com> - 3.5.8-1
- Minor upgrade to tdnf

* Fri Jul 26 2024 Sam Meluch <sammeluch@microsoft.com> - 3.5.6-2
- Add tdnf virtual repo snapshots

Expand Down
4 changes: 2 additions & 2 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down
1 change: 0 additions & 1 deletion toolkit/resources/manifests/package/macros.override
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions toolkit/resources/manifests/package/pkggen_core_aarch64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions toolkit/resources/manifests/package/pkggen_core_x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions toolkit/resources/manifests/package/toolchain_aarch64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions toolkit/resources/manifests/package/toolchain_x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down