From Fedora Project Wiki

Description

This test case helps test working of doas command

Setup

  1. Ensure the opendoas package is installed

How to test

  1. In the console, execute doas <any_command_you_want_to_Execute> and it will by default execute as root
  2. In the console, executing doas -u non_admin_user dnf update

Expected Results

  1. The first command will execute as everything is being treated as if run by root privileges
  2. The second command fails, since the dnf update requires root or sudo privileges. The err thrown out reads
[sumantromukherjee@fedora ~]$ doas -u sumantromukherjee dnf update
doas (sumantromukherjee@fedora) password: 
Error: This command has to be run with superuser privileges (under the root user on most systems).