From Fedora Project Wiki
(Created page with "{{QA/Test_Case |description=This test case ensures that the `alternatives` system can manage and switch between alternative programs for a given function. |setup=Ensure you have a Fedora system with multiple versions of a program that uses the alternatives system. For this example, let's consider Java (`java` and `javac` commands). |actions= # Open a terminal. # List all the available alternatives for the `java` command: `alternatives --display java`. # Note down the cur...") |
(No difference)
|
Latest revision as of 17:31, 12 August 2023
Description
This test case ensures that the alternatives
system can manage and switch between alternative programs for a given function.
Setup
Ensure you have a Fedora system with multiple versions of a program that uses the alternatives system. For this example, let's consider Java (java
and javac
commands).
How to test
- Open a terminal.
- List all the available alternatives for the
java
command:alternatives --display java
. - Note down the currently selected version.
- Change the default
java
using:sudo alternatives --config java
and select a different version from the list. - Check the active version after changing it using:
java -version
. - Switch back to the original version using
sudo alternatives --config java
.
Expected Results
- The
alternatives --display java
command should list all available versions of Java with their corresponding paths. - After changing the default using
--config
, the output ofjava -version
should match the version you switched to. - Switching back should also reflect the appropriate version when you check with
java -version
.
Optional
For further exploration:
- Try the same process with other commands that use the
alternatives
system, likejavac
. - Install or remove a program version and observe how
alternatives
updates the list.