From Fedora Project Wiki

Revision as of 14:16, 1 August 2016 by Plautrba (talk | contribs) (Created page with "{{QA/Test_Case |description=This test case tests semodule basic functionalities (module installation/removal, listing). |setup=Ensure that {{package|policycoreutils}} package ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

This test case tests semodule basic functionalities (module installation/removal, listing).

Setup

Ensure that Package-x-generic-16.pngpolicycoreutils package is installed.

How to test

  1. Create file called audittmp.cil containing simple auditallow rule:
cd /tmp
echo "(auditallow unconfined_t user_tmp_t (file (create)))" > audittmp.cil
  1. Install new module semodule -i audittmp.cil
  2. Check that the module is properly installed
semodule -l | grep audittmp
audittmp
  1. Create new file in /tmp

touch /tmp/new_file

  1. Check that the file creation was logged
ausearch -m avc -ts recent | grep new_file
type=AVC msg=audit(1470058493.388:6693): avc:  granted  { create } for  pid=7410 comm="touch" name="new_file" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=file
  1. Remove new module semodule -r audittmp
  2. Check that the module is no longer listed as installed semodule -l
  3. Clean up rm -rf new_file audittmp.cil

Expected Results

  1. All commands are executed successfully
  2. AVC message simillar to the one shown above was logged