From Fedora Project Wiki
Description
This test case ensures that the autofs service can successfully auto-mount specified file systems when accessed.
Setup
- Ensure you have a Fedora system.
- Install the
autofspackage:sudo dnf install autofs. - Ensure you have access to a network file share (e.g., an NFS share) for testing purposes.
- Backup the existing autofs configuration:
sudo cp /etc/auto.master /etc/auto.master.backup.
How to test
- Open a terminal.
- Start the autofs service:
sudo systemctl start autofs. - Ensure the service started without errors:
sudo systemctl status autofs. - Edit the autofs master configuration (
/etc/auto.master) to include your test mount point and map file. For example:/mnt/test /etc/auto.test(This assumes an NFS share). - Create a map file (
/etc/auto.test) with the details of your test share. Example for an NFS share:sharename -fstype=nfs,rw server:/path/to/share. - Reload the autofs service:
sudo systemctl reload autofs. - Access the test mount point:
ls /mnt/test/sharename. - Check that the specified share is mounted: `mount
Expected Results
- The autofs service should start without any errors.
- The status command should indicate that the autofs service is actively running.
- After editing the configuration and accessing the specified mount point, the share should be automatically mounted.
- The
mountcommand should confirm that the share is actively mounted. - After ceasing access and waiting for the timeout, the share should be auto-unmounted and not appear in the list of active mounts.
Optional
For further testing:
- Test with various file share types like NFS, CIFS, etc.
- Experiment with different mount options in the map file.
- Test the behavior when network connectivity is lost or when the file share becomes unavailable.
- Restore the original autofs configuration:
sudo mv /etc/auto.master.backup /etc/auto.masterand reload the service.
