From Fedora Project Wiki

No edit summary
No edit summary
Line 4: Line 4:
|actions=
|actions=
#Create test file: {{command|touch /tmp/test}}  
#Create test file: {{command|touch /tmp/test}}  
#Check test file context: {{command|ls -Z /tmp/test}}.
#Check test file context: {{command|ls -Z /tmp/test}}|Result should be <pre>unconfined_u:object_r:user_tmp_t:s0 /tmp/test</pre>  
Result should be <pre>unconfined_u:object_r:user_tmp_t:s0 /tmp/test</pre>  
#Add new context for the test file  {{command|semanage fcontext -a -t user_home_t "/tmp/test"}}
#Add new context for the test file  {{command|semanage fcontext -a -t user_home_t "/tmp/test"}}
#List local customisations {{command|semanage fcontext -l -C}} <pre>/tmp/test    all files    system_u:object_r:user_home_t:s0</pre>
#List local customisations {{command|semanage fcontext -l -C}} <pre>/tmp/test    all files    system_u:object_r:user_home_t:s0</pre>

Revision as of 14:41, 1 August 2016

Description

This test case tests semanage basic functionalities (context addition/removal, listing).

Setup

Ensure that policycoreutils package is installed.

How to test

  1. Create test file: touch /tmp/test
  2. Check test file context: ls -Z /tmp/test

Expected Results

  1. All commands are executed successfully
  2. Context of the test file matches prescribed values