From Fedora Project Wiki
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.