From Fedora Project Wiki

No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
# Navigate to your repository directory: `cd /path/to/my/repo`.
# Navigate to your repository directory: `cd /path/to/my/repo`.
# Add this local directory as a repository for DNF:  
# Add this local directory as a repository for DNF:  
<nowiki>echo -e "[localtest]\nname=Local test repo\nbaseurl=file:///path/to/my/repo\nenabled=1\ngpgcheck=0" | sudo tee /etc/yum.repos.d/localtest.repo</nowiki>  
<nowiki>''echo -e "[localtest]\nname=Local test repo\nbaseurl=file:///path/to/my/repo\nenabled=1\ngpgcheck=0" | sudo tee /etc/yum.repos.d/localtest.repo''</nowiki>
# Execute: $ sudo dnf clean all to clean the DNF cache.
# Execute: $ sudo dnf clean all to clean the DNF cache.
# Check your repositories with: dnf repolist. Make sure the localtest repository appears.
# Check your repositories with: `dnf repolist`.  
# Try to list the available packages from your local repository: dnf --disablerepo="*" --enablerepo="localtest" list available.
# Make sure the localtest repository appears.
# Pick a package from the list (let's call it mypackage) and attempt to install it: sudo dnf --enablerepo="localtest" install mypackage.
# Try to list the available packages from your local repository: `dnf --disablerepo="*" --enablerepo="localtest" list available`.
# Pick a package from the list (let's call it mypackage) and attempt to install it: `sudo dnf --enablerepo="localtest" install mypackage`.
|results=
|results=
 
# You should see a new repository configuration file in `/etc/yum.repos.d/`.
# You should see a new repository configuration file in /etc/yum.repos.d/.
# The dnf repolist command should show localtest in its output.
# The dnf repolist command should show localtest in its output.
# The final command should list the packages from your local repository without any error.
# The final command should list the packages from your local repository without any error.

Latest revision as of 20:07, 14 August 2023

Description

This test case ensures that the repodata generated by createrepo_c is usable by dnf.

Setup

Ensure you have a directory from the previous createrepo_c test containing the generated repodata and that dnf is installed on the system.

How to test

  1. Navigate to your repository directory: cd /path/to/my/repo.
  2. Add this local directory as a repository for DNF:

''echo -e "[localtest]\nname=Local test repo\nbaseurl=file:///path/to/my/repo\nenabled=1\ngpgcheck=0" | sudo tee /etc/yum.repos.d/localtest.repo''

  1. Execute: $ sudo dnf clean all to clean the DNF cache.
  2. Check your repositories with: dnf repolist.
  3. Make sure the localtest repository appears.
  4. Try to list the available packages from your local repository: dnf --disablerepo="*" --enablerepo="localtest" list available.
  5. Pick a package from the list (let's call it mypackage) and attempt to install it: sudo dnf --enablerepo="localtest" install mypackage.

Expected Results

  1. You should see a new repository configuration file in /etc/yum.repos.d/.
  2. The dnf repolist command should show localtest in its output.
  3. The final command should list the packages from your local repository without any error.
  4. The command to list packages should display the packages in your local repository without errors.
  5. The package mypackage should be installed without any issues from the local repository.

Optional

For exploratory testing:

  1. Try installing a package from the local repo.
  2. Try searching for a package in the local repo.